0.20.0-alpha.1
Pre-release
Pre-release
github-actions
released this
08 May 15:00
·
144 commits
to master
since this release
Big Refactors
- The underlying structure of the runtime changed from class components to functional components and signals, this allows a two level structure (components have internal entities otherwise is everything is one level)
- The error messages have been reworked internally, texts were reviewed, and the UI is a bit simpler, all in all it's easier to work with internally.
- The compiler was fully refactored to emit ES5 modules and to support code-splitting.
- All commands now use the same bundler (development server, builder, test runner) instead of their own implementation.
- How variables are resolved has been rewritten from scratch.
Performance
The development server was type checking twice on each change, and it was checking everything. Now it only checks what the application is actually using, and it checks only once.
Language
- Added
async
keyword for components (to be loaded later from a different file). - Added
return
keyword for early returns in blocks with destructuring. - Added
defer
keyword for loading code from different files. - Added builtins feature for interfacing with the runtime.
- Added syntax sugar for creating maps:
{ key => value }
. - Added syntax sugar for setting state:
-> name
. - Added
highlight
parameter for here documents. - Added
@highlight-file
directive. - Allow routes to be
await
-ed to wait with the hash navigation. - Allow grouping inline comments (for documentation purposes).
- Allow full destructuring in if lets.
- Allow functions in test suites.
- Expressions can now be used as children of
Html
as is (no Html expression is needed). - Arguments with default values are now typed, checked against the defined type.
- Html expressions
<{...}>
are deprecated in favor of Html fragments<></>
. - Field access
.name
now requires the type as a parameter.name(User)
. <
,>
,<=
,>=
operators are now only work with numbers.- Removed the feature of memoizing static virtual DOM nodes.
record
andenum
keywords are replaced bytype
.&&
,||
operators now only work with booleans.- Removed record constructors
User(name, age)
.
Maintenance
- Support ARM mac in build workflow.
- Dry CI workflows (Crystal latest / nightly).
Standard Library
- Code is updated to reflect the changes in the language (use builtins, changed keywords, etc…).
Dom.setValue
now returns the element when setting the value to empty string.- Some
Array
functions have been refactored to not use inlined JavaScript. - Removed
Html.fromEvent
(was used internally). - Convert
FileSize.format
to Mint only. - Added
Test.Context.assert
function.
Runtime
The runtime has been refactored and moved into the repository (the other will be archived).
Formatter
- Update formatting of listed entities (honor whitespace).
- Added missing
@font-face
formatter.
Language Server
- Improve here document and string literal highlighting (semantic tokenizer).
CLI
- Most commands have been reviewed and changes were made to them.
- The
--env
flag is now local to commands that can use them. - Removed
compile
command since it's no longer possible to emit a single JS file. - Removed
docs
command temporary (it will be added back in a future release).
build
- The command is now less verbose by default.
- The generated assets are now stored in the
__mint__
directory instead ofassets
. --skip-service-worker
flag was removed, since no service worker is generated now.--inline
flag was removed, it's no longer possible to emit a single HTML file.--skip-manifest
flag was removed, manifest is now not generated by default.--minify
flag was removed, code is optimized by default.- Added
--timings
flag to show more information about the build process. - Added
--generate-manifest
flag to generate a web application manifest. - Added
--no-optimize
flag to disabled optimization. - Added
--verbose
flag to show the generated files. - Added
--env
flag.
clean
- The
--global
flag has been renamed to--package-cache
.
format
- The command has been refactored and should operate more sanely.
- No longer need a
mint.json
to format files.
init
- Scaffold application has been reworked to help new developers.
- Added
--bare
flag to generate a bare project.
sandbox-server
- Removed the
--runtime
flag.
start
- Renamed
--auto-format
to--format
- Renamed
live_reload
to--reload
- Added
--env
flag.
test
- Added
--watch
flag to re-run test when files change. - Added
--env
flag.