← Feed
@alan@kolektiva.social
Post #2032972
2023-02-07 23:56 UTC
@zachleat This feels a bit ahistorical at some points. The complaints about early performance don't exist in a vacuum. React was eating AngularJS's lunch while Angular 2 was in development hell. React was very much the underdog initially in the CSR space, which was well established. The "VDOM is fast" claim vanished as AngularJS (which used observers, which were slower) became increasingly irrelevant.
In fact, SSR was initially one of React's selling points over the competition until it faded more and more into the background, especially with CRA which has been de facto abandoned by its creators since shortly after its inception - Dan Abramov actually made a poll about where CRA should go from here as it's still the blessed default while being increasingly archaic with the rise of Next, Vite and Remix (he seems to prefer Vite, not Next).
Also, do web components actually have an SSR story yet? A few years ago Google devrels smugly promoted Polymer as "using the platform" with the "best practice" demo's HTML literally containing a single element in the body. Note that actual performance never factored into this, the understanding was that polymer was mostly web standards plus polyfills so it would become fast eventually and was simply morally superior despite being entirely limited to CSR (at least at the time).
It's always fair to criticize React and I'm the last person to complain if people want to shit on Meta but a lot of it just feels like a general criticism of most frameworks in the frontend space at any given time (cf. people in the discourse around this website complaining about tailwind, which seems to be entirely irrelevant beyond philosophical icks), which seems intellectually lazy if not dishonest if the point is to criticize React in particular. The frontend framework demon has been unleashed since at least dojo toolkit and jQueryUI/backbone (which, btw, also had no SSR support) and there's no point in pretending we can just go back to naked HTML+CSS like those mythical alternate early 2000s which never existed in that form ('member XHTML2 and the Semantic Web? They never made it past the concept stage). React didn't start the fire.
Replies (2)
-
@zachleat To be clear, I'm not defending React as an alternative where static site generators are an option. I'm talking about it in the context of shared stateful content, i.e. "apps". In this context there's no question of "React or no React", only "React or what else".
Several prominent voices in the React space have for years now expressed a desire to move on to "the next thing" when it comes around and it's increasingly looking like that time is near with attitudes towards React shifting the same way they did when people abandoned AngularJS (which had been dominant in the same space at its time, though of course the space itself has been consistently increasing in overall size since 1997). Heck, remember Google's "Object.observe" proposal, which failed so badly they had to redesign Angular2 from scratch?
I'm not sure what the point of collecting a thousand ways to say "React bad" is when most of these are presented without the historical context. But if the goal is to get people to abandon React there needs to be a clear direction to move towards. And no, "islands" aren't a panacea unless you just want to ignore apps entirely, aside from them feeling oddly reminiscent of Web2.0 era widgets and could be argued to be the "junk drawer" approach to performance concerns, i.e. simply excluding what you don't want to or can't improve from the relevant metrics.
Open ##2032973
-
@alan @zachleat
#webcomponents have a SSR story, they’ve had a story for years now. SkateJS had a package that could SSR custom elements. Recent developments include the @lit-labs/ssr package that renders WC in Express middleware. You can see it in action on the 4K Blu-ray pages at https://ultrahdzone.com and the final chapter in my book Fullstack Web Components demos how to render vanilla JS custom elements with the lit package.
https://www.newline.co/courses/fullstack-web-components
Open ##2032975