Reputation: 6987
I've yet to take a deep dive into SSR until now, but I'm about jump in, and first doing some preliminary research to try to get me and the agency going in the most-likely best direction. This is one of the determining factors in choosing Angular, React, or Vue as the company's choice in F/E frameworks which will become our go-to. As it has come to seem like React and Next are likely the best way forward for us at this time. I'm focusing on a few said cons of using Next, as they are things that I want to make sure are not deal breakers.
In one particular article comparing Next, Nuxt, and Nest, I am seeing a bullet point where it says that "Next.js is not backend". Elsewhere it's mentioned that Next should be supplemented with a Node.js server for a backend. My question to this is, is that suggesting that Nuxt and Nest are backend? So there wouldn't ever be any reason to supplement Nuxt and Nest with Node or another server? That doesn't seem to me like it would usually or always be the case. Like somehow Nuxt and Nest are so amazing that they handle most or all of the server needs you would ever have? It doesn't seem like that's necessarily their purpose... Or is it?
In the same article there are similarly three other bullet points as cons for Next that I have a hard time seeing how the other two frameworks would be any different. The other points are:
• If you’re creating a simple app, it can be overkill
• All data needs to be loadable from both the client and server
• Migrating a server-side app to Next.js is not a quick process, and depending on your project it may be too much work
I could be wrong, but it seems like these considerations were breezed over in the writing of the page. There would be good reason for noting these cons against the other frameworks just to not give the impression that Next is necessarily a miracle against the other two where development and migration were always going to be a breeze.
Obviously as a SO question, we would like to avoid opinion weighing in here, which this question seems like it might attract. I am looking for specific information about ways to make me believe Nuxt and Nest are advantageous over Next in these few regards.
I realize that people who could speak to every one of these SSR frameworks are probably scarce, but if you can speak to one or the other, that would still be very helpful.
Additionally, the article was written in April of 2019, and things may well have changed.
Upvotes: 3
Views: 1380
Reputation: 3416
So couple of things, and I think that this is a useful question to answer, although not a SO type of question.
Regarding the 2 points here:
If you’re creating a simple app, it can be overkill
Migrating a server-side app to Next.js is not a quick process, and depending on your project it may be too much work
Correct this is going to be true of any solution in that you need to correctly identify the tool for the job. As a result technology should be evaluated for appropriately.
When discussing:
This just isn't true. There is a reason why process.browser
exists in Next. There are cases where you only want client side data loads (user specific context loads), and only want static loads on the server (static page generation). Both of which are done through the various Next data-fetching hooks getStaticProps, getServerSideProps, or just use traditional fetch.
When addressing the API conversation, Next has since released API routes https://nextjs.org/docs/api-routes/introduction. However I'm a fan of separation of concerns in that API vs web server should probably independent anyway.
Added After Initial Submit:
Next vs. Nuxt vs Nest
Next vs. Nuxt is going to be mostly a vue vs react conversation there isn't going to be enough of a differentiation over what does the team want to use.
Nest on the other hand is a very different conversation. In that it is an opinionated framework for building server side apps using node. It can do the SSR however thats not its main purpose. You can see examples of how you can move forward with it here https://dev.to/saltyshiomix/introducing-an-alternative-to-next-js-12ph, but just know that where Next/Nuxt are geared towards universal applications, Nest just has it as a use case.
Upvotes: 5