4 ms·
Mithril.js has been doing plain javascript variables for years :) Basically, React's decision to use setState is an overoptimization. Mithril (and flutter, inte
by simplify 7y ago
Mithril.js has been doing plain javascript variables for years :) Basically, React's decision to use setState is an overoptimization. Mithril (and flutter, interestingly) opts for global redraws, greatly reduces end-user code complexity while still being fast for most all cases.
- thunderbong 7y agoTotally agree. Multiple frameworks have done this for many years, but nobody will listen as everyone is interested in the next new, shiny thing. I do like Svelte in its latest incarnation though, especially when it integrates with Sapper.
- aboodman 7y agoFlutter does its own painting. It's different, and closer to a game engine than what React is doing. That results in different tradeoffs.
- olah_1 7y agoThanks for mentioning Mithril. When I saw Svelte example output js, I thought it was actually a better developer experience layered on top of Mithril. (Mainly because of the similar m() mounting function) ``` function create_fragment(ctx) { var h1, t0, t1, t2; return { c() { h1 = element("h1"); t0 = text("Hello "); t1 = text(name); t2 = text("!"); }, m(target, anchor) { insert(target, h1, anchor); append(h1, t0); append(h1, t1); append(h1, t2); }, p: noop, i: noop, o: noop, d(detaching) { if (detaching) { detach(h1); } } }; } ```