Skip to content

Releases: mint-lang/mint

0.21.0

03 Dec 10:41
Compare
Choose a tag to compare

Standard Library

  • Added layerX, layerY, offsetX and offsetY to Html.Event. (#705)
  • Added Dom.offsetLeft and Dom.offsetTop. (#705)
  • Added Debug.inspect which returns the pretty printed version. (#704)
  • Fields that dont have a value in Html.Event return 0 instead of -1.

Language

  • Allow comments in arrays, tuples and between operators. (#714)
  • Allow referencing assets from the root of the project. (#707)
  • Allow referencing HTML elements and components in tests. (#715)
  • Allow global components in tests. (#715)
  • Whitespace is not needed around operators. (#706)
  • Use relative path for error messages. (#708)
  • dbg now prints the pretty printed version. (#704)
  • dbg! prints the raw version. (#704)
  • Fix parsing of parenthesized expression and inline function. (#718)
  • Make sure we try destructure the right thing when there are multiple entites with the same name. (#720)

Compiler

  • Allow generating source maps. (#702)

Documentation Server

  • Fix paths in documentation server.

Installer

  • Fix mint start dependency installation answer detection. (#711)
  • Provide a hint for the user to run a cleanup to avoid the errors. (#712)
  • Use a hash for repository directory instead of its URL. (#710)

Fixes

  • URI decode the request path when serving files. (#719)
  • Highlight single character errors. (#721)

Housekeeping

  • Refactor how location of nodes are calculated. (#703)
  • Format runtime source files.
  • Update dependencies. (#713)
  • Tweak build workflow.

0.20.1

23 Nov 08:45
Compare
Choose a tag to compare

Fixes a bug where a discard pattern _ is not handled when building scope.

Full Changelog: 0.20.0...0.20.1

0.20.0

06 Nov 05:34
fd07efb
Compare
Choose a tag to compare

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.

0.20.0-rc.1

29 Oct 16:17
Compare
Choose a tag to compare
0.20.0-rc.1 Pre-release
Pre-release

Standard Library

  • Add decimals argument to Math.round.
  • Added ordinal formatting of days to Time.format.

Fixes / Changes

  • Don't double semantic highlight some comments.
  • Restrict the scope of defers.
  • Allow omitting else of ifs with Promise(Maybe(a)) type.
  • Make sure references work properly when used in global components.
  • Properly remove test nodes when cleaning up.
  • Optimize root tracking algorithm by only tracking relevant nodes.
  • Remove not needed console.log call.

Full Changelog: 0.20.0-alpha.3...0.20.0-rc.1

0.20.0-alpha.3

21 Oct 07:51
Compare
Choose a tag to compare
0.20.0-alpha.3 Pre-release
Pre-release
  • Fix bundling issue with encoders / decoders resulting in a runtime error.
  • Properly load .env files when provided.

0.20.0-alpha.2

18 Oct 09:54
Compare
Choose a tag to compare
0.20.0-alpha.2 Pre-release
Pre-release

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...)

Standard Library

  • Added native CSV parser and generator.
  • Fix runtime error in HTTP module.

Language

  • Added signal which is a new kind of self updating state.
  • Added dbg to print better debug messages.

Type Checker

  • Fix an issue with multiple parenthesized if conditions.
  • Properly detect global name conflicts of Main.
  • Added discard pattern _ for destructurings.
  • Allow destructuring in for expressions.
  • Allow Number as HTML content.
  • Allow await anywhere (in pipes as well).
  • Added checks for the children property.

Installer

  • Allow installing packages with extra semver information.

0.20.0-alpha.1

08 May 15:00
Compare
Choose a tag to compare
0.20.0-alpha.1 Pre-release
Pre-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 and enum keywords are replaced by type.
  • &&, || 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 of assets.
  • --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.

0.19.0

18 Sep 08:10
Compare
Choose a tag to compare

Language

  • Added localization feature #618
  • Added support for named arguments #625
  • Added @highlight directive #615
  • Fix constants/gets not working within a provider #621 (@jansul)
  • Fix keywords and operators being kept when parsing a parent node fails #630 (@jansul)
  • Fixed a bug with async blocks which caused an error

CLI

  • Added @highlight command #615

LSP

  • Added semantic tokenizer support #615
  • Added go to definition support #619, #623, #636
  • Fix enum destructuring/id linking to other types with the same name #628 (@jansul)
  • Fix LSP::LocationLink's not being returned within an array #629 (@jansul)

Standard Library

Housekeeping

0.18.0

24 May 06:01
Compare
Choose a tag to compare

Language

  • Make parentheses optional for case, for and if expressions. (#589, #597)
  • Allow let statement in if expressions (#590)
  • Allow nested destructuring (#593, #238, #377, #226)
  • Allow else branch to be omitted in certain cases (#598)

Parser

  • Update Ast::Constant to use an Ast::Variable for its name (#594) @jansul
  • Convert type_id from String to a node (#592) @jansul

LSP

CLI

  • Use proper exit code for the formatting command (#586, #548)

Standard Library

  • 🚧 Refactor HTTP module (#588, #494)
  • Update Window.prompt (#587, #540)
  • Make sure that the file select input is added to the DOM.

Housekeeping

  • Update CI workflows @Sija
  • Continues refactoring @Sija

0.17.0

20 Apr 16:00
Compare
Choose a tag to compare

🚧 !!! This is a big release containing many breaking changes !!! 🚧


This release got pretty big and it would take a long time to gather all the changes, apologies for that.

Breaking Language Changes (check PRs for detailed changes)

  • #503
    • Allow multiple statements per block and added standalone block notation.
    • Promises changed to take a single parameter instead of two Promise(value).
    • Removed try, parallel, sequence, with, where, catch, finally and then language features.
    • Removed partial application language feature (conflicting with default arguments) until we can figure out a solution for the ambiguity.
    • Removed safe operators &. and &(.
    • Added block expressions.
    • Added optional await keyword to statements.
    • Added optional await keyword to the condition of case expressions.
    • Added the ability to define default values for function arguments.
    • Added the ability to create decoder functions using the decode feature by omitting the decodable object: decode as Array(String).
    • Records are now using : instead of =.
    • Added here document support:
      <<#MARKDOWN
      Renders markdown content to Html
      MARKDOWN
      
      <<-TEXT
      Text content which leaves leading indentation intact.
      TEXT
      
      <<~TEXT
      Text content which leaves trims leading indentation to the first line.
      TEXT
      
  • The pipe operator |> now puts the left hand side value as the first argument instead of the last. #571

Standard Library

There are too many changes to list here because of the standard library cleanup and pipe operator changes so consult the PRs #532 #503 and the API documentation if something doesn't work.

Language Server

  • Fix 100% CPU in Language Server when receiving EOF from STDIN #573 @jansul

Housekeeping

  • Maintain dependencies for GitHub Action @Sija
  • Fix typos throughout the codebase @Sija
  • Update CI workflows @Sija
  • Drop support for Crystal versions (< 1.7.0) @Sija