Skip to content

0.20.0

Compare
Choose a tag to compare
@gdotdesign gdotdesign released this 06 Nov 05:34
· 22 commits to master since this release
fd07efb

There were so many changes in this release that it's really hard to gather every one of them so the changelog here is not exhaustive.

Big Refactors

  • Proper exhaustiveness checking (same implementation as Gleam). Deep destrucutrings will be property checked and reported.
  • The formatter has been rewritten to use a pretty printing algorithm. This means that it now properly honors line length and breaks things when necessary.
  • References tracker has been refactored, this means bundles will be calculated more precisely.
  • Rewritten the documentation generator, it is now HTML by default.
  • Refactored how mint.json are parsed, which results in better error messages.
  • Refactored how workspaces work internally and unified it across the board (development server, test runner, language server, etc...)
  • 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 signal which is a new kind of self updating state.
  • Added syntax sugar for creating maps: { key => value }.
  • Added builtins feature for interfacing with the runtime.
  • Added syntax sugar for setting state: -> name.
  • Added highlight parameter for here documents.
  • Added discard pattern _ for destructurings.
  • Added dbg to print better debug messages.
  • Added @highlight-file directive.
  • Allow routes to be await-ed to wait with the hash navigation.
  • Allow grouping inline comments (for documentation purposes).
  • Allow omitting else of ifs with Promise(Maybe(a)) type.
  • Allow await anywhere (in pipes as well).
  • Allow destructuring in for expressions.
  • 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 and enum keywords are replaced by type.
  • &&, || operators now only work with booleans.
  • Removed record constructors User(name, age).

Type Checker

  • Fix an issue with multiple parenthesized if conditions.
  • Properly detect global name conflicts of Main.
  • Added checks for the children property.
  • Allow Number as HTML content.

Standard Library

  • Dom.setValue now returns the element when setting the value to empty string.
  • Some Array functions have been refactored to not use inlined JavaScript.
  • Added ordinal formatting of days to Time.format.
  • Removed Html.fromEvent (was used internally).
  • Added decimals argument to Math.round.
  • Convert FileSize.format to Mint only.
  • Added Test.Context.assert function.
  • Added native CSV parser and generator.
  • Fix runtime error in HTTP module.

Installer

  • Allow installing packages with extra semver information.

Maintenance

  • The runtime has been refactored and moved into the repository (the other repository will be deleted).
  • Support ARM mac in build workflow.
  • Dry CI workflows (Crystal latest / nightly).

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, refer to the --help argument for the current versions

  • Removed compile command since it's no longer possible to emit a single JS file.
  • The --env flag is now local to commands that can use them.