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

refactor(react-server): use sync module for client/server reference #87

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

hi-ogawa
Copy link
Owner

@hi-ogawa hi-ogawa commented May 27, 2024

Relying on async module was definitely easier, but this might not be what React team wants to do in general. Rewriting to sync module (and thus removing one shaky patch) seems still simple but it relies on own cache busting for dev, which is not entirely cool.

  • dev
    • client reference
      • ssr
      • browser
    • server reference
  • build
    • client reference
      • ssr
      • browser
    • server reference

todo

  • check how Jacob's diy handles preload

@hi-ogawa hi-ogawa marked this pull request as ready for review May 27, 2024 03:42
Comment on lines +17 to +19
// cache bust for each flight render during dev
// https://github.com/facebook/react/blob/ea6e05912aa43a0bbfbee381752caa1817a41a86/packages/react-server-dom-webpack/src/ReactFlightClientConfigBundlerWebpack.js#L182
const cacheId = Math.random().toString(36).slice(2);
Copy link
Owner Author

@hi-ogawa hi-ogawa Aug 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might not need this since we already have "reference id" with ?t=... which should serve as an appropriate __webpack_chunk_load__ cache key?

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