Live data from Hacker News

React is winning by default and slowing innovation

lorenstew.art

531–540 of 866 posts

Re: React is winning by default and slowing innovation

#531

"Slowing innovation across the frontend ecosystem" sounds like a really good idea to me. Frontend innovation is largely vanity churn at this point, and means that any web frontend project left fallow for more than six months is effectively dead, since you need to constantly update for security reasons, and the API and the dependencies are constantly changing, you are doomed to rewrite your application forever. The on…

> the desire to create jobs for life for frontend devs.

Ironically, this might even work for a while, since the API of the week will have a paucity of training data for LLMs, thus making it harder to completely replace this FE developer with an LLM. Otherwise, web development poses a strong temptation to do this since the preponderance of training data comes from this area.

Re: React is winning by default and slowing innovation

#532
post #472

React isn’t just "winning by default" It's winning because at the core it's just JavaScript function composition. A component is a function, conditionals are `if (...) { ... } else { ... }`, loops are `map()`. JSX is just sugar for function calls. In Svelte you are writing XML with little JavaScript islands inside it. Instead of if you get `{#if}{:else}{/if}`. Thats not "ergonomic" – thats a mini-language stapled on…

Sorry, but I'll take Vue's or Svelte's (I prefer Vue's) DSLs over shit like `className` or sticking complex rendering logic in the HTML/template with unreadable `.map`s or God forbid nested ternaries, which is not a rare sight in React codebases. For my brain, seeing a bunch of `v-for`s is a lot clearer as to what's going to ultimately render than seeing a bunch of `map`s is going to render.

Also calling it "just JavaScript" might've been true in the Class component days, but in this frankenstein "functional" component paradigm we're at today it's far from the truth. I mean, it's not even a JS file, it's a JSX file for starters.

At the end of the day the whole JSX vs HTML-DSL thing comes down to a personal preference, and I doubt it's had much to contribute in terms of the success of the various frameworks. I know plenty of people working with React that despise JSX, and I know plenty of people working happily with Vue or Svelte that hate the DSL for templates.

Re: React is winning by default and slowing innovation

#533
Great article! The thing I find most frustrating in the "winning by momentum not merit" place we're in, is that the merits aren't just technical. Frameworks like Svelte are simpler to understand and keep in your head, which I think leads to reduced maintenance and scaling burden because you don't have to think about it the React-way to be able to do so.

Similar to the "Framework Evaluation Checklist" section, we wrote a "Choice Framework" where I work to think through your constraints by putting the users at the center of it:

https://crukorg.github.io/engineering-guidebook/docs/fronten...

Re: React is winning by default and slowing innovation

#534

Earlier quoted context omitted.

I worked on a business app made with lit web components and all properties being stringly typed was a real drag. It didn't compare to a realtime-first component library.

Alas, that’s a common misconception! You’re confusing properties with attributes. Attributes are set through HTML and are stringly typed, but litjs properties can be any js value. For instance, I have a project with a small web component that displays data from a duckdb wasm connection. The connection object is passed as a property and it works flawlessly.

If you’re using it with something like React, passing attributes is easy, but setting properties is much harder, requiring using the escape hatches—I believe you’ll need useRef and useEffect, and a bit of care because it’s frightfully easy to do the wrong thing.

Re: React is winning by default and slowing innovation

#535

Earlier quoted context omitted.

Curious if has anyone had much success using web components within a react UI library? When building a component library on a bespoke design system, I'm quite pleased that I can rely on a headless library like RAC to ensure that the base component implementation is accessible and works well on touch devices. I can see theoretically that web components could be a complimentary tool, but in practice I'm not certain whe…

Did duetds.com

Hey I worked on that! And nordhealth.design. Both were used with React. And Vue, and angular, and classic server rendered apps like django

Re: React is winning by default and slowing innovation

#536
post #477

Earlier quoted context omitted.

In what way React is anywhere near well designed? Look over quick starts of React and Angular, for example. One is a well structured application , the other is a spaghetti script , all held by magic and conventions. If you recall the (in)famous "PHP: a fractal of bad design", React basically ticks every box in this rant and then some. It's not surprise knowing it's origins, but still. The reasons React has got tracti…

After working with both, React is massively more readable and easier to work with.

After working with both, Angular is massively more readable and easier to work with.

Re: React is winning by default and slowing innovation

#537

Earlier quoted context omitted.

I moved my entire business off React and now I don’t have to worry about tinkerers at Meta deciding to reinvent React every 2 years and tricking everyone by keeping the name again and again. Web components are fantastic. They are the real future.

React gets reinvented every year? Are you talking about functional components instead of class components? What big changes am I missing here? It seems pretty static to me.

Maybe they are, I can't speak for them but I've noticed that React hasn't been "reinvited every year" since maybe, 2019 or so, whenever we changed from functional components to class components and then back to functional with hooks. My feeling is that people who have been devving in react post-all-that-nonsense are living in the new world of a much more stable framework that does have new things coming in (Server Components or whatever) that you can just ignore, whereas there's those of us that had to learn this Hot New Framework, and then like a year later relearn how to use this Hot New Framework, and then a year later have to relearn AGAIN this Hot New Framework. It was the last time but for me at least I'm still scarred, and it reminds me of the way people talk about the move from Python 2 to Python 3: I existed well into Python 3 world so I was like, what is everyone complaining about? Upgrade and move on. But there was a time when the whole world was Python 2 and for a period of time half that world was broken. I imagine people get scarred from that kind of thing and carry that experience and distrust through the rest of their career.

Re: React is winning by default and slowing innovation

#538
post #519

Earlier quoted context omitted.

Surely they are not normal JavaScript functions, but at least the syntax itself is not turned into a DSL like we see it in Svelte or Vue. That is the main difference.

Yeah I get it. I don't think the "Just JavaScript" label can be applied to react anymore. It held in a class-based world. But it's not true post hooks. I always hated templating languages > Greenspun's {{rules.length | ordinal}} rule: > Any sufficiently complicated templating language contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of the host language But after working with Vue for…

> Any sufficiently complicated templating language contains an ad-hoc, informally-specified, bug-ridden, slow implementation of half of the host language

Agreed, and Vue does it right exactly because they don't let you do complex things in the template. You can use ternaries in a pinch, but `computed`s exist so there isn't even a reason to do stuff like that. There's like... 10? directives that you can use and they are extremely obvious as to what they're doing, and the handlebar syntax itself is extremely limited and doesn't let you do any crazy stuff with it.

Re: React is winning by default and slowing innovation

#539

Suggestions for future blog articles: "Keyboards and mice are winning by default and slowing innovation" "Web is winning by default and slowing innovation" "Linux servers are winning by default and slowing innovation" They basically write themselves! Don't forget to mention touch screens and track pads in the first one. Have fun, you are welcome.

On keyboards: unironically qwerty probably has slowed innovation. There's no way it is the optimal configuration for typing text. And even less optimal on touch screens. Compare with T9 on old dumb phones - it was new/innovative, and fast, and accurate to such a degree I could type without looking. Shame we lost it tbh

Re: React is winning by default and slowing innovation

#540
post #515

Earlier quoted context omitted.

JSX is just a syntax extension to JS, and it's not even required to create a React app. React "compiler" is in fact a transpiler, which is a very common thing in JS. >React is full of magic syntax that looks like functions Full of magic syntax meaning 5 straightforward hooks? Surely they are not true free-form JavaScript, but at least the syntax itself is not turned into a DSL

> 5 straightforward hooks `useEffect` is straightforward? Cloudflare recently (like, literally 4 days ago)[1] had a pretty big outage because of the improper use of `useEffect` (surprise, surprise, it was the dependency array), a hook so infamous if you search "When should I use `useEffect`" you'll get approximately 9 trillion hits, with nearly all of them telling you something different, including Dan Abramov himsel…

Well, that is really embarrassing for Cloudflare... A recursion in a side-effect via dependencies is a rookie mistake, it's hard to imagine it could slip into production with a proper due process. Maybe they should stop vibe-coding and deploying things to production without any tests or review?
Post reply on HN