Elm vs Vue/React which one do you prefer to use with Phoenix, and why?

memory consumption

Crockford Classless is gorgeous, but there is one tradeoff: Performance [memory consumption]. Every object will be slightly more expensive than it’s prototypal equivalent. However, remember that premature optimization is the root of all evil.

Don’t pessimise prematurely

Similarly lots of JavaScript code creates anonymous functions unnecessarily. If the function doesn’t need access to anything inside the closure then a simple function definition inside the module scope will suffice. This has become even more prevalent with the introduction arrow functions (because they “look nicer” than fat functions).

Given that web components inherit from HTMLElement there is no getting away from needing to know the ins-and-outs of this in JavaScript or TypeScript. If you are going to interact with a browser API you need to deal with this sooner or later - pretending it doesn’t exist even the Crockford way will only get you so far.

Fat functions also have the benefit of being hoisted to the top - i.e. source order isn’t relevant. With arrow functions source order is relevant.