Skip to content

Releases: mint-lang/mint

0.27.0

14 Aug 11:56
Compare
Choose a tag to compare

Language

  • Removed syntaxes which were deprecated in 0.20.0 (to migrate automatically run mint format with any binary between 0.20.0 and 0.26.0):

    • Constant access using colon :
    • Type variants using double colon ::
    • enum, record keywords
    • HTML expressions <{ }>
  • Added context feature to pass down props without prop drilling. (#783)

  • Allow testing and unboxing on Maybe, Result and Html in if.

  • Allow record destructuring in statements.

LSP

  • Return all locations of an error for linting and diagnostics.

Bugfixes

  • Fix a bug in Regexp.exec.
  • Properly resolve type definitions.

Housekeeping

0.26.0

09 Jul 16:23
Compare
Choose a tag to compare

Standard Library

  • Added arguments for upload and download progress to Http.send.
  • Added FormData variant to Http.ResponseBody.
  • Added FormData.getFile and FormData.getString functions.
  • Added File.fromUrl function.
  • Added Regexp.exec function.
  • Added Html.DataTransfer.getMimeTypes function.

Exporting Entities

The build command now takes any number of --export arguments which allows exporting entities from the final bundle.

Functions and constants can be exported from modules, variant constructors from types and components. Components are exported in a way that they can be used easily.

Here is a minimal example:

component Greeter {
  property name : String = ""

  fun render {
    "Hello #{name}!"
  }
}
mint build --export Greeter
import { Greeter } from `index.js`;

// Render the component into a DOM element.
Main.render(document.querySelector('div'), { name: "Joe" })

Bugfixes

  • Properly resolve static type signature of Ast::Type
  • Make sure that variable labels survive pruning. (#780)

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.