Live data from Hacker News

Is React Having an Angular.js Moment?

marmelab.com

81–90 of 97 posts

Re: Is React Having an Angular.js Moment?

#82
post #32

Earlier quoted context omitted.

I think the React team is responding to current trends. SPAs were super trendy. Once people started building them, they recognized that SPAs are much harder to optimize than the code for a single page. Next.js came in, and everyone has slowly been shifting to SSR. If the react team doesn't react, other frameworks will eclipse them. While I don't like the implementation details, I can see what they were going for. Enc…

I've never seen the use-case. If you're building trivial brochure pages that need SSR for adsense, you shouldnt be using react at all. If you're building complex apps, it doesn't really make much sense to put the burden of rendering on your server.

That's the gap server components fill. With SSR you always had the option to just use React on the server and send HTML back, no JS or hydration needed. But if you then want a single widget on the page you can go back to the old (not saying bad) days where you include some clientside js that attaches event handlers and changes some HTML. Or you mark that one component with "use client" and you're done and can seamlessly to your declarative rendering on the client and use the same components you already have.

The RSC part is mostly the streaming of the JSX result, but this only solves the issue that the market wants to work in a MPA way with the routing benefits of a SPA.

Again, nothing new, Turbolinks existed and replaced sections of your HTML with XHR, but you had to slice it up yourself and manage interactions again if the section you changed required JS. RSC takes away the latter part and you're only required to define the boundaries. That's the reason why RSC has it's place, you're able to mix and match it within the same codebase instead of maintaining one codebase for your marketing pages and one codebase for your application (and one for your docs)

Re: Is React Having an Angular.js Moment?

#83

Earlier quoted context omitted.

Oh man as a non fe person this is so overwhelming. I just got the hang of page based routing in nextjs and I still feel like I am walking on eggshells. Frankly all I want is TO render a next/jsx page into a jinja style template that I can render with backend of choice (golang) while leaving some ajax loading on the page when needed. I don't need my entire application to be a single page (don't get me started on under…

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.

Re: Is React Having an Angular.js Moment?

#84

Earlier quoted context omitted.

Pretty much every app I've ever needed required an API, which meant a server, which meant Next.js would have been a viable candidate. Sure, there are use-cases that you truly don't need an API or you can just hook up to an existing one, but I don't think they're nearly as common.

I don't think any of what you're saying really makes much sense. Merely having a server doesn't mean SSR provides business-relevant benefits.

Next.js provides API routes / initial serverside loaders for your routes. Disable SSR, Next.js still benefits from being able to write CRUD code in the same codebase and most applications need that anyways

Re: Is React Having an Angular.js Moment?

#85

Earlier quoted context omitted.

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

Node is fine (and improving), but Express, or any of the many other libraries with similar APIs, is full of footguns: - The base request-response cycle is ridiculously dynamic: the void-returning-callback API + stateful response object makes debugging a nightmare. - Then there’s middlewares: they can come from anywhere, do anything anywhere in the call stack. They create complex webs of implicit coupling you can’t se…

Any experiences with Hapi or Deno re: footguns above?

Re: Is React Having an Angular.js Moment?

#86
post #71

Earlier quoted context omitted.

You could use Go with templates and htmx, no js needed :-)

You know I wish I heard about htmx before I started next. Now I feel like another ecosystem to get started on :(

It's hardly an ecosystem, think of it more as a turbocharger for your backend. Your customers won't care if you chose one or the other anyway.

Re: Is React Having an Angular.js Moment?

#87

Earlier quoted context omitted.

Node is fine (and improving), but Express, or any of the many other libraries with similar APIs, is full of footguns: - The base request-response cycle is ridiculously dynamic: the void-returning-callback API + stateful response object makes debugging a nightmare. - Then there’s middlewares: they can come from anywhere, do anything anywhere in the call stack. They create complex webs of implicit coupling you can’t se…

Any experiences with Hapi or Deno re: footguns above?

No direct experience, but the fact that route handlers return responses is a good sign. Both look like they have some of the request-mutation type of footguns.

Re: Is React Having an Angular.js Moment?

#88
post #25

React Server Components remind me of inline PHP with html. Wasn't a good idea then. Not a good idea now.

They literally make this comparison in the next docs somewhere

https://nextjs.org/docs/getting-started/react-essentials#why...

Re: Is React Having an Angular.js Moment?

#89

Earlier quoted context omitted.

The things you've described do not require react.

What's a good template engine that isn't string based? Jsx and Jade are the only 2 I know. I guess you can use jsx without React if you want.

Ejs.

Re: Is React Having an Angular.js Moment?

#90

Earlier quoted context omitted.

You know I wish I heard about htmx before I started next. Now I feel like another ecosystem to get started on :(

It's hardly an ecosystem, think of it more as a turbocharger for your backend. Your customers won't care if you chose one or the other anyway.

IL still have to "migrate" my existing apps no - sure I could use htmx for. Ew projects but I have so many inflight which is where I was wary of the change. Is there an easier way?
Post reply on HN