elm-community / js-integration-examples

Examples of common uses of ports and web components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Have a look at https://guide.elm-lang.org/interop/ to see what can be improved

mfeineis opened this issue · comments

  • Do the thing
    • Personally I like the new interop guide, it covers most of the questions I've seen beginners ask about flags and ports especially around how to use Elm.Main.init(...) providing the flags
    • A hint in https://guide.elm-lang.org/interop/ports.html that ports are only generated in JS when actually used in Elm would be handy as this is a common beginner hurdle
    • People who know other languages almost always have the same kind of questions about why Elm chooses to do stuff in specific - usually uncommon - ways. It might be helpful to include an FAQ on the usual topics
    • Pulling the "Design Considerations" out of interop/ports into its own interop/limits makes sense to give this information more exposure
    • The localization custom element example is way better than just having a link to MDN
  • Action items to create issues for
    • (#2) Add a hint to https://guide.elm-lang.org/interop/ports.html that only used ports are generated in JS
    • (#3) Create a guide on how to set up custom elements specifically for usage with Elm, decide whether this guide should be part of this repo and put the guide where it belongs
    • (#4) Create an FAQ on common interop topics with links to discourse and elm-discuss/elm-dev , decide whether this should be part of this repo and put it where it belongs (taks ports, FFI, kernel code, etc).

Some notes:

  • the links to the "simple" examples should stay unchanged, so https://guide.elm-lang.org doesn't break
  • there will be a more directory with a separate more/README.md that will harbor more information and "fancier" examples