top | item 45520261

(no title)

icemelt8 | 4 months ago

ReactJS is pretty consistent since last 5 years and probably won't be changing for next 5 years.

discuss

order

byearthithatius|4 months ago

But how many use _just_ React now? There is a whole stack that 90% of YC companies use: Node, pnpm, Next, React, doing SSR by default. Idk about it all. Most of the time when I ask why they do SSR they can't tell me a valid reason. Their bundle sizes are so big for what the apps do.

landl0rd|4 months ago

I've used plain react for a few things in the past few years. I strongly prefer it to next/nuxt/all this other stuff. Preact and an understanding of best practices can make it fairly performant with a more or less drop-in replacement if you're willing to sacrifice compatibility with absolutely all the ecosystem.

I still prefer svelte but it's less mature and universally-known. React is still a pretty good choice if you need something that will more or less work and that anyone can write.

kace91|4 months ago

>Most of the time when I ask why they do SSR they can't tell me a valid reason.

Isn't it mainly about playing nice with crawlers? SEO and the like?

(that was my understanding but I'm a backend dev).

b_e_n_t_o_n|4 months ago

I think most are still using React with maybe React Router. Node and Pnpm aren't really complicated or difficult to use, neither is Vite.

habibur|4 months ago

> when I ask why they do SSR

What are the reasons for not doing SSR?

SeanAnderson|4 months ago

Didn't React 19 introduce a compiler in an attempt to provide auto-memoization? That feels pretty substantial.

byearthithatius|4 months ago

The fact we got to a point of auto-memoization on every reactive function is crazy to me. How is that not prematurely optimizing? I already saw people doing useMemo on shit that shouldn't be getting called repeatedly with the same value. So maybe it is better to let a compiler decide, although I am curious how it knows.

EDIT: if its pure (not reactive to any other variable but other variables may react to it) they will auto memoize I guess to avoid their own reactivity engine doing a bunch of useless shit when no value was actually updated. Correct me here if I am wrong.

torginus|4 months ago

Honestly React has no excuse for being this slow - this style of immediate gui it uses was championed by video games, and Dear IMGUI is still doing well in that space.

I think it's worthwhile to compare the 2 - I'm sure one of the major contributors of React's slowness is the crazy amount of objects it generates triggering GCs - desugared jsx code turns into building up the React DOM with React.createElement

There's no reason why they couldn't have just done what Imgui did and each createElement would be a function call, that doesn't need to allocate. Considering the js API is not something most devs use, most folks wouldnt mind if it got replaced.

State management is also another issue - considering React has had a compiler due to jsx since the outset, not using that since the beginning to do a little data flow analysis and figure out which piece of state affects what UI elements is just criminal - an further exacerbates the waste in other parts of framework, by running already wasteful code more often than it needs to.

Tbf, they already fixed the compiler issue with the latest React, but only as a reaction to getting destroyed by Svelte on the performance front.

Just goes to show, that if you don't have competition, there's no guarantee positive change will happen on any time scale no matter the resources you throw at the problem.

freeopinion|4 months ago

Are you ignoring signals? Signals are a pretty huge evolution.

victorbjorklund|4 months ago

Nobody uses plain reactjs anymore.

nophunphil|4 months ago

Sure they do. I’ve used it multiple times for new (but small) projects in the last year. It’s straightforward with Vite and works fine.

I’ve also used Next for new projects in the last year - it just depends on the infra requirements.

Vercel’s position in the ecosystem is one we should question. Maybe it’s not good for innovation to use Next for every new project. The recent controversy with their CEO isn’t helping the situation either.

christophilus|4 months ago

What do you mean? I use Preact, but I use “plain Preact”.

lopatin|4 months ago

Yes they do they just don't blog about it.