wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.65k stars 1.18k forks source link

Figure out our plan for RSC / SSR / SSG, also SEO #911

Open Martinsos opened 1 year ago

Martinsos commented 1 year ago

Things to explore:

NOTE: In the meantime, till we have more "official" support, to get meta tags per page, which is important for SEO, good potential solution is to use https://github.com/staylor/react-helmet-async .

EDIT: Big movement toward RSC, we should look at those in more details, see how we can support it and what it means in this whole picture.

leoschet commented 7 months ago

Hi there, any preview or update on this?

Martinsos commented 7 months ago

Hi there, any preview or update on this?

Not yet @leoschet , we have been prioritizing some other features lately!

How important is this for you, what are you needing SSR for?

leoschet commented 7 months ago

I would like it for SEO. No urgency per se.

Perhaps this is a repeated question, but as I understand React natively supports server components. Can we use it with wasp? Or is this exactly what this ticket is about?

Martinsos commented 7 months ago

I would like it for SEO. No urgency per se.

Perhaps this is a repeated question, but as I understand React natively supports server components. Can we use it with wasp? Or is this exactly what this ticket is about?

This is kind of what this ticket is somewhat about -> investigating how we are going to approach SSR / RSC / SSG and other stuff in Wasp. It wasn't super important so far, but we will want to address it at some point!

Martinsos commented 7 months ago

Note to self: while SSR is good for SEO, we can also get very good SEO without actually doing SSR, but just allowing users to set meta tags per pages.

Martinsos commented 7 months ago

User asked about this here: https://discord.com/channels/686873244791210014/1219684155072184440/1219684155072184440 .

Martinsos commented 7 months ago

Related to https://github.com/wasp-lang/wasp/issues/1910 .

Martinsos commented 6 months ago

We might want to look into using https://vike.dev/, seems like potentially a good solution to build upon!

jswizard09 commented 5 months ago

Hi I recently came across the wasp ecosystem and the open-saas product, I do really like what team was building. ........................................ I am working on a project with open-saas and I am at a point where SSR is important for the project, I understand that team is still working on it, wondering if there an options I could write custom handling of the rendering with the express server until a supported version is released

Martinsos commented 5 months ago

@jswizard09 thanks for the kind words!

What exactly do you mean by "custom handling of the rendering with the express server"? How would you go about that, can you share more details? What are you trying to achieve?

AdnanHussainTurki commented 5 months ago

@jswizard09 thanks for the kind words!

What exactly do you mean by "custom handling of the rendering with the express server"? How would you go about that, can you share more details? What are you trying to achieve?

Hi @Martinsos,

Thanks for your team efforts in this project, it's been a fun-ride using wasp-lang to quickly develop cool apps.

Similar to @jswizard09, I myself stuck on the SEO/Meta-tags per page/SSR issue which we do not support here at the moment.

I was wondering if we can modify the build process which may inject our custom meta-tags for each page. I know it would require different HTML page for each wasp 'page', which may be in conflict with the current philosophy of the project.

Love to know your thoughts!

Martinsos commented 5 months ago

@AdnanHussainTurki thanks for the comment, that makes perfect sense!

So the plan is to introduce SSR as an option, but we haven't started working on it yet -> it is among one of the things we will be looking to tackle quite soon for sure though, so likely in the next half a year.

There is no way to "hack" SSR in the meantime in Wasp, in the sense that you can tell the server how to render a component server-side.

What you can do in the meantime though is use something like https://github.com/staylor/react-helmet-async -> it will allow you to define in your React component, that you are using for a specific Page, how to set meta tags, so they will be picked up by the SEO, which is already a big deal. We will also be looking to possibly offer a bit more streamlined support for this, but react-helmet is actually a pretty simple / neat solution, so should do the job well here!

karlhorky commented 4 months ago

Maybe "React Server Components" and "RSC" should be added to the original issue description?

Because it seems like the canonical way that React frameworks are moving forward in this space:

Martinsos commented 4 months ago

Yup certainly! I will update it.

Martinsos commented 1 week ago

Discord discussion on how to do SEO in Wasp: https://discord.com/channels/686873244791210014/1296007418911916092/1296007418911916092 .

Martinsos commented 1 week ago

Related convo https://discord.com/channels/686873244791210014/1294555644770127893/1294555644770127893 .