Live data from Hacker News

If not React, then what?

infrequently.org

281–290 of 756 posts

Re: If not React, then what?

#281
post #108

Earlier quoted context omitted.

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.

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?

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?

#283

Earlier quoted context omitted.

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.

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…

> 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 text;  }

> 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?

#285
post #136

Earlier quoted context omitted.

Not GP. Started using React at work around 2017. The hooks API is just awful. Those complaints are extremely well-trodden ground at this point so I won't rehash. I'm using Lit.js for personal stuff instead these days. Shadow DOM isn't perfect but web components with Lit has been pretty low-surprise so far, which I can't say for Hooks React.

> The hooks API is just awful Hard disagree. Hooks are 100% what is best about React these days and custom hooks make organizing or encapsulating and sharing behaviors between components a total breeze.

This is something that I just don’t get, in the olden days, when you wanted to encapsulate logic and state and share it between instances you would just use a singleton service. But now when classes are “bad” for some reason (when the whole point of a class is encapsulation of state and logic) you get weird stateful functions that makes everything hard to track with complicated API.

Re: If not React, then what?

#286

Earlier quoted context omitted.

I urge you to read Alex's Reckoning series. > performance concerns in the real world are typically measured in, at worst, hundreds of milliseconds. I think outside of the privilege bubble where a significant percentage of the world is in, these concerns are measured in the tens of seconds. > it doesn’t create issues visible to my users What do your users look like? What kind of devices are they on? Is it mostly mobil…

Curious, is this the series https://infrequently.org/2024/08/the-landscape/ ?

Yes, that's the one! Thank you for linking it.

Re: If not React, then what?

#287

Earlier quoted context omitted.

I only responded because they said they're using vanilla React which for some reason in my head instantly translated to "old version of React before it started sucking", and replied accordingly. >But why would OP or I switch away from React when we believe it's mature, stable, fast enough, and has a huge community, resources, and ecosystem? Yeah fair enough.

By vanilla React I meant that I don't use the new Next.js / SSR stuff and instead build a JS file.

what do you use for routing? I built Routerino for just exactly this purpose, to use with vanilla React. maybe it'll be useful for you!

https://www.npmjs.com/package/routerino

Re: If not React, then what?

#288
post #108

Earlier quoted context omitted.

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.

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

Everyone using React is basing their work on Facebook’s challenge!

Re: If not React, then what?

#289
I'm not a web dev at all, but when I need some web UI ClojureScript/Reagent works pretty well. I get all the pretty React components while being able to avoid JavaScript and JSX entirely (all XML-style DSLs that have closing tags I find incredibly verbose and ugly).

Re: If not React, then what?

#290

Earlier quoted context omitted.

React is absolutely performant. A developer who makes a slow React site would make a slow site with something else.

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.

Uh... I'm pretty sure Compass.com is running on Next.js...
Post reply on HN