Remix.run Logo
QuadmasterXLII 4 hours ago

i’ve tried this, and it almost almost works to just rebuild the Dom on every state change as a pure function of state without any react or anything. The resulting interface is actually way snappier than react – but preserving local state of elements like what text is highlighted, where the cursor is, which radio button is tabbed to etc turns into a nightmare.

gf000 2 hours ago | parent | next [-]

With all due respect, I don't believe it is "more snappier than react".

React itself with nothing else is plenty fast. You would have to go way out of your way to see performance differences between different UI approaches, computers are just way too fast to notice whether this click resulting in the div's text changing to +1 is slow or fast, even if the implementation were crazy convoluted.

What makes react apps slow is using it badly, and having 10 other libraries getting in the picture loading fat UI elements, etc.

And frankly these would be much slower in your render everything anew approach.

QuadmasterXLII 44 minutes ago | parent [-]

This is where "react is a library, not a framework" kinda lets it have its cake and eat it too. preact is 4 kb, React + react dom is like 30 kb, but when I use it under commercial pressure to deliver it seems to climb into the megabytes. I'm working on a react native app right now that is a completely embarrassing 150 Mb. The experiment in no react, build UI from scratch every state change has stayed around 65 kb without much attention paid to bundle size, with 10 kB of that being a bunch of linear algebra and differential equation solving code and 50 kb of that a plotting library that's completely nonblocking for the rest of the app.

shimman 3 hours ago | parent | prev [-]

Based on your description it sounds like you were halfway into reimplementing the virtual dom that react uses (or use to use? unsure if they moved away from that with the implementation of a compiler).

QuadmasterXLII 2 hours ago | parent [-]

Yep. The “I’m sick and tired of of X (re-implements X)” cycle haunts me- I think I’m the wrong mix of picky, whiny and industrious