Changelog History
Page 1
-
v0.10.0-pre Changes
August 05, 2020๐ This is a test release for upcoming 0.10.0 version, DO NOT USE!
-
v0.9.0 Changes
April 06, 2020This release containes 67 commits from 7 contributors ๐
Type system changes
There are several improvements relating to the type system (#216)
- the return type signature of a function is now optional
- the type signature of a computed property is now optional
- the type signature of a property is now optional
- the type signature of a state is now optional
- the type of an arrays items can be specified using the
of
keyword - the type of an inline javascript can be specified using the
as
keyword
CSS features
โ Added support for
@font-face
,@supports
,@keyframes
rules #166 #238๐ Changes / Additions
- ๐ fix whitespace parsing in list type nodes #232
- โ added record constructors #191
- it is now possible to pipe into any expression #228
- 0๏ธโฃ the default value of a property is no optional #132
- config option to turn off generation of icons #224
- โ add
Array.min
,Array.max
now returnsMaybe(Number)
#229 - 0๏ธโฃ when running
mint start
if default port is taken, allow return (with no explicit Y) to start dev server - ๐ fixed exhaustivness check for case which contains array destructuring #225
- ๐จ print alternative link when starting a server if it's different # 230
- โ added
String.toArray
andString.fromArray
#178 - ๐ change failing test indicator from red dot to red "F"
- โ add
Mint::VERSION
constant shelled-out toshards version
๐จ Special thanks to @Sija for doing an overall code review and many refactors and optimizations.
-
v0.8.0 Changes
March 13, 2020This release contains 122 commits from 6 contributors ๐
๐ฑ ๐ง Breaking changes ๐ง
Mint now uses Preact instead of React (this should not break anything though) which will result in smaller compile files.
๐ฑ External assets are now handled differently:
- stylesheets are now supported as well
- javascripts and stylesheets are now compiled into their own file
- more information in issues and PRs: #151 #155 #183
CSS rules whith multiple selectors are now compiled separately f2eab4b:
div,p { color: red; }
now compiles as:
div { color: red; }p { color: red; }
โ Additions
Implemented constants for stores , components and modules #194
Implemented unary minus expression #201
Implemented tuples #209
Implemented array destructuring #210
๐ Allows inline functions to be called recursively #181, #199
โ Added more functions to the core library:
Clipboard.set
FileSize.format
Provider.MediaQuery
Provider.Resize
Provider.Shortcuts
Dom.containedInSelector
Dom.getAttribute
Dom.setStyle
Dom.focus
Dom.getElementFromPoint
String.trim
String.withDefault
Window.prompt
Window.open
Window.getScrollbarWidth
Maybe.andThen
#197Math.random
#190
๐ Fixes and other changes
- ๐ Show error for formatter if the pattern is invalid #157
- โ
Format files in both
source-directories
andtest-directories
#158 - ๐ Allow underscores in environment variable names
- ๐ Fixed an issue when media query provider triggering events for non subscribers
- ๐ Fixed
String.trim
- ๐ Fixed
Time.range
because of DatFNS update - ๐ Fixed an error when rendering HTML errors on WSL
- ๐ Fixed an issue of resolving function type definitions #212
sequence
andparallel
reserved variable names #185- ๐ง Make host:port configurable for test server #207
- ๐ Show more context for the missing closing tag syntax error #213
- Display more relevant errors for property and state if the type is a record without definition #188
-
v0.7.1 Changes
December 13, 2019โก๏ธ Update code for Crystal 0.32.0
-
v0.7.0 Changes
December 09, 2019Global components
๐ Components can be prefixed with the
global
keyword, this will add them to the DOM automatically and it's methods can be called the same way as a store or module.It is useful for components that only need one instance in the application,
like modals and notifications:global component AlertModal { state shown : Bool = false fun open : Promise(Never, Void) { next { shown = true } } fun close : Promise(Never, Void) { next { shown = flase } } style base { position: fixed; bottom: 0; right: 0; left: 0; top: 0; } fun render : Html { if (shown) { <div::base> <p> Are you sure? </p> <button onClick={close}> Ok </button> </div> } else { <></> } } } /* Later on somewhere else */ AlertModal.open()
Statically compiled components / HTML
๐ In this release the compiler will detect components and HTML fragments that are essentially static, meaning that subsequent renders would always result in the same virtual DOM structure.
These fragments and components will be cached so to speak, they will only rendered once and get reused after that.
To give you an example, the following component will only be rendered once and is reused after that:
component Icons.Checkmark { fun render : Html { <svg> /* The svg data */ </svg> } } component Main { fun render : Html { <div> <Icons.Checkmark/> <Icons.Checkmark/> </div> } }
๐ New Features
- ๐ Allow omitting else branch of if in HTML
- โ Added command to generate the documentation in JSON format
- ๐ Allow "&" for attributes and classes (CSS)
- ๐ Allow embedding the Main component without taking over the body
Miscellaneous
- ๐ Updated documentation of some functions
๐ Bugfixes:
- ๐ Fix compiling of multiple sytles with parameters.
- ๐ Fix compiling of interpolations in css values
- ๐ Properly merge ifs and cases in a style and preseve their order
- ๐ Allow creating records for nested records in encode
- Don't catch and unbox values from the last returning result in a try expression.
- ๐ Make sure we scope to the entities correctly.
-
v0.6.0 Changes
October 30, 2019๐ฅ Breaking Changes
- References of elements and components now return a
Maybe
- โ Remove pre defined global styles from the generated HTML #125
- Type variables are not allow in component properties and records
- Record definitions are needed for records except records for
encode
๐ New Features
๐ Improvements for the style tag #140 #128
String interpolation #141
Implemented member access function for records:
object = Maybe::Just({ name: "Joe" }) Maybe.map(.name) /* Maybe::Just("Joe") */
Implemented safe operators (
&.
and&(
) for dealing withMaybe
in specific cases:Maybe::Just({ name: "Joe" })&.name /* Maybe::Just("Joe") */ Maybe::Just(() : String { "Joe" })&() /* Maybe::Just("Joe") */
Implement static and runtime type checking for route parameters #134
๐ Changes
- โ Add chromium as recognized executable name for test runner #116
- ๐ Allow namespaces in HTML attributes #119
- ๐ Allow string style attributes on elements
- ๐ Allow function recursion by using it's static type definition
- ๐ Allow decoding time from a number (unix timestamp) #137
- ๐ Allow decoding
Object
as itself - Parenthesize JS interpolated values to avoid confusion #135
- Serve files from baked files and public folder with right mime types #129
- Don't generate links for icons if there aren't any #126
- Replace native
Maybe
andResult
implementations with enums #133 - ๐ Use static recrod of a component when accessing it as a ref
๐ Bugfixes:
- ๐ Fix formatting of multiline strings #129
- ๐ Fix
readonly
attribute compiling - ๐ Fix crash with remainder
%
operator
Core
- โ Added
Array.sumBy
- โ Added
Array.sum
- โ Added
Dom.focusWhenVisible
- โ Added
Dom.contains
- โ Added
Number.format
- โ Added
String.replace
- โ Added
Test.Html.assertActiveElement
- โ Added
Set.size
- ๐ Fix some
Set
functions - ๐ Fix
Time.month
andTime.year
comment - ๐ Fix
Array.indexBy
by adding tests and using interpolation
- References of elements and components now return a
-
v0.5.0 Changes
April 15, 2019JavaScript output optimizations
โก๏ธ All generated JavaScript code is now optimized in the following way:
- top level entity names are now mangled (Components, Stores, Modules, etc.)
- entity level names are now mangled
- ๐ white space is removed from the generated code (build only)
- the CSS selectors and variables are now mangled
This change means that inlined JavaScripts no longer can access arguments by name.
This will result in a runtime error because the argument
message
is mangled:fun log (message : String) : Void { `console.log(message)` }
To fix this we need to interpolate the argument:
fun log (message : String) : Void { `console.log(#{message})` }
Calls on expressions
Previously the calls to functions were implemented in two forms: call on a
variable and call on a module function.This meant that calling a function which
is in a record or which is a result of a function call were not possible.๐ This release makes it possible to make a call on the result of an expression.
This is an example which raises in error in 0.4.0 but compiles properly in 0.5.0:
module Test { fun a (message : String) : Function(String) { () : String => { message } } fun b : String { a("Hello")() } fun c : String { try { record = { function = (message : String) : String => { message } } record.message("Hello") } } }
Partial Application
Functions now can be partially applied by calling them with less arguments than
needed.An example of using partial application:
/* Format a number by thousands, output: 1,000,000 */ "1000000" |> String.split("") |> Array.groupsOfFromEnd(3) |> Array.map(String.join("")) |> String.join(",") /* The argument String.join("") (to Array.map) is a partially applied function where it's type is Function(Array(String), String) */
โ Warning for unkown CSS properties
CSS properties are now checked against a list and will result in an error if
they are not in the list.๐ Changes
- ๐ Fixed array access (
[]
) when an expression is used as an index - 0๏ธโฃ Default values of properties are now only calucated once when the component is initialized
- Providers can now be accessed the same a stores, or modules for introspection
- Records now can be created without type definition. Such records have a temporary type definition created for them during type checking
- [Runtime] Functions are bound to components and modules only once (in the constructor) instead of using
.bind
every time they are called
Formatter
- Inline functions can now be forced to format the body on a new line by adding
a line break after the opening bracket{
- 0๏ธโฃ Properties can now be forced to format the default values on a new line by
โ adding a line break after the equal sign=
- โ Added missing formatter for array access (
[]
)
Core
- โ Added
Array.groupsOfFromEnd
which is the same asArray.groupsOf
but grouping from the end - โ Added
Array.indexBy
to get an items index by a function - โ Added
Http.requests
for inspection purposes - โ Added
String.rchop
- โ Added
String.lchop
Html.Event
is now wrapped in an actual record, so it can now be safely used insequence
orparallell
expression
-
v0.4.0 Changes
February 23, 2019๐ฅ Breaking Changes
- โ Removed
=>
from inline functions - ๐ฆ
mint-core
package is now included in the binary (no longer needed as a dependency)
๐ Features
- โ Added
--skip-service-worker
flag to skip generation of service worker #96 - Added for expression to allow iterating over some types #110
- โ Added ability to expose an item of a store with a different name (
connect X exposing { y as z }
) - โ Added
formatter-config
field inmint.json
to allow settingindent-size
#10 - Implemented language feature for loading environment variables using the
@VARIABLE
syntax - Implemented Dead Code Elimination #98
- Implemented JavaScript interpolation using the
#{...}
syntax - Implemented referencing childen of a component #108
- ๐ Allow passing
Map(String, String)
to thestyle
attribute of an element.
๐ Bugfixes / Improvements
- ๐ Raise proper exception when parsing type. #95
- ๐ Allow hash to be matched in routes #101
- ๐ Allow whitespace at the end of parameter list of inline function
- ๐ Allow whitespace between parentheses of if condition #100
- ๐ Allow functions without the event parameter to be passed to event attributes.
- โ Added progress bar about parsing files in the CLI
- The type checker now checks for naming conflicts of Types and Enums
- โ Added formatter for array access.
- Automatically break connect exposes if there is at least new line between them.
- Don't automatically split long strings only if they are split at least once.
- โ Removed
-
v0.3.1 Changes
September 10, 2018๐ Fixes for the PWA (Progressive Web App) building process.
-
v0.3.0 Changes
September 09, 2018๐ฅ Breaking changes
- ๐
do
has been removed - Variable shadowing are not allowed and will result in a type error
Language features
- โ Added
sequence
andparallel
for better asynchronous task handling - Enums now can have parameters and can now be destructured in case statements (essentially they become type ADTs) #71
else if
can be written now #72- โ Added empty
catch
to catch all errors #69 - โ Added version command to the CLI #80
- โ Added type checks for case branches
- โ Added support for encoding and decoding
Map
- โ Added initial support for progressive web apps (PWA) by caching all files for offline use
encode
can now encode records which have no associated type
๐ Smaller features / bug fixes
- ๐ Fixed typo in build command
- Block comment improvements #89
- ๐ Fix error on project initialization #87
- ๐ Allow specifing dependencies without the
.git
extension #77 - Generate icons in more sizes
- Correctly format empty fragments
<></>
- Break function arguments into separate lines if they would result in long lines
- ๐ Don't raise initial parsing error when running the development server
- ๐ Fix incorrect resolving of function type
- โ Removed
Void
type restriction fromroute
Misc
- ๐ Crystal 0.26 support
- ๐ Use underscores to avoid style name conflicts
- โ Added contributing guide
- ๐