Live data from Hacker News

Why I'm using Next.js

leerob.io

51–60 of 86 posts

Re: Why I'm using Next.js

#51
post #40

What are better options out there (for a Node developer) if you're not using Next.js? Going to rails isn't really an option I guess

Are you being ironic? If not: Rails is most certainly an option, if building web stuff is your goal.

I think it's lame how bad the documentation around it is 40 years in, which I can kind of forgive because of how well thought out and complete pretty much everything is, once you figure it out.

That is not to say that there aren't very sensible JS options – for example AdonisJS is well long running, constructed and feature complete TS backend framework, that has little traction – only that the community seems to value excitement and Apple marketing techniques to the point, where even their darlings core concepts are so absurdly unstable, that it feels insane to start any reasonably sized project with it.

Re: Why I'm using Next.js

#52

I can’t recommend Next after using it even on a small project. Whatever it sends to the browser is enough to eventually freeze the entire browser tab if you have the dev tools open. This was a daily recurrence. Also, the “fix” for many issues was to throw “use client” at the top of problem files. Serving the application whether first time load or dev time with hot module reload took an age. Really quite a miserable e…

Sorry about your experience.

> Whatever it sends to the browser is enough to eventually freeze the entire browser tab if you have the dev tools open.

Is this with a fresh Next.js project of after you've added user code? If the former and there's a GitHub issue, let me know and we can take a look. Thank you.

> Also, the “fix” for many issues was to throw “use client” at the top of problem files.

The Server Components model is still really new. It'll take some time for the ecosystem to evolve here. Here's a good post if you want to learn more: https://github.com/reactwg/server-components/discussions/5

Re: Why I'm using Next.js

#53
post #37
post #29

Earlier quoted context omitted.

I really don’t understand this sentiment, it is extremely easy to build and deploy Next.js yourself?? You either: - Build static files and host it like any other framework (e.g. throw it in an S3 bucket)[0] - Or, run a Node.js server Where’s the Vercel exclusive part there? [0] Here’s me doing exactly that, going through the same steps I would for literally any Frontend framework, including the WASM alternative I als…

It's easy but there are decisions made that hamstring you - like being unable to change cache-control headers in the next.config.js or middleware or have your middleware use node APIs, which is especially stupid because when self-hosting... it's running in node! They are optimizing for deploying to the edge, which when self hosting you don't need to. So whether malicious or not, their guard rails conveniently make it…

We put nginx in front to manage the cache headers.

My biggest gripe is that they made design decisions that are optimized for their paid products, at the expense of the open source. Middleware is the main example, because it has to run on their edge.platform, it has no routing association. For all the magic they do, they dropped the ball here, making you use regex to decide of middleware should be applied. All this because users were getting hit with surprise bills, which is.really a product of who they architected and charged, not a technical issue

Re: Why I'm using Next.js

#55
post #11

There’s a two simple reasons I would go for Next.js - It’s React-based: Almost everyone knows how to do React these days - It allows me to build and serve chunked static files, instead of just a single static files like classic SPA The last part is the main reason for that over other React-based frameworks. While SSR is hot these days, I’m firmly in the camp of “less servers I need to operate is better” and almost ha…

Yeah, a large number of Next.js apps use the static export functionality and host on S3: https://nextjs.org/docs/app/building-your-application/deploy...

Re: Why I'm using Next.js

#57
post #45
post #37

Earlier quoted context omitted.

It's easy but there are decisions made that hamstring you - like being unable to change cache-control headers in the next.config.js or middleware or have your middleware use node APIs, which is especially stupid because when self-hosting... it's running in node! They are optimizing for deploying to the edge, which when self hosting you don't need to. So whether malicious or not, their guard rails conveniently make it…

Middleware works when self hosting. It's runtime is a subset of Node.js, since it's potentially running in front of every request in your application. We're still evaluating options here: https://github.com/vercel/next.js/discussions/46722#discussi...

I never claimed middleware doesn't work when self hosting. I claimed that it's not as useful as it could be, because your company has prioritized edge deployments over supporting self-hosting.

As someone in that discussion rightfully says: "We are grown-ups with access to the same tracing and profiling tools as you. There is nothing dangerous about us using Node.js as far as I’m concerned."

Additionally, your comment just reeks of PR to me. I don't know if you do it on purpose or what, but to read my comment and then come back with "Middleware works when self hosting"... it has to be intentional on your part to misunderstand my comment that badly.

Re: Why I'm using Next.js

#58
post #42

We've been having a lot of problems with weird bugs with nextjs, so I can't really recommend it. Feels like it's a eternal beta. First, we've had a problem with nextjs not caching the response code for 404 pages, so 404 pages would have a 200 status code. Now they've fixed this they have a bug where they are caching the 304 response code, responding with 304 to every request and completely breaking the site. This has…

Yep their github management is atrocious. I understand it's a popular product so you get a lot of low quality issues opened, but there tons of real problems where no developer ever appears, and then are closed by the bot because of inactivity. Infuriating. The longer I do this, the more that issue management responsiveness becomes a real consideration when choosing a dependency.

I’m not trying to victim blame but why not fork and fix the bug? Isn’t that the point of open source? If you’re not paying for support then I feel you should set expectations accordingly. Do they offer any kind of sla or some other guarantee on responding to an issue?

(I work in enterprise stacks where there’s a hard contract that defines these things so maybe biased)

Re: Why I'm using Next.js

#59
post #41

Is anyone just using vanilla React with no TypeScript or Framework of any kind? I’ve tried Remix and Next js and just find them so cumbersome. Typescript causes me more headaches

Typescript is a real pain, I’m still trying to figure out why it’s so popular. The constant nagging and extra typing (no pun intended) when using it vs regular JavaScript makes it a pain. Then, there’s the extra parsing step to change it back to JavaScript. Idk I don’t see the value yet. Edit: I say “parsing step “ because that’s what it is. There’s no “compiling” and “transpile” is just a ridiculous way of saying pa…

Just to add some color to this… values come in from the DOM as strings or numbers or booleans. They go out over HTTP as strings. (These are approximations, I’m going from memory.) The question then becomes: Should I inspect the values or just pass the values along? You can see how a simple form might just collect data and pass it along to a backend, maybe do a bit of cursory inspection of the values to make sure they’re in range. A sophisticated web app, on the other hand, might construct an in-browser-memory model from the data, and so needs to vigorously ensure that the data is correct. In the first case types can be a pain since you’re not telling the compiler anything that isn’t already well understood. In latter case they’re a necessity.

Re: Why I'm using Next.js

#60
post #58
post #42

Earlier quoted context omitted.

Yep their github management is atrocious. I understand it's a popular product so you get a lot of low quality issues opened, but there tons of real problems where no developer ever appears, and then are closed by the bot because of inactivity. Infuriating. The longer I do this, the more that issue management responsiveness becomes a real consideration when choosing a dependency.

I’m not trying to victim blame but why not fork and fix the bug? Isn’t that the point of open source? If you’re not paying for support then I feel you should set expectations accordingly. Do they offer any kind of sla or some other guarantee on responding to an issue? (I work in enterprise stacks where there’s a hard contract that defines these things so maybe biased)

Yep absolutely, I agree and understand how much we're getting for free.

On the other hand, their marketing and hype machine has gotten the industry at large to buy into their product. So when you promise enough to get companies to move to your (free, open source) tech stack, but then are MIA when there are issues... I am of two minds.

But yes at the end of the day you're right.

Post reply on HN