Live data from Hacker News

React is winning by default and slowing innovation

lorenstew.art

511–520 of 866 posts

Re: React is winning by default and slowing innovation

#511
post #381

I love this article and the pluralist worldview harking back to 2015/16. I'd love to tell my team "Hey we're going to build this small separate use case in Svelte". But the evaluation checklist, which is pretty accurate, is in direct opposition to the point being made. Assess Performance Needs: 99% of apps are not going to notice the difference, so you choose React Team Skills and Learning Curve: Everyone knows React…

> Ecosystem Fit: React has the more full and stable ecosystem, you choose React

People always say this, but in my experience especially with modern day tooling, all the frameworks basically have the same tooling support. I mean take a look at something like the Tanstack libraries, they have support for literally every single framework out there, even some small obscure ones I've never heard of. I know there exist some big ones like Three.js wrappers and animation libraries, and especially React-specific component libraries, but really what tooling do most people miss that isn't available in Vue or Svelte but is in React exclusively? Even things like Three Fiber (for three.js) has Vue/Svelte equivalents these days.

I've been working with Vue for a long time, and at some big companies with BIG projects too, and I've literally never come across a situation where I saw a React library that didn't exist in Vue.

Hell, I'll even go controversial here and say Vue's ecosystem is better, because of the Vue Core team's decision to create Vue Router, VueX/Pinia and VueUse. These 3 things here - routing, state management and commonly reused helper/util functions - are the bane of my existence in any React codebase I've ever interacted with because there's 11 different state management tools and paradigms you have to choose from, so every single React codebase will be different from the other ones in some subtle and annoying ways. Some codebases even have multiple state management tools! With Vue, you can sort of shoot yourself in the foot if you try really hard to do so, but for the most part the large majority of projects out there stay with the idiomatic way of doing things and you don't even ever have to consider doing anything else, because the defaults just work (TM).

Re: React is winning by default and slowing innovation

#512

Earlier quoted context omitted.

Sure you can make a blog without a framework. But for complex applications it’s far better/easier than raw DOM manipulation or rolling your own thing.

We should probably be making widget toolkits for the Canvas and using WebSockets for communication. DOM manipulation is a total hack-job. It's somewhat flexible, but the performance and dark-pattern cost is just too great. If you're making an interactive application, then treat it like an application and draw widgets to a canvas.

Don't forget about the privacy cost associated with the canvas. If this ever becomes widespread, we will have many many sites extract browser fingerprinting information from the canvas. It would then move the game one more step towards dystopia, where we have to analyze and block certain ways of code interacting with the canvas and it might even prove impossible. And then incapable web devs will offer you no solution but canvas buttons for the login to your bank account. No, I don't think this is the way forward.

Re: React is winning by default and slowing innovation

#513
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…

Hooks are very much not normal functions though. They are a new "colour" of function much like async functions - they can only be called in components or other hooks, they cannot be called conditionally, cannot be called in loops etc. The so-called "rules of hooks"

(To get ahead of the common objection: of course it's still JavaScript by virtue of being implemented in JavaScript. But so are Svelte, Vue et all)

Re: React is winning by default and slowing innovation

#514

Web components are the way out of this trap. Every single framework that isn't React should be wholeheartedly supporting web components to make sure that they have access to a viable ecosystem of components and utilities without having to bootstrap an entire competitor to React and it's ecosystem. While a lot of people view web components as competitors to frameworks, they don't really have to be. The just define an…

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.

If you are consuming web components in any other framework, they will be setting properties, not attributes, by default

Attributes are the default for html

Re: React is winning by default and slowing innovation

#515
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…

So JSX is pure Javascript and not, say, a dialect of XML embedded in JS? Because it sure looks like the former even though it compiles to the latter. React isn't Javascript. It's a franken-language that looks superficially like a mix of JavaScript and XML whilst following the rules of neither. That's why there is such a thing as a React compiler - a good sign that you're not writing JS, which doesn't have compilers.…

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

Re: React is winning by default and slowing innovation

#516

Earlier quoted context omitted.

Not unless you can develop an equivalent to React Native. That's the rub here: browser tech is just way slower than what can be achieved with native code. React's primary value (now) is deduping GUI development across platforms.

Not only that. My main problem with web components that you end up with a build step anyway. Not every component is interactive and relies on JS, some are just static elements (say avatar image) that you wanna render right away (but at the same time keep styles and logic scoped). Declarative shadow DOM helps, but you end up with a bunch of duplicate code in your final output, which begs the question - why am I using…

Do you not end up with duplicate code when rendering `` multiple times?

Re: React is winning by default and slowing innovation

#517

Web components are the way out of this trap. Every single framework that isn't React should be wholeheartedly supporting web components to make sure that they have access to a viable ecosystem of components and utilities without having to bootstrap an entire competitor to React and it's ecosystem. While a lot of people view web components as competitors to frameworks, they don't really have to be. The just define an…

I'm wholly convinced that only people who have never tried to use web components for anything serious, and/or have basically no experience with web dev, are the only ones will make this argument. For example, a guy I know online who is an argumentative, boring backend dev that regularly has really bad and uninformed takes on things he has very limited experience with, he recently said he prefers web components. For a…

I've worked in complex projects with web components. Works fine. Have you?

Re: React is winning by default and slowing innovation

#518
Am I the only person who actually quite likes react?

It was pretty confusing to start with but now I have my head around it it’s just so easy to use.

Every now and then I consider learning a new framework. Svelte looks nice. But then I actually start and don’t get good vibes.

Re: React is winning by default and slowing innovation

#519
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…

Hooks are very much not normal functions though. They are a new "colour" of function much like async functions - they can only be called in components or other hooks, they cannot be called conditionally, cannot be called in loops etc. The so-called "rules of hooks" (To get ahead of the common objection: of course it's still JavaScript by virtue of being implemented in JavaScript. But so are Svelte, Vue et all)

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.

Re: React is winning by default and slowing innovation

#520
post #304

Earlier quoted context omitted.

Which is your favorite, and why? :-)

No OP, but I've also used Angular, React, Vue, Solid and Svelte in real world projects and my default choice is Vue, because it's on par with Solid and Svelte (and with Vue Vapor those three are basically the same) but with the larger ecosystem (vuerouter, vueuse, nuxt, nuxt-ui, primevue, nuxt-content, ...). I must also say that React was by far the most unpleasant and unproductive to use.

[deleted]
Post reply on HN