3 ms·
This is incredibly complex for many static site use cases (i.e. blogs, documentation, marketing pages). Most don’t need JavaScript let alone React/JSX/Middlewar
by toastal 3y ago
This is incredibly complex for many static site use cases (i.e. blogs, documentation, marketing pages). Most don’t need JavaScript let alone React/JSX/Middleware/SSR/et al. I can’t imagine the long-term maintenance of something with so many moving parts and npm dependencies. Not saying there’s not a use case, but we should KISS before jumping to projects with a 1.8 GiB Git checkout & 828,128 LoC just to make a landing page.
- littlecranky67 3y agoIt is definetely only geared if you create a webapp, not a website. You can have static content (with MDX) for certain parts of your app, and restrict i.e. dynamic javascript stuff to your user's account/login section. But everything is within a single codebase. I personally don't care for the size of my node_modules folder, storage is cheap. Plus, with a yarn.lock or package.lock you don't have to care about npm dependencies, if you don't upgrade any, your simple `yarn install && next build && next export` will always produce the same result for years to come. The actual export output of NextJS is amongst the smallest you can get - you also get a nice summary of how big the initial load is for every route. Everything is chunked per route, all js chunks and assets contain their hash in the filename. That is why you can serve all of /_next/static with the `Cache-control: immutable`. This means if you don't update a section of your app, there is not even a need for the client to send GET requests with the `If-modified-since`, means: No additional roundtrip for any chunks. Preloading can be configured, by default its on-link-hover - that is, if your user hovers over a hyperlink/route, nextjs will already fetch the required chunks for that route before the click happens. Yes, NextJS is not competing with Hugo or other static site generators. It is aimed at tech-savvy people, and only for webapps that will require programming JS.
- rr808 3y agoRight, I'm not a front end developer, I tried NextJS and was super confused. eleventy worked great for me.
- ziftface 3y agoAgreed, but I think most people spend most of their time working on things more complicated than a blog. It seems there's a lot of excitement for purely static sites, which is fine, but I would call it hype at this point, and caution someone jumping into a new project against using a static site generator where it doesn't fit.