Skip to content

0.12.0

Compare
Choose a tag to compare
@gdotdesign gdotdesign released this 13 Apr 08:23
· 687 commits to master since this release

This release brings language server support and asset handling to Mint!

Language Server 🎉

One of the highly requested features the language server is now available using the mint ls command.

Having this shipped allows us to incrementally implement other features such as showing errors and goto declaration / implementation.

Format on save

The files are formatted when saved if they don't contain any errors.

format-on-save

Hover Provider

The type information of most entities can be checked by hovering over them also, if available the documentation is displayed as well.

hover

Completion

Completions are provided for entities in stores, components, modules and also in scope variables (depending on where to cursor is).

completion

New App Template

A new application template has been implemented!

App Template

Language Features

The asset directive was implemented also support for constants in tests.

Asset Directive

The asset directive allows you to reference an asset (image, stylesheet, video, etc..) - relative to the current file. These assets are bundled in the production build.

component Main {
  fun render : Html {
    /* The image should be in the same directory as this file. */
    <img src={@asset(some-image.jpg)}/>
  }
}

Only those assets get bundled which are touched during type checking, for example if a component references some assets then those assets are only bundled if that component is used.

Constants in Tests

Constants can now be used in tests:

suite "Some tests" {
  const VALUE = "Hello"

  test "Constant equals Hello" {
    VALUE == "Hello"
  }
}

Runtime

  • Fixed Preact to 10.4.4 (last known working version).
  • Don't use shouldComponentUpdate in components #316.
  • Normalize dataTransfer and clipboardData fields in events.
  • Properly resolve page position after navigation (hash jump, scroll to top).
  • Don't handle links that point out of the current frame.

Formatter

  • Implemented missing CSS keyframes formatter.
  • Properly format Html body when there are only comments inside.
  • Open modules now format properly (not duplicating entities).
  • Format Html body properly if it's children has new lines.
  • Format inline functions as multiline if they contain new lines.
  • Format state statements as multiline if appropriate.

Housekeeping

  • Crystal 1.0 compatibility.
  • Builds now use the latest crystal version.
  • #375 Contribution guide has been updated (@itsgreggreg).
  • #383 Github actions has been improved (@Sija).

Standard Library

  • Added Map.fromArray.
  • Added String.wrap.
  • Added String.indent.
  • Added String.indentWithOptions.
  • Added Time.nextWeek.
  • Added Time.previousWeek.
  • Added Function.debounce1.
  • Added Html.Portals.Head component.
  • String.parameterize now converts titlecase to dash case.
  • Window.isActiveURL now ignores search (query) parameters and the hash.
  • Window.open now works again #390.
  • Make sure the copy clipboard function does not scroll the page.

Minor changes / fixes

  • Use Array(Char) instead of String in the parser which speeds up parsing in some cases.
  • #385 Rename manifest.json to manifest.webmanifest (@jonathanoberg).

Fixed issues

  • #371 Case does not unify branches which can lead to unexpected behaviour.
  • #372 Make sure that module functions are resolved in the proper scope.
  • #373 Convert string literals in CSS values to string unless they contain interpolations.
  • #376, #358 Make sure that error messages render properly.
  • #381 Try now can return a result directly (@itsgreggreg).
  • #366 Gracefully shut down the test runner in case of uncaught exceptions in JavaScript (@Sam647254).