Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSC: Include <App> in SSR #10688

Merged
merged 53 commits into from
Jun 4, 2024
Merged

RSC: Include <App> in SSR #10688

merged 53 commits into from
Jun 4, 2024

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented May 28, 2024

This PR makes it so that Redwood:

  • Switches to noExternal for the SSR build.
  • Adds --conditions node-server to the entire server process that does SSR (including RSC rendering during SSR)
  • Adds a bunch of dynamic imports, including react, from the SSR dist folder
  • Renders the Redwood framework shell and the Redwood app entry point (<App>) as client components
  • Renders a new SSR router as a client component
  • Calls renderToReadableStream, passing in files from the RSC build dist folder
  • Renders the ServerRouter, page layouts and pages as RSC components
  • Uses the bundler config (proxy) to read a bunch of client components
  • Calls createFromReadableStream.
  • Uses our webpack shim to load a bunch of client components
  • Renders all of that to HTML that is streamed to the client
  • Makes sure React can rehydrate on the client and pick up rendering using createFromFetch for RSC components

Some of the things mentioned above RW already did before this PR, but I just wanted to include it all to get the full flow documented

@Tobbe Tobbe changed the title RSC: Cache client side navigation RSC: Include <App> in SSR May 28, 2024
@Tobbe Tobbe added the release:feature This PR introduces a new feature label Jun 3, 2024
@Tobbe Tobbe added this to the RSC milestone Jun 3, 2024
@Tobbe Tobbe added the changesets-ok Override the changesets check label Jun 3, 2024
@Tobbe Tobbe marked this pull request as ready for review June 4, 2024 20:01
@Tobbe Tobbe merged commit 3580cc8 into redwoodjs:main Jun 4, 2024
46 checks passed
@Tobbe Tobbe deleted the tobbe-rsc-ssr-app branch June 4, 2024 20:20
dac09 added a commit to dac09/redwood that referenced this pull request Jun 7, 2024
…rver-store

* 'main' of github.com:redwoodjs/redwood:
  chore(deps): bump @fastify/reply-from from 9.4.0 to 9.8.0 (redwoodjs#10728)
  chore(deps): bump jose from 4.15.4 to 4.15.5 (redwoodjs#10726)
  chore(ci): Track `@redwoodjs/router` in RSC CI (redwoodjs#10727)
  chore(deps): bump ejs from 3.1.9 to 3.1.10 (redwoodjs#10725)
  RSC: Include `<App>` in SSR (redwoodjs#10688)
  chore(logging): Remove overly verbose logging (redwoodjs#10723)
  chore(formatting): Fix "check annotations" (redwoodjs#10722)
  chore(comment): Update comment to match implementation (redwoodjs#10720)
  chore(imports): Differentiate between React type import and method imports (redwoodjs#10721)
  chore(auth): auth-supabase-api dependency fixes (redwoodjs#10719)
@Josh-Walker-GM Josh-Walker-GM modified the milestones: RSC, v8.0.0 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:feature This PR introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants