Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Its kind of amazing how big a single library (that does very little really) has become.

React is obviously the "new jquery", and something else will come one day. So many specially boot-camp devs are "react only" devs.

Scary stuff.



It's not scary. It's a pretty small API surface. Lots of time is spent on component styling and all that stuff, which isn't React-specific.

Web components tech such as Lit might be part of the future, replacing JSX, and then React purely becomes a middleware tool for DOM diffing and shuffling events up and data down.


Would you still say it's a small API surface? State, memos, callbacks (which are just memo functions), effects, effect events, reducers, context, external stores, special handling for any tags that go in the `<head>`, form actions, form status, action state, activities, refs, imperative handles, transitions, optimistic updates, deferred updates, suspense, server components, compiler, SSR?

Or maybe it's a small enough API but a lot of concepts. Or maybe I'm just grumpy that the days of "it's just a view layer" feel long ago.


> Or maybe I'm just grumpy that the days of "it's just a view layer" feel long ago.

That abstraction was always leaky, in that it begged many more questions that had to be answered.

Part of the appleal was that it was limited in the perimeter, and part of the curent situation is that the community around React-the-library created the tools to answer these other questions, which means that React-the-ecosystem is much more complex than React-the-lib.


Your list has convinced me that my understanding of React is out of date!


IMO OP is correct that the bootcamp devs are scary, not React itself.

I’ve interviewed a number of engineers who have very little grasp of what the DOM is and how it works because React abstracts the whole thing away. Server components are another are where some niceties mean a bunch of developers aren’t really understanding what’s going on with underlying HTTP requests.

While React’s API surface is small the average app will come with a chunk of extra stuff: Redux, next.js, yadda yadda. People take entire courses that never leave that bubble.


> React is obviously the "new jquery", and something else will come one day.

"Something else" is already here and has been for a long time. Vue and Svelte are both excellent alternatives.


They are not. Extending JavaScript with an XML-like syntax that transpiles down to composable function calls feels far more natural. In contrast, extending HTML with a template syntax feels limiting and less intuitive in practice — thats why these frameworks are unlikely to ever reach the same level of traction as React.


Hard disagree. React is only popular because large companies made it so. There are few things that React is inherently better than Vue and none of them are its bundle footprint, page load speeds, nor the average time to learn one or the other.

Subjectively I am extremely in opposition to the fact that XML anything with composable functions is more intuitive than HTML templates by any stretch of the imagination.


I get your point, but to me it is about composition, not popularity. Writing UI as pure functions of state feels far more natural — recursion, higher-order patterns, dynamic layouts, all come easily because React is just JavaScript. In Vue or Svelte, recursion and logic feel bolted onto an HTML templating layer, which makes complex patterns less fluid.


> Writing UI as pure functions of state feels far more natural

That makes sense, but that's not what react does. Components are functions of their "prop"s. The rest of the state comes from a memoized cache in a fiber. Which fiber? That's determined from a reconciliation algorithm. Does it do the right thing? Usually.

You can tell if it's "a function of state" by whether the state is in the parameter list.


> React is only popular because large companies

Hard disagree. React became popular because it was much better than its predecessors like Backbone, and also better than its contemporaries like the first Angular. I was still learning JavaScript, when I was doing a browser app for my thesis, and I used Backbone as a framework. Awful experience, using React was much more intuitive. While Backbone was imperative, React was declarative, with composable components, no custom HTML template syntax. Using React made web development fun for me.

> extremely in opposition to the fact that XML anything with composable functions is more intuitive than HTML templates

And I hate HTML templates. I think there are just two groups with different preferences and therefore it's somewhat useless to argue about this stuff.


None of this refutes that fact that it was created and pushed by Meta nor explains why it remains popular when there are "better" alternatives by nearly any objective measurement. HTML template frameworks have gotten significantly better since your thesis over ten years ago, Vue.js being the primary one that quickly followed React less than a year after it came out. I also used backbone and knockout.js professionally and, while I agree I definitely prefer React over those, it doesn't explain why React remains popular.

I like to argue about it because I like knowing why people think the way they do about React. I'm a long-time React hater and still look for ways to change my mind, so there's a point for me I guess?


What feels more "natural" is likely to be influenced by what you already know. I've always felt that JSX felt unnatural and Vue's and Svelte's way of doing it feels more natural.


fair — what feels natural usually depends on what you are used to. But even aside from preference, JSX aligns directly with how JavaScript itself works. You are not learning a new templating DSL — you just compose functions. That conceptual unity is what makes React approach click for for so many.


> JSX aligns directly with how JavaScript itself works...

Why javascript, though? That preference, again, seems based on what you’re used to.

The actual goal is to manipulate the DOM based on state changes using a declarative representation.

Javascript seems more like something that was available rather than a good fit. (In fact, they felt like it was a bad enough fit that JSX had to be added to the mix.)

Setting aside any particular framework, HTML seems like a better fit to me… it’s inherently declarative and, of course, has a well understood, well supported relationship with the DOM. Extensions to bind state can be pretty well contained.


It feels much more natural to me to extend HTML for rendering HTML than to add an xml like syntax in my JavaScript.

Why would I choose to write html in js over writing it in html?


I come from mobile, and was surprised how nice svelte is. Felt so much more familiar patterns than react


I think the point is not that there aren't alternatives—there were plenty of jQuery alternatives—but that React is the dominant force, and this too shall pass.


React won’t topple for a while, because of none of the alternatives are different enough. React solved a real problem many developers faced by giving them a state management system with a rendering engine, whereas you were likely to make surgical cuts before in response to state change, you can now just write your ui assuming the whole thing rerenders in response to changes to that state. The component system also allowed for an easy way of sharing code as dependencies. Vue, Svelte, Solid and the rest have their individual pros and cons when compared to react, but they are essentially different attempts to do the same thing.

You want to topple react, you need to solve a problem that’s as big as state management used to be in a way that react can’t also just copy/absorb, and you have to do it so well that developers will push to use it at work. You need to have a ux as clean as what React offers to its devs, and you probably need to come close enough in benchmarks to not get instantly shot down.


The alternative that eventually beat out jQuery was just better native javascript, though.


> Scary stuff.

Why? When jQuery went away nothing happened. People just learned the new frameworks.


I don't think jQuery went away.

And it might never unless browsers implement better DOM apis.

The current DOM API implementation reminds me of that quote:

"look what they need to mimic a fraction of our power"


while jquery had a gajillion of exotic apis to do pretty much everything, react is, frankly, pure js with handful of apis: jsx (html with pure js), useState/useEffect/useMemo (rarely you need more), and initial hydration function. Rest is utility libraries, bundler, and all the wondeful things that brings you endless headache and depression because without them fulfilling yet another business req would take 10x more time




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: