News for hackers. Stuff that matters.
Re:How to Inspect React Server Component Activity with Next.... by nottorp on Thursday January 23, 2025 @06:38AM (#42803033)
> Read the logs.

I've noted a tendency to not log stuff in some js-first devs i know ... they all say 'i'll reproduce it locally'...

Re:How to Inspect React Server Component Activity with Next.... by gunian on Thursday January 23, 2025 @06:50AM (#42803109)
how else would one reproduce a bug? in production?

or is it best practice to patch with logs only without reproduction

Re:How to Inspect React Server Component Activity with Next.... by blenderob on Thursday January 23, 2025 @08:06AM (#42803599)
> how else would one reproduce a bug? in production?

I don't think they meant "either" "or". I think they meant that you should not solely rely on reproducing issues locally. If you have good logging, many times, the logs would make it apparent where the issue is. When that fails, then you resort to reproducing the issue locally.

But if an app developer never adds any logs, they would be forced to reproducing the issue locally every single time which is counter productive.

So it isn't either logs or reproduce locally. It is add logs and read logs. But also reproduce locally when you really have to.

Re:How to Inspect React Server Component Activity with Next.... by bripkens on Thursday January 23, 2025 @06:56AM (#42803144)
There are often additional hints to go by, e.g., the executed network requests, the user path taken or "breadcrumbs", i.e., custom events captured.

Of course that requires a certain operational maturity.

Re:How to Inspect React Server Component Activity with Next.... by gunian on Thursday January 23, 2025 @07:11AM (#42803224)
In my head that feels like triaging but idk people really be patching bugs without reproducing? That sounds crazy to me idk why

I've never worked at a place that had local dev used to think computers hated me but wondering if this is better dev practice in general

Re:How to Inspect React Server Component Activity with Next.... by nottorp on Thursday January 23, 2025 @07:25AM (#42803302)
Who said anything about not reproducing?

It just takes a lot less time to reproduce if you have some logging in production... and some people seem to believe that's not needed.

Re:How to Inspect React Server Component Activity with Next.... by chamomeal on Thursday January 23, 2025 @04:55PM (#42808470)
Ok genuine question, since I feel like I’m using logs wrong:

How much stuff do you log in the server? I’ve only ever seen devs log basic high-level stuff. But to actually debug something, you need way more information.

I’ve tried sticking debug-level logs that log all sorts of business logic. Pretty much recreating what you would do with console.log when trying to isolate an issue locally.

But then you have your code permanently littered with debug log lines! It makes things… ugly!!

If you NEED detailed logging, do you just deal with the uglified code? Or is there a better solution? Decorators that logs parameters and such automatically??