Live data from Hacker News

Does anybody like React?

jsx.lol

111–120 of 353 posts

Re: Does anybody like React?

#111

Earlier quoted context omitted.

But why over vue? My biggest frustration has been how vue ends up moving in the direction of react. The original component architecture with the html template, JavaScript state and css styles in vue was so nice. Even the data fetching a url in the component was so intuitive.

I'm using Vue and do not feel it's becoming react

This sentiment only really applies if you’re coming from Vue 1/2 to Vue 3. The Composition API is definitely more like React but makes some better design decisions that make it easier to work with than React. Such as implicit reactivity.

Re: Does anybody like React?

#112
post #38

As someone who lived through all major waves of JS for the last ~16 years, I do love react, in a sense: React is the worst JS framework except for all the others we've tried. I'd take React over the Angular 1 days any time. I'd take Angular 1's full-bodied MVC over the "build it yourself from scratch every time" approach of Backbone. I'd take Backbone's minimal MVC structure over the classic JQuery Soup architecture.…

Wait, react is a framework now? People used to say that react is just a model binding library. FYI I haven't used react.

Depends on the definition.

jQuery isn’t a “framework” either, at least not like Angular or Vue, though it can be extended with “plugins.”

Both jQuery and React are foundational technologies, so comparison is valid.

Re: Does anybody like React?

#113

As someone who lived through all major waves of JS for the last ~16 years, I do love react, in a sense: React is the worst JS framework except for all the others we've tried. I'd take React over the Angular 1 days any time. I'd take Angular 1's full-bodied MVC over the "build it yourself from scratch every time" approach of Backbone. I'd take Backbone's minimal MVC structure over the classic JQuery Soup architecture.…

> React is the worst JS framework except for all the others we've tried. > React has its tradeoffs, but we got here after a long slog of other things that don't work. I strongly believe it's because of trying to achieve the wrong goal with the wrong tool. So many websites could just be bare html pages and forms with just a sprinkle of JS for some interactivity, but they want to add JS for whatever reason. If you can…

There are four culprits here and neither is due to JS.

First is the pursuit of polish. Each extra 1% in polish adds tons and tons of lines of code. If you want that level of polish on a non-SPA, you'll still have to add all that code then reload it one page at a time. I see a lot of these "bare HTML pages" and they are lacking important stuff like i18n/a11y/WCAG compliance. Try adding all that back in and you'll see your website bloat right up.

Second is bloated do-everything libraries. Ant, MUI, Mantine, or whatever else is aimed to be a superset of all possible website needs which means that the components you adopt have tons of features and bloat you don't need that slow down loading, parsing, and execution. Simply replacing that component with a and a few lines of CSS will get you the same thing you want, but will save you layers of unnecessary React components and sometimes a layer or two of unneeded DOM nodes as well that were added because the component had weird interactions with some other component.

Third is manpower/experience. Many/most JS devs today (sad to say) don't actually know how to make that simple component on their own. Those that do often skip it because they've got too much to do already. I've lost count of the number of teams I've seen where a bog-standard backend has 25 people working on stuff while the frontend team has 3x as many total lines of code (which are often times handling human-computer interaction issues the backend couldn't even imagin), but only 3-4 people to maintain it all.

Fourth is of course management. Designs on the backend change at a trickle while changes to the frontend arrive in a torrent. Understaffed frontend teams can't keep up with all the things shoved on their plate, so they usually can't optimize things even if they know how (eg, only a small percentage of SPA actually know/take the time to lazy load various parts of their apps to improve load time).

Fix these things and the SPA performance will improve drastically and almost certainly exceed BE templates with some jQuery spaghetti.

Re: Does anybody like React?

#115
post #30

Earlier quoted context omitted.

I was a big Sevelte fan. After writing a sizeable application in Sevelte I realized that React is superior in every way overall speaking and at least you're writing 100% pure JavaScript directly. Or Typescript. Plus the ecosystem. It's huge. Nothing comes closer.

> 100% pure JavaScript directly How did the React community convince so many people of this falsehood? Do that many people just not know what javascript is? It baffles me that one could look at JSX and be like, “that right there is vanilla javascript”.

JSX is basically just a subset of E4X.

Re: Does anybody like React?

#116
post #30

Earlier quoted context omitted.

I was a big Sevelte fan. After writing a sizeable application in Sevelte I realized that React is superior in every way overall speaking and at least you're writing 100% pure JavaScript directly. Or Typescript. Plus the ecosystem. It's huge. Nothing comes closer.

> 100% pure JavaScript directly How did the React community convince so many people of this falsehood? Do that many people just not know what javascript is? It baffles me that one could look at JSX and be like, “that right there is vanilla javascript”.

Yeah man it’s pure JS trust me just add this little transpiler and you’re good to go. What do you mean you don’t have a bundler?

Re: Does anybody like React?

#117
post #8

I like React. And I have seriously tried the HTMX/Hotwire camp. I wanted to make a back button use browser APIs to go back if the coming from the inbox, just link to the inbox otherwise to preserve scrolling. I had to wire the actions from the html to call the function that goes back, then in my controller determine the previous page and send the JS enabled back button or the hard link. My logic was spread out over 3…

I know there will probably be some complications here and there, but this could be done with Web Components too, right?

Came to ask this myself. Oddly enough, I think they’ve kind of slipped under everyone’s radar.

Re: Does anybody like React?

#118

Yes! It is hands-down, the most intuitive interface, that has successfully married declarative and imperative styles together. IMO, nothing comes close to JSX across the length and breadth of UI frameworks across all languages.

If it is so intuitive, why then does basically every React app contain performance bugs?

Re: Does anybody like React?

#120
post #113

Earlier quoted context omitted.

> React is the worst JS framework except for all the others we've tried. > React has its tradeoffs, but we got here after a long slog of other things that don't work. I strongly believe it's because of trying to achieve the wrong goal with the wrong tool. So many websites could just be bare html pages and forms with just a sprinkle of JS for some interactivity, but they want to add JS for whatever reason. If you can…

There are four culprits here and neither is due to JS. First is the pursuit of polish. Each extra 1% in polish adds tons and tons of lines of code. If you want that level of polish on a non-SPA, you'll still have to add all that code then reload it one page at a time. I see a lot of these "bare HTML pages" and they are lacking important stuff like i18n/a11y/WCAG compliance. Try adding all that back in and you'll see…

>I see a lot of these "bare HTML pages" and they are lacking important stuff like i18n/a11y/WCAG compliance. Try adding all that back in and you'll see your website bloat right up.

having lots of JavaScript tends to make more WCAG problems, because you do interactive stuff that needs to be described. Having bare HTML and the accessibility that is required for that is not tending to bloat in my experience.

Post reply on HN