6 ms·
Does Elm have any nice interfaces for common JS frameworks? (like reagent / om in clojurescript, or angular2 for dart / typescript)
by mswift42 10y ago
Does Elm have any nice interfaces for common JS frameworks? (like reagent / om in clojurescript, or angular2 for dart / typescript)
- snuxoll 10y agoElm doesn't really "need" interfaces to react/angular/whatever, the Elm Architecture defines a standard way to write a reactive application in pure Elm (in a style similar to react/redux).
- drdaeman 10y agoSo Elm is only usable for new projects (or rewrites from scratch) and can't be "tried out" if you have some existing mess of a code and want to replace some especially ugly chunk of it (or write a new feature) - just to see how it goes?
- zalmoxes 10y agoNo that's not true. Richard from NRI wrote a great blog post about just "trying out" elm in your React app. http://tech.noredink.com/post/126978281075/walkthrough-introducing-elm-to-a-js-web-app http://tech.noredink.com/post/126978281075/walkthrough-intro...
- seddona 10y agoWe use Elm inside Angular in production. On https://circuithub.com/projects/ti/TIDA-00230 https://circuithub.com/projects/ti/TIDA-00230 most of the drawing is Elm.
- skybrian 10y agoPorts were the way to do this in Elm. I don't know how it works in the new version.
- jmite 10y agoThey do, and have been made much clearer: http://guide.elm-lang.org/interop/javascript.html http://guide.elm-lang.org/interop/javascript.html
- uknowthen 10y agoElm has JS interop via ports, which would allow you to mix or migrate towards elm. https://evancz.gitbooks.io/an-introduction-to-elm/content/interop/index.html https://evancz.gitbooks.io/an-introduction-to-elm/content/in...
- Ciantic 10y agoEmphasis on the migrate, you do not want to have app with both JS and Elm for a long term perhaps. In the main article: "I do not expect to be compiling to JavaScript forever, especially with WebAssembly on the horizon. The smaller the interface between Elm and JS, the easier it will be to support other platforms." While I don't want to sound doom and gloom, the JavaScript support according to article is anomaly of today's browsers. So if you want to rely on two parts JS and one parts Elm type of thing, it's good to know it maybe gone.
- jahewson 10y agoelm-html gives you a very nice interface to virtual-dom, which combined with the Elm Architecture is all you need.
- callahad 10y agoIn general, you're unlikely to need them. Instead of cobbling together disparate libraries for a virtual dom (React), state (Redux), immutability (Immutable.js), and types (Flow / TypeScript), the entire language and its core libraries are developed as a holistic (but still modular) unit. In this way, Elm is the BSD to JavaScript's GNU/Linux. Strong typing and immutability are baked directly into the core language, elm-lang/html includes an efficient Virtual DOM, and Redux-style action / reducer cycles tend to naturally arise from "The Elm Architecture," and don't need significant support beyond what's already in the core language. If you've bought into the React/Redux paradigm, it's worth giving Elm a shot: the entire language and core libraries are intentionally designed to more cleanly, reliably, and maintainably implement the same structure.