by nine_k · 3y ago · 0 comments
Did something arrive to plain JS APIs to allow this in a simple enough way?
It was the ability to do efficient updates based on large VDOM diffs. The speed of updates is the same between a React VDOM-diff update plan and a direct update of the same size based on e.g. observers.
While React proper may be too large, I find the approach indispensable for more complex interfaces. One can pick Preact instead.
But it's indeed overkill for adding small bits of interactivity to large, mostly static documents.
They only do that if you build a dependency graph instead of a dependency tree and iff the observing framework allows that, and without any loop resolution method. The common technique for graphs under dumb observing is to create a single update routine and pass the name of an emitter to it. I’ve built literally hundreds of interfaces using this (most of them what they’d call “more complex”) and never met any issues React kids are taught to be scared of. UI dataflow was never even a serious concern to be worth a name.
The whole premise of React compares it to a “generic detergent” which doesn’t really exist.
I'm not an expert in frontend development, but all solutions I've seen either used a variant of virtual DOM, or two-way bindings (the latter a non-starter for me). What did I miss?