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: No need to use memo or useMemo in the server router #10568

Merged
merged 1 commit into from
May 13, 2024

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented May 13, 2024

For the server router there's no need to use memo() or useMemo(). They're used as optimizations in the browser to not re-render unless necessary. But on the server we never re-render. We render once for SSR and that's it.
useMemo() also isn't available during RSC rendering, so having that in there prevents us from using the server router during RSC rendering, which (with my current understanding of things) is something we'll want to do

@Tobbe Tobbe added release:fix This PR is a fix changesets-ok Override the changesets check labels May 13, 2024
@Tobbe Tobbe added this to the RSC milestone May 13, 2024
@Tobbe Tobbe merged commit 9dcaf31 into redwoodjs:main May 13, 2024
48 of 54 checks passed
@Tobbe Tobbe deleted the tobbe-rsc-server-router-no-usememo-memo branch May 13, 2024 14:58
dac09 added a commit that referenced this pull request May 15, 2024
…uth-store

* 'main' of github.com:redwoodjs/redwood:
  chore(router): Add more code comments to analyzeRoutes (#10569)
  RSC: No need to use memo or useMemo in the server router (#10568)
  RSC: getViteConfig in rscWorker (#10567)
  Split RSC and RSA handling in rscWorker (#10565)
  RSC: Extract the fetchRSC function (#10564)
  RSC: Fix TODO regarding SSR in client.ts (#10562)
  Docs: QoL Updates to Contributing.md (#10561)
  Added warning note to not add WebAuthn (#10231)
  fix(rsc): Load all css links to support css with rsc (#10544)
  fix(cli): Add deprecation notice for edgio deployment (#10551)
  Define `process.env.NODE_ENV` in build process. (#10553)
  chore(docs): Update dbAuth and Supabase middleware READMEs (#10552)
  chore(deps): Upgrade React 19 to beta 20240508 (#10560)
  Revert "chore(deps): React beta 20240508 (#10558)" (#10559)
  chore(deps): React beta 20240508 (#10558)
  fix(functions): Fix context variable warning/error (#10556)
  fix(functions): Mock context in function test template (#10555)
  chore(middleware): Format code and comments and fix comment grammar (#10554)
@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:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants