nextjs?
I'm a noob and I'm trying to figure out Wasp vs Next JS. I've done some google searching, but I don't understand why it wasn't built around NextJS. Am I missing something?
Would there be an advantage to having Wasp being adapted to NextJS? Esp given SSR
3 Replies
Hi @Arnab. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Wasp and Next.js are both high-level frameworks, but they serve different purposes and are not meant to be used together. Wasp is a DSL (Domain Specific Language) for building web apps with less boilerplate, while Next.js is a React framework that provides features like server-side rendering (SSR) and static site generation (SSG).
Wasp recompiles the code in
.wasp
on each source change. If you were to adjust the code in .wasp
to use Next.js, this would mean you can't use Wasp any more. It's not really how these two technologies were meant to work. Adding Next to Wasp because many tutorials use it is like trying to learn cooking while having an electric stove at home, seeing that most cooking tutorials use a gas/fire stove, and then trying to make your electric stove light up a fire and pump gas to simulate a gas stove[^1^].
Next.js does some things that Wasp can't do (e.g., great SSR support), while Wasp does other stuff that Next.js can't do (e.g., out of the box full-stack functionalities)[^1^].
As for the SEO and SSR, while it's true that Next.js has good SEO because of SSR, Wasp or Vite doesn't directly help with this. However, one solution is to use something else for the static part at the moment. While Next.js is one option, you can also take a look at Astro[^2^].
In terms of future plans, there is an open issue on Github discussing the possibility of adding SSR support for SEO[^3^]. However, there are no current plans to integrate Next.js into Wasp[^1^].
^1^]: [Discord support thread: Replace Vite after wasp gen? (https://discord.com/channels/686873244791210014/1221301825462866022)
^2^]: [Discord support thread: seo and ssr (https://discord.com/channels/686873244791210014/1219684155072184440)
^3^]: [Github Issue (closed): Server side rendering (SSR) (https://github.com/wasp-lang/wasp/issues/183)
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @Arnab, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?The bot have a great answer IMHO
On the topic of SSR, could you help us understand how would you use it so we can better understand how Wasp can better support you? 🙂
thank you! I was just trying to understand. I'm a noob