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

feat(react-server): keep common layout without re-rendering #231

Merged
merged 67 commits into from
Apr 1, 2024

Conversation

hi-ogawa
Copy link
Owner

@hi-ogawa hi-ogawa commented Mar 26, 2024

I think I have one idea to make something like Next.js layout work https://nextjs.org/docs/app/api-reference/file-conventions/layout

demo

Navigation to https://rsc-experiment-hiroshi.vercel.app/demo/waku_02/pikachu

  • before

Image

  • after

Image

TODO

  • context to provide <RouteTreeProvider value={routeTreeStore}>...</RouteTreeProvider> to wrap everything
  • subscribe selectable store in each layout boundary <Layout><PickPageFromRouteTree url="/some/path"></Layout>
  • render RSC by page/layout parts
  • rsc layout stream format
  • ssr
  • csr
    • hydrate
    • re-render
      • fetch/serve RSC by page/layout parts
  • transition
  • keep common layout between navigation
  • hmr
  • request only invalidated layout contents
  • test
  • improve stream encoding?
  • refactor
    • stream type
    • rename "layout map" -> "layout data"
  • action pending

TODO (future)

  • link prefetch
  • custom invalidation on server action
    • currently only leaf page is invalidated
  • cache?

@hi-ogawa hi-ogawa changed the title feat(react-server): server component partial rendering feat(react-server): server component client partial rendering Mar 26, 2024
@hi-ogawa hi-ogawa marked this pull request as ready for review March 31, 2024 10:06
@hi-ogawa hi-ogawa changed the title feat(react-server): no re-render for common layout feat(react-server): avoid re-rendering common layout Mar 31, 2024
@hi-ogawa hi-ogawa changed the title feat(react-server): avoid re-rendering common layout feat(react-server): skip re-rendering common layout Mar 31, 2024
@hi-ogawa hi-ogawa changed the title feat(react-server): skip re-rendering common layout feat(react-server): avoid re-rendering common layout Mar 31, 2024
@hi-ogawa hi-ogawa mentioned this pull request Mar 31, 2024
69 tasks
@hi-ogawa hi-ogawa changed the title feat(react-server): avoid re-rendering common layout feat(react-server): keep common layout without re-rendering Mar 31, 2024
@hi-ogawa hi-ogawa merged commit d8cf559 into main Apr 1, 2024
4 checks passed
@hi-ogawa hi-ogawa deleted the feat-server-page-context branch April 1, 2024 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant