Skip to content

Releases: mint-lang/mint

0.25.0

20 Jun 11:10
Compare
Choose a tag to compare

Language

  • Allow defining fallback Html for async components. (#772)
  • Allow decoding and encoding Map with any type of keys. (#513)
  • Implement hash routing. (#779)

Standard Library

  • Added Object.Error.fromString function.

CLI

  • Add command line switch to display browser output during mint test. (#770 @MathiusD)
  • Add more information for the lint command with the --json flag. (#465)
  • Show warning for port mismatch when running tests. (#684)

Language Server

  • Implement textDocument/documentSymbol request for the language server. (#647)
  • Implement simple diagnostics provider for the language server.
  • Add keyword completions to the language server. (#512)

Bugfixes

  • Copy mappings when creating fresh records.
  • Make sure captured arguments are compiled into the correct place.
  • Don't restrict environment variables to the project directory. (#771)

Housekeeping

  • Fix mint compilation with Crystal version between 1.8.X & 1.10.X. (#769 @MathiusD)
  • Use latest version of Crystal. (1.16.0)

0.24.1

05 May 15:15
Compare
Choose a tag to compare

Fixed a regression where recursive types returned a recursion error.

0.24.0

05 May 07:33
Compare
Choose a tag to compare

Language

  • 🚧 Constants cannot be used in pattern matching.
  • Alternative patterns can be defined for case expressions. (#757)
  • Allow matching on records in pattern matching. (#755)
  • Automatically serialize custom types. (#750)

Standard Library

  • Added Array.all function. (#753)

Bug fixes

  • Don't raise error when trying to substitute on records.
  • Parenthesize state setters generated function. (#766)
  • Fix decoding tuples where the value was nullable.

Housekeeping

0.23.2

20 Mar 13:36
Compare
Choose a tag to compare
  • Make sure piping to a captured function works as intended.

0.23.1

20 Mar 04:41
Compare
Choose a tag to compare
  • Function captures now properly return the value from the inner function call.

0.23.0

19 Mar 15:09
Compare
Choose a tag to compare

Language

  • Implement function captures. (#749)

Type Checker

  • Show proper error message when trying to destrucutre a paramter that doesn't exist. (#746)
  • Show proper error when there are component and module with the same name. (#736)
  • Add proper error message for the impossible error. (#737)
  • Build scope for destructurings.

Parser

  • Fix a bug in parsing whitespace in certain conditions.

Compiler

  • Parenthesize inline functions following await keyword.

Standard Library

  • Added Set.reduce, Set.union, Set.intersection, Set.difference, Set.isDisjoint and Set.isSuperset functions. (#739)
  • Use proper type variable name for Array.findByAndMap (#748)

Runtime

  • Intercept submit events for navigation with GET method. (#742)

Bundler

  • Don't try bundle unused async components.
  • Follow symlink for public files.

Housekeeping

0.22.0

27 Jan 13:58
Compare
Choose a tag to compare

Language

  • Stop parsing blocks when they don't have any statements. (#731)
  • Handle Ast::Discard when building the scope tree. (#724)
  • Allow parsing case branches with brackets for CSS. (#727)
  • Show better error message for missing variant. (#725)
  • Show better error location for missing CSS definition semicolon. (#726)

Bundler

  • Put index.css after head to honor CSS specificity set by classes. (#723)

Runtime

  • Make sure that we set empty references as Maybe.Nothing.
  • Set styles as strings if one of the values contains !important definitions. (#728)

Test runner

  • Use new headless parameters for testing in Chrome.

Housekeeping

  • Updates for Crystal 1.15.0
  • Updates to the GitHub Action workflows.

Full Changelog: 0.21.0...0.22.0

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.