Live data from Hacker News

Is React Having an Angular.js Moment?

marmelab.com

91–97 of 97 posts

Re: Is React Having an Angular.js Moment?

#91

Earlier quoted context omitted.

Fwiw I've been using react on the frontend and php on the backend for like 8 years now. It's a multi page app. It's fast. No issues. If you want to swap php for go it'd be just as easy.

Interesting. How do "break down" react to be multipage. With next atleast the folder based layout (and the [id] naming convention) I found helpful. Disclaimer I'm still a react noob.

In webpack, if you use a simple dynamic `import()`, it will compile all the files that it might possibly match. Then in PHP I just pass down the name of the script I want to load plus a bit of server-side data and render it. You can fiddle with the webpack settings about how aggressively it will code split or re-use libs. I recommend throwing all the vendor/3rd party party stuff/rarely changing libs into a single package and set a long TTL. Then the first time a user visits it can download all that junk and from then on they only have to re-download the bits that you change. For me, I might change a few pages a week. For my day job, we deploy once a day, M-Th, so even then if a user visits 100 pages in a day, they only pay for the JS on the first click of the day, and only the parts that have changed for the most part.

Re: Is React Having an Angular.js Moment?

#94
post #8

Earlier quoted context omitted.

This is a heavily outdated opinion. The "default" react experience nowadays is Next.js and that is definitely a framework not a library.

React is a component library. Angular.js is a framework. Next.js is also a framework. Comparing apples to apples, then you should compare Angular.js to Next.js, and not React.

React is a component library.

Next.js is a framework.

Angular is both a component library AND a framework.

Re: Is React Having an Angular.js Moment?

#95
post #12

I tend to agree with the article. I've felt pretty frustrated with the direction of react in the last few years. Most of the companies I've worked for that used react did so because they wanted a SPA, in most cases making a conscious decision to move away from older SSR technologies towards the SPA. It's doubly frustrating because we primarily use C# and Asp.Net Core for back end work. A react SPA is trivial to use w…

What's wrong with a JS back end? Node/Express is awesome.

Express was awesome. Now it's fastify or GTFO.

Seriously, express in 2023 smh.

Re: Is React Having an Angular.js Moment?

#96

Earlier quoted context omitted.

If you think that way, you are not objectively weighing the benefits of server side rendering. It _is_ useful and shouldn't be tossed away for the benefits of a 6MB javascript blob.

You can do better than a 6MB blob. You can code split and cache. It's not that bad. Especially if it's an app, not an SEO site.

A 6MB blob is identical to 2MB, 1MB and 3MB blobs.

Re: Is React Having an Angular.js Moment?

#97

Earlier quoted context omitted.

You can do better than a 6MB blob. You can code split and cache. It's not that bad. Especially if it's an app, not an SEO site.

A 6MB blob is identical to 2MB, 1MB and 3MB blobs.

Not quite.

1. They can potentially be downloaded and parsed in parallel

2. They can be invalidated independently, meaning on your next visit you may only need to re-DL the 1MB blob instead of the whole thing

3. Not every page will need all 3 blobs, you might only need the 2MB blob to load the homepage which means it'll load a little bit quicker. Then you can either load the next blob on the next click, or start downloading it in the background so the next click is nearly instant

4. You can do this not just between pages, but progressively within a single page. Render part of the UI, wait for the 2nd blob, then render the components that need that bit.

Post reply on HN