Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The problems were not with Elm per se but rather maintaining both Elm and React components.

> It seemed we were faced with a choice: Elm or React. Continuing to support both was fast becoming unsustainable for us.

> The thing that ultimately tipped the balance in React’s favour for us was that we acquired another company whose entire codebase was written in React, and whose team knew nothing about Elm. Overnight, we went from a company that was writing about equal amounts of Elm and React (and which might well have decided to double down on Elm) to one that was writing about 75% React.



There are libraries for using react components in Elm, but I haven't used them. I bet those weren't considered though.


They were considered, I was on the team that considered them. (I work at Culture Amp and at one point was leading the Design System team).

To be clear: embedding Elm in React is easy (we host the main NPM library for doing so: https://github.com/cultureamp/react-elm-components). But embedding React in Elm is harder, as Elm doesn't give any easy "escape hatches" to interact with native JS code.

The main opportunity is to use Web Components. Elm knows how to render any HTML component, including `x-my-custom-button`, which could render using React or something else. We looked into options for this, including prototyping https://www.npmjs.com/package/backstitch as a way to embed our React components as Web Components for consumption in Elm. (No open source packages existed to do this at the time).

We also did quite a deep dive on using Stencil, which has a React-like API, to create web components for both React and Elm - even including publishing new plugins for the ecosystem to generate Elm bindings for your web components. Kevin went into some of the detail for this in the post if you're interested.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: