News for hackers. Stuff that matters.
Re:If Not React, Then What? by dimgl on Friday November 29, 2024 @11:47PM (#42279525)
> Frameworkism isn't delivering.

It isn't? I find React to be great to work with.

Re:If Not React, Then What? by xcrunner529 on Friday November 29, 2024 @11:59PM (#42279589)
Yes, you the developer. I think that’s his point. The performance if react sites is another thing and that’s what the user cares about. It also doesn’t work on mobile. React native was worshipped and now is thrown out.
Re:If Not React, Then What? by alex_smart on Saturday November 30, 2024 @12:10AM (#42279648)
Is it even working for the developer though? Last I checked the server-side rendering performance for react based frameworks was somewhere like 200 pages per second? Is that something to be proud of as a developer?
Re:If Not React, Then What? by robertoandred on Saturday November 30, 2024 @12:11AM (#42279654)
React is absolutely performant. A developer who makes a slow React site would make a slow site with something else.
Re:If Not React, Then What? by xcrunner529 on Saturday November 30, 2024 @12:13AM (#42279673)
Tell that to all the former PHP developers. Where are these performant React sites? The largest and best tech companies out there certainly can’t do it.
Re:If Not React, Then What? by robertoandred on Saturday November 30, 2024 @12:15AM (#42279680)
The same former PHP developers responsible for all those slow WordPress sites?
Re:If Not React, Then What? by xcrunner529 on Saturday November 30, 2024 @12:55AM (#42279861)
The ones who made react.
Re:If Not React, Then What? by TiredOfLife on Saturday November 30, 2024 @02:34AM (#42280166)
Re:If Not React, Then What? by dimgl on Saturday November 30, 2024 @05:32PM (#42284525)
Uh... I'm pretty sure Compass.com is running on Next.js...
Re:If Not React, Then What? by cosmotic on Saturday November 30, 2024 @12:30AM (#42279756)
They're a wide chasm between what one can make and what is led to making. React can lead to fast, responsive websites, though you'd be fighting against a current pulling you out to a bloated, buggy mess. There's a unique stench that comes from many react sites where everything is a skeleton screen, everything loads slowly, history rewriting is busted, there's no hotlinking, and scrolling is glitchy. Peek under the hood, it's almost always react. Facebook.com quality is the outlier, not the likely outcome.
Re:If Not React, Then What? by crvst on Saturday November 30, 2024 @04:01AM (#42280481)
React is far from performant for SSR, and it simply can’t be, as it wasn’t designed with backend needs in mind. The fact that it works at all is more of a happy accident or side effect. Current approaches are more like workarounds than proper solutions for making it function effectively on servers.

Most importantly, it’s also not particularly performant on the client side in real-world scenarios.

For evidence, here’s a guy testing major websites using his awesome react-scan tool: https://x.com/aidenybai/status/1861442057598062653

Re:If Not React, Then What? by pier25 on Saturday November 30, 2024 @10:20AM (#42282058)
If React is so great how come Amazon isn't using it in their store?

I think last year an Amazon frontend engineer wrote some tweets explaining they tried React and it was too slow. So they keep using Java for SSR and sprinkle vanilla JS. They were still using jQuery until a couple of years ago and probably still are in some parts of their site.

Re:If Not React, Then What? by goodoldneon on Saturday November 30, 2024 @11:15AM (#42282309)
Do not base your company’s tech decisions on FAANG companies unless your company is a FAANG company. Your challenges are likely very different from theirs
Re:If Not React, Then What? by pier25 on Saturday November 30, 2024 @02:19PM (#42283417)
You're missing the point of my comment.

Someone is contesting that "frameworkism isn't delivering" when we have objective data to prove that it is in fact not delivering.

The Amazon store is just a good example because there's a lot of data about it, not because it's FAANG.

Re:If Not React, Then What? by t-writescode on Saturday November 30, 2024 @02:44PM (#42283561)
What I read from what you said is “Chevy trucks are good? Oh yeah, if trucks are good, why does the post office use non-Chevy, non-truck, fleet cars?”

Please help me understand where I misunderstand

Re:If Not React, Then What? by pier25 on Sunday December 01, 2024 @10:52AM (#42289004)
"Trucks are bad for X"

"No, trucks are good for X"

"Look at this use case (Amazon) with tons of objective data that shows that trucks are bad for X"

Re:If Not React, Then What? by t-writescode on Sunday December 01, 2024 @06:37PM (#42291607)
"Look at this use case (Amazon) with tons of objective data that shows that trucks [do not fit Amazon's use case for X]"
Re:If Not React, Then What? by pier25 on Monday December 02, 2024 @03:10PM (#42299887)
It seems that you're arguing that the performance requirements of Amazon are different from other sites (in e-commerce or not). Is this it?

Are you arguing that web devs should ignore CWV for e-commerce sites?

Re:If Not React, Then What? by root_axis on Saturday November 30, 2024 @03:32PM (#42283839)
You just picked Amazon arbitrarily because it supports your argument, but there are many more counter examples where react is used, so what's your point?
Re:If Not React, Then What? by xcrunner529 on Saturday November 30, 2024 @07:34PM (#42285160)
And who where it’s faster and more performant? Not Pinterest. Not Airbnb. Not X. Not the Amazon competitors he showed. Not even the flipping creators (Facebook) of the framework. You all keep blaming the specific companies for their sites but can’t ever seem to show us an actual performant and good example of react usage.
Re:If Not React, Then What? by pier25 on Sunday December 01, 2024 @10:51AM (#42288998)
I used Amazon because there's a significant amount of data to indicate React is a bad fit for e-commerce (as the OP article points out).
Re:If Not React, Then What? by youngtaff on Saturday November 30, 2024 @05:30PM (#42284518)
Everyone using React is basing their work on Facebook’s challenge!
Re:If Not React, Then What? by scotty79 on Saturday November 30, 2024 @02:38PM (#42283528)
Because Amazon Store is and aleays was an armpit of webdesign? It's the worst designed e-commerce site and decades of tinkering only brought it half way towards basic level of decency that was obvious to a beginner web developer making their own first e-commerce site from scratch in PHP 20 years ago?
Re:If Not React, Then What? by FridgeSeal on Saturday November 30, 2024 @05:27PM (#42284490)
You’re blurring architecture with UI.

The Amazon site is pretty ugly, yes, but it’s functional and fast.

Re:If Not React, Then What? by goobert on Saturday November 30, 2024 @02:55PM (#42283624)
React is in use in many heavily used frontends at Amazon, maybe not the retail site

But there's no inherent reason React couldn't be used for a page that basically shows pictures of products with a description next to them, the bottlenecks will have nothing to do with the frontend in a well engineered system for that type of site

Re:If Not React, Then What? by cyberax on Saturday November 30, 2024 @03:17PM (#42283759)
My constant problem with React-based tools is that they don't support deep links properly. You want to right-click on a product description to open it in a different tab to check later, and you can't.

Even freaking Google (who really should know better) suffers from that. Amazon's retail frontend uses plain HTML, so it works fine.

Re:If Not React, Then What? by root_axis on Saturday November 30, 2024 @03:36PM (#42283863)
I'm not sure how much experience you have with react, but it doesn't need to "support" links, they function exactly the same as with vanilla js, there's nothing about react that prevents their use. Using JavaScript for links is entirely a developer decision.
Re:If Not React, Then What? by cyberax on Saturday November 30, 2024 @03:50PM (#42283954)
I'm familiar with React. And no, links in React often don't work without extra attention.

It's way too easy to put some state information into the context and then have your pages depend on it. For example, you have a page with a filter that is implemented via a simple state, and then a list of widgets that pass the filter. The widgets have a click handler that opens the widget details.

Now you right click on it. If you're lucky, it opens the widget details in a separate tab. However, the filter information is lost.

Re:If Not React, Then What? by troupo on Saturday November 30, 2024 @05:28PM (#42284504)
> I'm familiar with React. And no, links in React often don't work without extra attention.

^ These two statements are at odds with each other.

React will return a pure browser link that behaves exactly as a browser link:

   function Comp() { return <a href="some-link">text</a>;  }

> The widgets have a click handler that opens the widget details. > > Now you right click on it. If you're lucky, it opens the widget details in a separate tab. However, the filter information is lost.

So, the problem isn't React. The problem is people overriding default browser behaviour for their widgets. It was a problem before React, and it will be a problem long after React.

For example, here's Google's premier site about web technologies: https://web.dev/articles Check out the pagination links at the bottom. There's no React on the page

Re:If Not React, Then What? by cyberax on Saturday November 30, 2024 @06:46PM (#42284926)
> React will return a pure browser link that behaves exactly as a browser link

No it doesn't (in practice). React is typically used with something like React Router that takes over the whole sub-tree of paths. So links are handled by the single-page app itself, and this can lead to the state leaking through.

Yes, you don't _have_ to do it this way.

Re:If Not React, Then What? by troupo on Sunday December 01, 2024 @04:03AM (#42287208)
> No it doesn't (in practice).

Yes , yes it does, in practice.

> React is typically used with something like React Router that takes over the whole sub-tree of paths. So links are handled by the single-page app itself,

"Taken over by Router", "handled by SPA itself" .... "React is to blame"

> Yes, you don't _have_ to do it this way.

Yes, you don't have to it this way, and this isn't React-specific. See Google's web.dev site built with web components

Re:If Not React, Then What? by root_axis on Sunday December 01, 2024 @01:56AM (#42286753)
> And no, links in React often don't work without extra attention

Links work fine, out of the box, react treats them the same way vanilla js does. JavaScript onClick events aren't links, and that's true whether you're using react or vanilla js.

> It's way too easy to put some state information into the context and then have your pages depend on it.

What do you mean it's too easy? If someone makes poor engineering choices because that's the "easy" thing to do, that's their fault, the tool didn't make them do that.

> Now you right click on it. If you're lucky, it opens the widget details in a separate tab. However, the filter information is lost.

This is true of JavaScript in general, it has nothing to do with react. In order for links to work, the server has to render pages that correspond to the link, whether that means encoding state in the url or pulling it from a session, this is required whether you're using react or literally anything else.

Re:If Not React, Then What? by FridgeSeal on Saturday November 30, 2024 @05:26PM (#42284483)
Sure is odd that a good number of react-and-friends websites can’t manage to support it all then.

Just like how routing and history is “solved” but I encounter websites every other day that completely break my browser history.

Re:If Not React, Then What? by root_axis on Sunday December 01, 2024 @01:38AM (#42286690)
> Sure is odd that a good number of react-and-friends websites can’t manage to support it all then.

I don't think that's true. More likely, you use react websites all the time and don't even think about it because the links work as you expect.

Re:If Not React, Then What? by cheema33 on Monday December 02, 2024 @03:58AM (#42294389)
> My constant problem with React-based tools is that they don't support deep links properly.

I worry that most people complaining here about React, including the OP, do not actually understand the very basics of React. Here someone is complaining about how React somehow messes with deep links. Without understanding that React does nothing to links. Nothing.

Re:If Not React, Then What? by pier25 on Sunday December 01, 2024 @10:53AM (#42289017)
> maybe not the retail site

I'm discussing the retail site specifically because that's where CWV matter.

If a company has internal tools that take seconds to load it doesn't really matter. Captive users don't have much of a choice.

Re:If Not React, Then What? by goobert on Monday December 02, 2024 @07:43PM (#42301956)
It's in use in customer facing apps, Prime Video is built with React
Re:If Not React, Then What? by ec109685 on Sunday December 01, 2024 @12:39AM (#42286465)
Most of their app is a mismatch of web views and native with spinners galore. It doesn’t seem like performance is a high priority for them anymore.

E-commerce is fundamentally small data once the user lands on a product page, so every subsequent link and click should be instant.