0.13.0
Breaking Changes
-
Enum destructuring within
case
statements now uses parentheses and commas instead of whitespaces.Given this enum:
enum Status { LoggedIn(Time, User) LoggedOut }
Destructuing before:
case (maybe) { Status::LoggedIn time user => true Status::LoggedOut => flase }
After:
case (maybe) { Status::LoggedIn(time, user) => true Status::LoggedOut => flase }
This was a necessary step to make nested destructuring work.
Language
-
#81 #451 Added line comments: 🎉
// Line comment fun render : Html { ... }
-
Added
@inline
directive which inlines a text file into Mint code asString
:@inline(path/to/file.html) /* String */
-
#418 #419 Added
index
variable to thefor
loops:/* Iterating over Array(item) or Set(item). */ for (item, index of array) { ... } /* Iterating over Map(key, value). */ for (key, value, index of map) { ... }
-
#437 Tuples can be destructured recursively (@matthewmcgarvey):
case ({"A", {"B", "C"}}) { {a, {b, c}} => c => "" }
Official Docker Image
Mint now has alpine-based Docker images hosted on DockerHub (https://hub.docker.com/r/mintlang/mint) for tags and from master (latest
).
Housekeeping
- #429 Run core tests both on Chrome and Firefox in CI.
- Run a format test on the standard library in CI.
- Added
Dockerfile
for official docker images. - Cleanup Markdown files in the repository.
- #421 #423 #424 #425 No longer depending on
string_inflection
,time_format
,time_format
shards - @matthewmcgarvey - Move inlined HTML templates to their own files.
- Lot of assorted refactors 🙏 - @Sija
Standard Library
- Fixed some typos in the documentation comments.
- #427 Fixed
Window.scrollHeight
,Window.scrollWidth
,Window.scrollLeft
,Window.scrollTop
functions in non quirks mode. - Added
File.download
function. - Added
Http.Header
record. - Added
Http.hasHeader
function. - #454 Added
Maybe.withLazyDefault
function. - #453 #460
AnimationFrame
and its provider now provides the elapsed timestamp. - #432 #438 #434
Http.jsonBody
now sets theContent-Type
header of the request toapplication/json
.
Parser
- #435 #431 Optimizations to the parser lead to significant speedups in parsing.
- #420
try
expressions now need a space after thetry
keyword. - Don't parse double equals as a statement.
Type Checker
- #403 Fix rendering of types in error messages.
Formatter
- #273 Record constructors now format into multiple lines if it contains a line break.
- Only use a single space for empty records instead of two.
- Don't format Mint code in JavaScript interpolations.
Installer
- #398 The installer now uses the force flag to checkout using Git.
- #198 Added
mint-version
field to themint.json
which specifies which Mint versions the package works on.
Language Server
- The server now exits properly instead of hanging if the client disconnects unexpectedly.
Test Runner
- #433 #436 The suite name is displayed for failing test cases.
- #441 #443 The test location (filename, line, and column) is displayed for each failing test case.
Compiler
- Fixed the compile order of constants depending on other constants.
CLI
- #408 Added
sandbox-server
command which starts a server for compiling and formatting projects using requests. - #405 Added
lint
command to lint the project for syntax and type errors. - #412 Added
--minify
,--no-minify
flags to thebuild
andcompile
commands which control whether or not to minify the output JavaScript. - #450 Show syntax errors for the
format
command. - #413 Don't generate icons if there is no icon specified.
- Added
--check
flag toformat
command, allowing to check for changes without actually modifying the files (returns with exit code 1 if there are changes) - Added
-r
,--live-reload
,--no-live-reload
flags tostart
command which controls the live reload functionality. - Building assets now respect the
--relative
flag. - Fixed
format
command without any arguments. - Fixed
test
command to return with exit code 1 if any tests fail. - Changed
version
command now returns the plain version only.