RSC support for codegen? (nextjs)

RSC stands for React Server Components.

I noticed in codegen, the generated page immediately wraps everything with a client component such as “<GlobalContextsProvider>” and whatever components created by plasmic on plasmic studio. But by doing this it is basically making only support SSR or similar things and not benefiting from the RSC architecture.

  1. First question, is there any date for when RSC be officially supported? (e.g. basically app dir)
  2. Or if not possible, any potential easy switch that we can turn on and off such as moving some of the aforementioned client component to somewhere deeper or turn them into server component? Or any workarounds for now without interfering codegen and the rest of the app?

My current workaround is to use tanstack query prefetching solutions and its own dehydration + streaming technique from server component (basically the page component).

Plasmic currently only generates client components, which can be freely used within your RSC app. You can check out the Next.js docs which has code examples for using Plasmic with Next.js app router. The caveat is that the extractPlasmicQueryData functionality does not work, so you cannot prefetch queries defined in your Plasmic components or code components.

We have a beta version of the prefetching functionality working. If you’d like to try it, let me know and I’ll add you to the Slack channel.

I’m not sure I understand this question, but I think you’re asking how to use Plasmic with server components. If you’re using codegen, you should be able to wrap or nest Plasmic client components in server components to add server dependent functionality.

Sure, that would be cool to try out the version that does some prefetching, i’m curious.

Workaround I mean any official recommended ways?