All Versions
12
Latest Version
Avg Release Cycle
50 days
Latest Release
37 days ago

Changelog History
Page 1

  • v0.7.1

    December 13, 2019

    ⚡️ Update code for Crystal 0.32.0

  • v0.7.0

    December 09, 2019

    Global 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

    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 with Maybe 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 and Result 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 and Time.year comment
    • 🛠 Fix Array.indexBy by adding tests and using interpolation
  • v0.5.0

    April 15, 2019

    JavaScript 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 as Array.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 in sequence or parallell expression
  • v0.4.0

    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 in mint.json to allow setting indent-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 the style 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.
  • v0.3.1

    September 10, 2018

    🛠 Fixes for the PWA (Progressive Web App) building process.

  • v0.3.0

    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 and parallel 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 from route

    Misc

    • 👍 Crystal 0.26 support
    • 💅 Use underscores to avoid style name conflicts
    • ➕ Added contributing guide
  • v0.2.1

    August 17, 2018

    🛠 Bugfixes

    • Detect recursion during type checking #20
    • 🛠 Typo fixes in messages #64 ce341f8
    • Property resolve the type of a state #67
    • 🛠 Fix for the decode statement #68

    Misc

    • ⚡️ Updates for the latest version of Crystal (0.26)
    • ➕ Added "What makes Mint unique?" question to FAQ in the readme 32d743b
    • Correct a link to project contributors in the readme #66
  • v0.2.0

    July 30, 2018

    💥 Breaking changes

    • Anonymous functions now have a new syntax #62
    • In record definitions the from keyword has been renamed to using and
      the decode keyword now honors it #51
    • The state keyword has been changed to be more in line with property #59
    • Stores are now using the state keyword instead of property

    Language features

    • Implemented array access #52
    • Implemented html fragments #63
    • Computed functions (get) now can have a where clause just like functions #49

    🛠 Smaller features / fixes

    • ➕ Added --relative flag to the build command #11
    • ➕ Added timeout to port checking in development server which fixes an issue on WSL #54
  • v0.1.0

    July 05, 2018

    Bigger features:

    • Added comments with the following syntax /* This is a comment */ 🎉
    • ➕ Added mint docs command to start a documentation server where you can browse the documentation of the current application / package and all of it's installed packages. 📖
    • 🔄 Changed the implementation of the type checker to use the Hindley Milner algorithm. This results in a more stable type checking phase.
    • In the mint.json file external JavaScripts can now be specified using external-javascripts field.
      These files are compiled in the head of the bundle.
    • encode keyword is now implemented to convert values to an Object, this is the counterpart of the decode keyword

    🛠 Small features / fixes:

    • 🛠 Fixed a bug during the build process related to sub directories in the public folder #38
    • mint init now works on existing directories #39 (thanks to @manveru)
    • There is a nice error message when dependencies are not installed #40 (thanks to @manveru)
    • ➕ Added default tests cases to the scaffolded project #41 (thanks to @manveru)
    • ✅ Make the test runner work in osx.
    • 🛠 Fix a bug in where module calls are not scoped to the module / store.