Live data from Hacker News

How to Inspect React Server Component Activity with Next.js and OpenTelemetry

dash0.com

31–40 of 52 posts

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#31
post #26

Excuse my ignorance but why does it look so complicated and unnecessary? What exactly does it improve over lets say PHP or Rails or whatever?

> What exactly does it improve over lets say PHP or Rails Uses the same code to render on server and in browser, enables moving render logic from browser to server and vice versa without doing a complete rewrite.

Not very DRY.

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#32
post #4

Earlier quoted context omitted.

Not quite sure what the big challenge is here. If the work is shifting to the server, you debug on the server! Read the logs. Attach a debugger. Instrument the code if you must! All that usual stuff. This is how web-development has been since the days of CGI. What am I missing?

And these days, you use the same browser debug tools to attach to nodejs.

Yes, but it's missing the network tab, see https://github.com/nodejs/diagnostics/issues/75

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#33
post #29
post #27

Earlier quoted context omitted.

That's mostly because `create-react-app` was abandoned. There is no default project template for React SPA, so everyone just uses Next, even if they don't need SSR.

vite exists? what are you even talking about

A lot of things exist. But to become a go-to standard a good timing is required. Next.js was getting popular right at the time Facebook abandoned 'create-react-app' template, and many people adopted Next.js even if they didn't need SSR. Vite didn't exist back then.

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#34
post #26

Excuse my ignorance but why does it look so complicated and unnecessary? What exactly does it improve over lets say PHP or Rails or whatever?

> What exactly does it improve over lets say PHP or Rails Uses the same code to render on server and in browser, enables moving render logic from browser to server and vice versa without doing a complete rewrite.

Why? lol

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#35
post #26

Earlier quoted context omitted.

> What exactly does it improve over lets say PHP or Rails Uses the same code to render on server and in browser, enables moving render logic from browser to server and vice versa without doing a complete rewrite.

Why? lol

So that the page is already rendered upon the initial contact from the server, decreasing page load latency.

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#36
Great write up. We’ve migrated to NextJs App Router where I work. While RSCs introduce a certain level of complexity, we’ve appreciated their benefits. The telemetry on the backend is something we’ve been looking to improve, and there doesn’t seem to be a lot of info out there, so this helps.

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#37
post #26

Earlier quoted context omitted.

> What exactly does it improve over lets say PHP or Rails Uses the same code to render on server and in browser, enables moving render logic from browser to server and vice versa without doing a complete rewrite.

Not very DRY.

Arguably more.

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#38

Earlier quoted context omitted.

on next.js first page loads are almost instant for very complex sites with very little work on the optimization side. it's an incredibly polished server and it does a lot of complex stuff to be so fast, but it's also well documented.

I don’t think this answers the parent question. Database queries still needs to be made and a view still needs to be rendered. What complexity does next.js solve?

> What complexity does next.js solve?

in our case it solves performance, it actively keeps cache warmed up preventing it from ever serving a stale page or serving a non cached hit, preloads content for fast navigation, optimizes images, it's lightweight, scales horizontally, it's stable.

it has all the bells and whistles the big boys have, for free, you almost don't need to think about it, just follow some guidance.

while people say it's too much magic (there are 4 cache layers), you are always free to pop up the hood and read the documentation, which is excellent.

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#39
post #27
post #16

Earlier quoted context omitted.

It’s awful and I’m pretty sad that it seems the entire nodejs community has adopted next.js as standard. All projects I’ve been involved with use it and none of them use any SSR at all.

That's mostly because `create-react-app` was abandoned. There is no default project template for React SPA, so everyone just uses Next, even if they don't need SSR.

I didn't know create-react-app was abandoned. What was wrong with it?

Re: How to Inspect React Server Component Activity with Next.js and OpenTelemetry

#40

Excuse my ignorance but why does it look so complicated and unnecessary? What exactly does it improve over lets say PHP or Rails or whatever?

Difficult question to answer because it's difficult to know what you're asking. What is "it" here? Next.js? OpenTelemetry? This specific implementation?

PHP is a programming language, Rails is a framework. They're quite different propositions. What you're seeing here is equivalent to poking around in the guts of Rails, which assuredly has plenty of complexity hidden inside it. I personally have a negative reaction to this amount of stuff in a project but I feel similarly about Rails.

Next’s big “thing” is one codebase that runs both on the server and client. That introduces complexity where you might not expect it. But a Rails app and a totally disconnected JS front end will also introduce complexity, just a kind you’re more familiar with.

Post reply on HN