Osmose

I make websites and chiptunes!

  • he/him

AKAs:
Lapsed Neurotypical
JavaScript's Strongest Warrior
Fake Podcast Host
Thotleader
Vertically Integrated Boyfriend
Your Fave's Mutual
Certified 5x Severals by the RIAA
Inconsistently Medicated
The Source That Views Back
Carnally Known
The Alternative


Homepage
osmose.ceo/

I forget if I vented about this before but again I'd like to make sure it is absolutely clear that React isn't, wasn't, and never was a library that claimed to or intended to make webpages faster.

Every performance improvement in React is meant to make it fast enough to be competitive vs non-React webpages. It is making up for its inherent slowness.

React is a one-way data binding library. It removes the need to worry about the DOM as a source of state in your app. It gets rid of you having to worry "Does the <ul id="todos"> DOM element contain the same todo items stored in my const todos = [] list? Has something changed the DOM and made them out-of-sync?" because now the DOM is always derived from your app state.

React will always be slower than having no framework and managing that yourself. React is a library meant to make developers' lives easier, not users'.

Go watch the original announcement at JSConfUS 2013. They spend most of the time talking about one-way data binding and only bring up the virtual DOM and reconciliation at the end as a way to explain how this obviously-slower technique of regenerating the DOM all the time can be fast enough to be usable.


You must log in to comment.

in reply to @Osmose's post:

Yeah but at the same time I feel like a lot of folks conflate “using React alone” and “using React and Redux and <12 other librairies>” because the latter is an easy pitfall to fall into and end up with something that runs like shit. IME “vanilla” React is fine unless you’re doing something stupid with it.

meant with absolute respect to everyone who has worked on one, but i have never seen a react state management library that wasn't an endless set of horrors that confused me to its utility

I am a fan of state management libraries in the context of gigantic apps and large teams (because their benefits are everyone understanding a shared API more than their actual runtime characteristics),

but Zustand is also a decent candidate for being obviously useful beyond useState. It lets you say "give me some data X, and I will return a hook that lets you access X in any component and will trigger a rerender when X changes".

Zustand's specific API doesn't really matter so much as it being the minimum viable global state hook.

that seems to be a formalized version of the independently created small wrappers for state management I've seen that looks usable, thanks for the heads up on it! I'll check it out next time I need one

it's funny because I am generally a fan of ORMs for similar reasons to what you just said

yeah fair, i guess at this point im so used to writing TypeScript that adding a bit more to do JSX doesn't bother me especially when stuff like Vite is sooooo much easier than making that stuff work with Webpack like we had to (create-react-app was neat but i never liked not knowing what happens so i never used it for anything)

Agreed, Vite is my standard, the main times I don't use it is when I'm writing stuff on, say, Glitch, where there's no easy way to have a preprocessor and a backend server at the same time.