Improved documentation for flags, ports, and custom elements

I like the changes. I think the encouragement that is provided to seriously consider the interop upfront for commercial projects reads humble and honest.

The Limitations part seems mostly written to explain how the interop strategies pertain to packages, but doesn’t address the application side very much.

It would also be nice to produce an Elm specific guide to custom elements (not saying you should write it). Due to the history of how they came to be in browsers, there is a lot of tricky bits that are hard to get practically right and the documentation is mostly confusing. Specifically, I’d like to see someone address:

  1. What parts of the spec are actually useful right now for practical use with Elm. I’ve had a lot of success with the core Custom Elements, but less so with Shadow DOM, HTML Imports, Templates and Slots and other parts of the specs.
  2. Polyfills? Which one do I need? For what browsers?
  3. Bundler compatibility: As custom elements rely on JS Classes, a lot of bundlers break them by compiling to ES5. How do I make it work with popular bundlers?
  4. Attributes vs properties. When to use which? Performance?
  5. DOM upgrading. How to handle if the custom element gets initialised after the Elm application?
  6. Events: How to handle events in a performant way? Overriding addEventListener vs proactively dispatching events and the tradeoffs of both. Using getters for lazily computing stuff from Elm.
14 Likes