(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=43481295

Hacker News 上的一个帖子讨论了 Next.js 的缺点,尤其是在转向 App Router 之后。许多用户表达了对重大变更、缓慢的开发构建时间以及 Vercel 正在将 Next.js 推向其平台锁定的不满。一些用户发现 App Router 的体验非常糟糕,以至于放弃了项目。无服务器架构的复杂性也受到了批评。建议使用 React + Vite、Astro 和 Svelte 等替代方案。一些人认为 SSR 被过度炒作,并且 Next.js 只适合真正需要其功能(如 SSR 和后端代理)的项目。有人警告不要过度依赖 Vercel 和 Netlify。一位用户强调了 Next.js 在路由和构建流程方面提供约定带来的优势。

相关文章
  • 选择 Next.js 之前,你应该了解这些 2025-03-26
  • (评论) 2025-03-22
  • (评论) 2025-03-20
  • (评论) 2024-02-28
  • (评论) 2023-10-17

  • 原文
    Hacker News new | past | comments | ask | show | jobs | submit login
    You should know this before choosing Next.js (eduardoboucas.com)
    101 points by tobr 2 hours ago | hide | past | favorite | 30 comments










    I was using next.js when they switched from the pages router to app router. I ended up just abandoning the project, the app router experience was that bad, and haven't really been keen on picking up next.js since then.

    It's always seemed clear that Vercel has been, at best, OSS-ish. Trying to play both sides of claiming to be open source but also (somewhat sneakily) building a walled garden to lock users into their hosting platform.



    > next.js when they switched from the pages router to app router

    It is react-router all over again. For those who weren't around, react-router appeared early in React's life, and lots of people were using it. But, for every major version they released, they completely changed the way of doing the routes/routing, so if you wanted to use a maintained release, you'd have to constantly refactor, often without any real gains except "now we're on the latest version". I, just like parent with next.js, eventually stopped using it because it was too much.

    It's kind of weird to me how programmers (especially of libraries like that) aren't more careful about introducing breaking changes, since the work needed to be done afterwards multiplies really quickly. I'd wish people just split their new stuff into new libraries instead of changing the interface of existing ones.



    >It's kind of weird to me how programmers (especially of libraries like that) aren't more careful about introducing breaking changes, since the work needed to be done afterwards multiplies really quickly.

    Programmers, generally, always aim to do that. But the JS framework world for whatever reason has this constant obsession with reinvention. I honestly think it stems from a sort of inferiority complex that FE devs had in the the 2000s/10s which led to every single library feeling the need to invent new words to describe some CS concept that has been around for 40 years, and to massively overcomplicate things for the sake of looking smart.



    The single reason I switched from next.js was because it was taking me 6-7 seconds on a small project to see changes I made appear in the browser during development (on an M1 Max Macbook pro with 64gb of ram). This is when using the app router, where every change requires a compilation step.

    I now just use a React SPA with Vite.



    I'm not really convinced the serverless approach is a good default. It adds a lot of complexity that you might not need at all. I'm also not a fan of Javascript on the backend, but that's really more of a personal preference. But it is quite common to have backends in different languages, so the focus on server components and Next.js in the React world felt a bit like some tunnel vision to me. It was focused on an entirely different use case than mine, which is of course perfectly fine as not all features need to target my use cases. But pushing a more narrow and specialized setup as the default does seem like the wrong choice to me.

    And the serverless approach very likely was the reason they used HTTP headers for this kind of privileged communication between parts of the application. Which is a terrible idea for environments where you can't be sure those headers are never set by users.



    I warn everyone away from next.js. Unsurprisingly V0 has a real shot at massively increasing its adoption because people don’t know any better.

    What are some salient counter points for choosing next.js? I see a lot of new devs not want to have to think about deployment and management of systems so that is one aspect. If you only know react I guess getting SSR without having to learn something else is a win at the cost of complexity in your codebase.

    Anything else?



    Just having conventions around routing, and a "just works" build & lint is nice to avoid a team bikeshedding their own solutions. (Please don't suggest react-router... which seemingly reinvents itself every couple years).

    I'm very much in the camp of not fiddling with build, routing, hydration, state, etc. as they end up being a distraction from just making the thing you set out to make.



    There is such an exaggeration about the need/utility of SSR. Google is dead for new projects, if one is optimizing their stack based on the easiness for Google to crawl it, I think they are making a terrible architectural decision for no return. Deploying a React/JavaScript app is much easier without Next.JS.


    I agree but clearly Vercel benefits from teams choosing SSR, so teams need to take it with a grain of salt.


    Not to mention the absolute worst dev build time that’s had an open PR with a lot of complaints for years and not addressed.


    What is a good alternative, if I want to stick to React. Does any other framework support server/client hybrid rendering.


    I was trying out Astro recently. Seems fine. And it allows you to bring in any kind of components: React, Svelte etc. Has its caveats, but it's same stuff with slightly another approach.

    But anyway, I think there's plenty of alternatives. Next.JS simply took everyone's attention making it to seem like there's no other tool like it out there.



    Astro


    I like Astro


    > With Next.js having such a sizeable share of the market, I would expect a lot more hosting options, which would foster competition and innovation across the board, ultimately benefitting users and the web.

    Would it? Or would it turn Next.js hosting into a commodity with zero marginal profit, ulimately making it impossible to fund development?



    Stay away from anything that has to do with Vercel


    What about Svelte? Vercel is a major sponsor of its development.


    And influencers CEO, Vercel being the main one.


    Funny how everything goes through a cycle of it's amazing, it's terrible, it's boring


    Stay away from both Vercel and Netlify.

    Both are hype technology and will go the way of Gastby.



    Next is a fantastic choice if you really have the problems that it solves well (SSR and backend proxying). If you don't, it's a huge bloated mess, and you should just stick with a traditional SPA.


    Nice to see someone willing to stick their head above the trench wall. I worked on a "Vercel clone" for a year. After that experience I'd also warn friends to stay clear of Next.js. That said, we don't owe Vercel anything and if they want to ship a framework that's essentially a dongle for their service, they're perfectly entitled to do that.


    I have been building a completely open-source platform for hosting your own complex web applications.

    And I just recently open-sourced the JS framework. It loads modules on-demand as you need them. It’s supposed to be an all-in-one alternative to React+Redux, Angular etc.

    https://github.com/Qbix/Q.js

    Feedback would be welcome. I do want to start promoting it but it’s still early days.



    I was under the impression that Next.js was the successor to React? Is that not the case?


    > I was under the impression that Next.js was the successor to React? Is that not the case?

    You should probably read the article before posting.



    No, React is purely a library for rendering HTML elements on a screen. NextJS uses React for that, but it's more comprehensive. E.g. it provides routing out of the box, and server-side/client=side rendering bits, and it can run your code as a web application.


    Next.js is a framework built on the React UI library.

    Similar to SvelteKit, that's built on Svelte, and Nuxt that's built on Vue.



    Kind of. Vercel found a way to destroy React to its own benefit and profit.


    Not really. Next.js is still React. It's more like a wrapper/sidecar/framework around React that brings in some opinions on how to build apps and provides some niceties if you buy in.


    Oh boy.






    Join us for AI Startup School this June 16-17 in San Francisco!


    Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact



    Search:
    联系我们 contact @ memedata.com