News for hackers. Stuff that matters.
Re:Why I don't miss React: a story about using the platform by quickthrower2 on Tuesday May 03, 2022 @10:50PM (#31256208)
This is why I felt out with Elm. It is harder to escape the hatches with it.
Re:Why I don't miss React: a story about using the platform by mejutoco on Wednesday May 04, 2022 @03:18AM (#31257663)
You can use the ports system and interoperate with js in Elm. I used it in the past and it is quite a clean abstraction.
Re:Why I don't miss React: a story about using the platform by bigDinosaur on Wednesday May 04, 2022 @04:08AM (#31257937)
It's frustrating that it forces you to jump into handling async code, though, in all cases. This wasn't always the case, and for good reason: sometimes async code is just vastly more complicated for no actual benefit if you can tolerate the FFI causing a crash at any calling point.

The interest in Elm took a major hit after the compiler banned use of JS.

Re:Why I don't miss React: a story about using the platform by quickthrower2 on Thursday May 05, 2022 @12:55AM (#31269631)
That is what I mean! You need static top-level declarations of every out-of-elm iteration you want to do.

React on the other hand can wrap a JQuery calendar in a React component and from a programming point of view, using that component you would be none the wiser.

Also ports force everything to be async - and I am not talking just promises - I mean a new render per call response! So calculating 1+1 on a port requires generate a new render, and intercepting the result in a Redux-style handler, bubbling that into a component.

While you won't need to do 1+1 via ports, you might need to use a synchronous web-api feature that has not been ported to elm, or even use a math package to multiply some matrices.

Re:Why I don't miss React: a story about using the platform by aliswe on Wednesday May 04, 2022 @02:14AM (#31257273)
you dont escape hatches; you escape THROUGH the hatches
Re:Why I don't miss React: a story about using the platform by quickthrower2 on Thursday May 05, 2022 @12:59AM (#31269658)
So not \h\a\t\c\h\e\s ?