Mint Versions Save

:leaves: A refreshing programming language for the front-end web

0.20.0-alpha.1

3 weeks ago

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.

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

8 months ago

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

  • Added Url.toString #603 (@nilslindemann)
  • Added Console module #660 (@jrrom)
  • Added functions to the Math module #631 (@farism)
  • Added Window.jump function @616 (@nilslindemann)
  • Added Provider.Keyboard #663 (@farism)
  • Added Test.Html.triggerKeyUp and Test.Html.triggerKeydown #663 (@farism)
  • Added Validation.isDigits #612 (@nilslindemann)
  • Removed Provider.Keydown and Provider.Keyup #663 (@farism)
  • Fix Window.setScrollLeft and Window.setScrollTop #605 (@nilslindemann)
  • Fix Window.confirm #610 (@nilslindemann)
  • Window.triggerHashJump - when no hash, jump to start of document #611 (@nilslindemann)
  • Number.fromString - behaves a little different now #612 (@nilslindemann)

Housekeeping

  • Documentation fixes #604, #608, #626 (@nilslindemann)
  • Separate nightly CI #624
  • Removed deprecated 'with' from project init scaffold #653 (@jrrom)
  • Update test runner to serve assets #659 (@farism)

0.18.0

1 year ago

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

  • Add support for Go to Definition (#575) @jansul
  • Add tests for hover feature (#591) @jansul
  • Refactor definition to be similar to hover feature @jansul (#595)

CLI

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

Standard Library

  • :construction: 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

1 year ago

🚧 !!! 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

0.16.1

1 year ago

Make sure the build command succeeds if the public/assets folder is present.

0.16.0

2 years ago

Parser

The parser has been speeded up thanks to @asterite (#537) - it should parse twice as fast and consume half the memory in the general case.

Type Checker

  • Fixed a bug in scoping #529

Bundler

  • The service worker now only falls back to paths that matches any routes defined for the application @Eternahl #370 #539

Language Server

  • Added FoldingRange provider.
  • Added CodeAction provider.
  • Added a code action to sort the module entities in order.

Standard Library

  • Added Math.trunc
  • Added String.padLeft
  • Added String.takeRight

Time module rewrite

The time module has been completely reworked, check the PR: #526 and the docs for more information.

Housekeeping (@Sija @gdotdesign)

  • Bumped Crystal version requirement to 1.3.2
  • Makefile: Build the binary only if there are changed files
  • Updated dependencies

0.15.3

2 years ago

Fixed runtime error in Clipboard.set

0.15.2

2 years ago
  • Fixed a bug in function scoping #529
  • Fixed a bug in runtime which broke it on Safari

0.15.1

2 years ago

Fixed a regression in inline styles handling, where using an non-string attribute could lead to runtime errors (https://github.com/mint-lang/mint-runtime/pull/24)

0.15.0

2 years ago

Language

  • Time is now automatically serialized into String #357
  • Tuples now can be automatically serialized #519
  • Fixed selector reference & in styles #479
  • or operator can be used with Result(error, value) as well

LSP

  • Added basic completions for HTML tags and CSS properties #511
  • Added completions for enum options #518
  • Fixed cursor position lookup #481
  • Fixed some compatibility issues with specific clients #493
  • Honor snippetSupport client setting #520

CLI

  • A custom runtime can be used with the --runtime flag for the build and compile commands #476

Service Worker

  • Fix service-worker generation issue #506

Standard Library

  • Clipboard.set now returns a string and restores focus and text selection #524
  • Added Time.fromUnixTimestampInMs and Time.toUnixTimestampInMs #522

Web Components

  • Components can now be exported as web components #501

    A new field was added to the mint.json for this purpose:

    {
      "name": "my-library",
      "web-components": {
        "Button": "my-button"
      },
      "source-directories": [
        "source"
      ]
    }
    

    In the object, the key of the field refers to the component and the value refers to the tag name of the web component, in this case, the Button component will be exported as <my-button>.

Housekeeping

  • More cleanups and refactors by @Sija