Although it's recommended to not build components with states, you could still do it if you think it's necessary for your app. I documented the codebase structure I used at; https://azer.bike/journal/elm#codebase-structure
Ask HN: Anyone Using Elm in Production?
21–30 of 74 posts
Re: Ask HN: Anyone Using Elm in Production?
#22TL;DR: - The experience has been terrific. - Best compilator I have ever worked with. - Mostly great tooling. Love the auto-formatter. - Great libraries - No major issues, some small itches but nothing that can't be worked around. - No runtime errors in 18 months. - Very maintainable code - New team members quickly becomes productive in Elm, even with no prior experience (It helps to have someone with experience on the team to guide the learning and answer questions).
When it comes to nesting we sometimes make use of a component-like pattern, where we have modules with their own state, messages, update and view functions that are used by the main functions. To see an actual example of this check out this SPA example: https://github.com/rtfeldman/elm-spa-example/blob/master/src...
Re: Ask HN: Anyone Using Elm in Production?
#23Re: Ask HN: Anyone Using Elm in Production?
#24I remember hearing Facebook was using it for Facebook Messenger.
Re: Ask HN: Anyone Using Elm in Production?
#25Re: Ask HN: Anyone Using Elm in Production?
#26I’ve used ports and custom elements to integrate JS code.
I’m convinced Elm is an excellent way (and my preferred way) to build frontend apps.
The learning curve is a bit tricky. I think the path to toy apps is straightforward and fun. The path to “real world” apps requires a bit more effort. Expect to do some homework, hang out in forums etc.
Re: Ask HN: Anyone Using Elm in Production?
#27At CurrySoftware we use Elm for all of our frontend needs. Most recent example: https://www.pavoq.com a SPA built with Elm and Rust
Re: Ask HN: Anyone Using Elm in Production?
#28Elm made me hate working with Javascript in my job, and the differente is brutal. I don't believe in silver bullet but this is the domain where Elm shines: frontend development. I love every aspect of it. Elm is a very simple language, generates very small assets with a really fast compiler, gives us guarantees of no runtime exceptions in production, easy refactoring (in JS it would be a nightmare), has a time travel…
Re: Ask HN: Anyone Using Elm in Production?
#29Earlier quoted context omitted.
What is meant by "deeply nested components" and why can't you do them in Elm?
I think “deeply nesting components” means dropping a stateful component (view+behaviour+state) anywhere in your app without anything else changing. That’s not possible in Elm since the only place to store state is the central state storage. Which makes perfect sense, but often freaks people out, since it’s an uncommon design constraint.
And what do you do about generic reusuable components that need state? Say a typeahead search that needs to track the input string and the list of results from the server?