4 ms·
I’m curious why Nextjs is needed. I’ve started just building dynamic websites rendered on the server serving the content I need search engines to be able to cr
by revicon 5y ago
I’m curious why Nextjs is needed. I’ve started just building dynamic websites rendered on the server serving the content I need search engines to be able to crawl and then I drop a js file on each page which instruments whatever components I want to use react for on top of the already rendered html page. It’s worked very well for me so far, I have webpack build one JS file for each page I want to instrument and then I write react just like I usually do. Maybe my use case is different from what Nextjs is built for.
- meowtimemania 5y agoI think the reason to use next is so you don’t have to set all the stuff up yourself. Server side rendering with react and setting up webpack can be really time consuming, that’s why I use nextjs
- gherkinnn 5y agoThe fact that I don’t want to roll my own framework. What are the chances that I build something that is on par with something stable worked on by dozens? There’s a slew of features that I have zero interest in building, maintaining, and fixing while I could build the actual product instead.
- brundolf 5y agoWith Next I can take a single component and move it from client, to server, back to client, to static rendering. Or do all three on different pages that reference the same child component. Or have it static-render and then get automatically hydrated with client-side rendering when needed. Going between each of these modes for a given top-level page is a matter of changing a few lines of code; child components will Just Work(TM) in all of the above contexts without modification. None of this is impossible to do yourself, but Next makes it absolutely breezy, plus additional features like hot-reloading during dev, code-splitting on a per-page basis, and prefetching of those split bundles. You can also do crazy stuff like statically render all your pages so that the first page the user hits (regardless of which one it is) will get fetched as HTML, but then have all further navigation happen totally on the client side, where the same React code is getting run on the client that was used to statically render all the HTML at build time, so there's no worry about inconsistency. Frankly, in a hand-rolled site I wouldn't even bother doing some of the fancier stuff Next does, even if I knew how and knew it would be beneficial, because it would just be so darn complicated. But when it's this effortless, I can casually do it wherever it makes sense to (or experiment to find out whether or not it makes sense to!).
- lghh 5y agoTo be blunt, because I want to spend time creating value for my customers instead of doing all of what you're doing.
- aaronbrethorst 5y agoSome people here get upset when you say ‘just use Rails or Django and stop futzing around.’ Shrug.