:leaves: A refreshing programming language for the front-end web
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.
async
keyword for components (to be loaded later from a different file).return
keyword for early returns in blocks with destructuring.defer
keyword for loading code from different files.{ key => value }
.-> name
.highlight
parameter for here documents.@highlight-file
directive.await
-ed to wait with the hash navigation.Html
as is (no Html expression is needed).<{...}>
are deprecated in favor of Html fragments <></>
..name
now requires the type as a parameter .name(User)
.<
, >
, <=
, >=
operators are now only work with numbers.record
and enum
keywords are replaced by type
.&&
, ||
operators now only work with booleans.Dom.setValue
now returns the element when setting the value to empty string.Array
functions have been refactored to not use inlined JavaScript.Html.fromEvent
(was used internally).FileSize.format
to Mint only.Test.Context.assert
function.The runtime has been refactored and moved into the repository (the other will be archived).
@font-face
formatter.--env
flag is now local to commands that can use them.compile
command since it's no longer possible to emit a single JS file.docs
command temporary (it will be added back in a future release).build
__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.--timings
flag to show more information about the build process.--generate-manifest
flag to generate a web application manifest.--no-optimize
flag to disabled optimization.--verbose
flag to show the generated files.--env
flag.clean
--global
flag has been renamed to --package-cache
.format
mint.json
to format files.init
--bare
flag to generate a bare project.sandbox-server
--runtime
flag.start
--auto-format
to --format
live_reload
to --reload
--env
flag.test
--watch
flag to re-run test when files change.--env
flag.@highlight
directive #615@highlight
command #615LSP::LocationLink
's not being returned within an array #629 (@jansul)Url.toString
#603 (@nilslindemann)Console
module #660 (@jrrom)Math
module #631 (@farism)Window.jump
function @616 (@nilslindemann)Provider.Keyboard
#663 (@farism)Test.Html.triggerKeyUp
and Test.Html.triggerKeydown
#663 (@farism)Validation.isDigits
#612 (@nilslindemann)Provider.Keydown
and Provider.Keyup
#663 (@farism)Window.setScrollLeft
and Window.setScrollTop
#605 (@nilslindemann)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)case
, for
and if
expressions. (#589, #597)let
statement in if
expressions (#590)else
branch to be omitted in certain cases (#598)Ast::Constant
to use an Ast::Variable
for its name (#594) @jansultype_id
from String
to a node (#592) @jansulWindow.prompt
(#587, #540)🚧 !!! 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.
Promise(value)
.try
, parallel
, sequence
, with
, where
, catch
, finally
and then
language features.&.
and &(
.await
keyword to statements.await
keyword to the condition of case
expressions.decode
feature by omitting the decodable object: decode as Array(String)
.:
instead of =
.<<#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
|>
now puts the left hand side value as the first argument instead of the last. #571There 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.
Make sure the build
command succeeds if the public/assets
folder is present.
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.
FoldingRange
provider.CodeAction
provider.Math.trunc
String.padLeft
String.takeRight
The time module has been completely reworked, check the PR: #526 and the docs for more information.
Makefile
: Build the binary only if there are changed filesFixed runtime error in Clipboard.set
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)
Time
is now automatically serialized into String
#357&
in styles #479or
operator can be used with Result(error, value)
as wellsnippetSupport
client setting #520--runtime
flag for the build
and compile
commands #476Clipboard.set
now returns a string and restores focus and text selection #524Time.fromUnixTimestampInMs
and Time.toUnixTimestampInMs
#522Components 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>
.