Elm 0.19 TL;DR

2018-09-25

As the Elm 0.19 upgrade docs are lacking some vital information you only know about by consistently hanging out on the Elm Slack I thought I’d list them here for all the word to see.

  • Massive compile time improvements
  • Huge internal rework of the compiler that is prepared for the coming use-cases
  • Many bugfixes regarding performance - i.e. pattern matching on tuples, many case branches, unnecessary recompiles, too much IO, memory leaks
  • Removed many XSS attack vectors - i.e. disallowing innerHTML and inline event handlers
  • Removed user defined operators, i.e. no more Narsil operators in user code :slightly_smiling_face: <==|[======>
  • The already unpublished Native was renamed to Kernel and is no longer usable in user code, it always has been an implementation detail of the platform, native code is also built differently than before. Only elm and elm-explorations Github organizations can have effect Modules and Kernel code
  • Many modules have been moved out of the Elm core to be able to update them separately without having to release a new language version
  • Dead Code Elimination in production builds - smaller builds, opportunity for clever usage of compiler knowledge to improve runtime with --optimize flag for elm make
  • New elm.json format that includes test dependencies and supports the distinction of libraries and applications
  • Array is now faster and has some significant bugfixes
  • The magic polymorphic toString has been removed in favor of specialized functions like String.fromInt and the like
  • No more Debug.crash in production but is renamed to Debug.todo in debug mode
  • Event, port and message handling is now synchronous by default (you can opt-in to async on demand) which supports cases where events in the DOM have to be handled synchronously, i.e. the Clipboard API
  • Initialization on the JS side is done uniformly via Elm.Main.init({ flags: {}, node: document.querySelector("#root") })
  • There is now elm/browser which contains navigation, page eventhandling and page visibility APIs
  • Browser.application with full SPA routing
  • Browser.document set <title>, control <body>
  • Browser.element simple TEA “widget”
  • Browser.sandbox simplified beginner program
  • In addition to ports WebComponents are proposed for specific use cases of JS interop
  • The compiler can now be built with Haskell Stack - lts-11.20 for GHC 8.2.2 for now

Comments

The comments for this post are available on this issue on GitHub. Feel free to engage in conversation over there.

If you decide to enable JavaScript the GitHub API will be used to display the conversation here for the viewer's convenience.