Skip to content

refactor: use react-server-dom-vite #360

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

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

hi-ogawa
Copy link

Hi redwood team!

As I've discussed on Discord, I'm planning to propose react-server-dom-vite soon and I wanted to make sure it would work for redwood sdk, so I'm testing it on this PR. The package is built from my folk https://github.com/hi-ogawa/react/tree/feat-rsc-vite and tgz is pushed to hi-ogawa/vite-plugins#768.

API-wise this simply replaces hard-coded __webpack_require__ with setPreloadModule, so I'm expecting that there's no hassle migrating this, but I'd appreciate if you can take a look at the change and whether new API works for you. Also any feedback is very welcome (either here or feel free to ping on discord as well). Thank you!

@peterp
Copy link
Contributor

peterp commented Apr 26, 2025 via email

@justinvdm
Copy link
Collaborator

Thank you so much for this @hi-ogawa! And for keeping us in mind 🙇 Using vite-specific implementation for RSC would be first prize for us, so we're keen to get this to work.

I'll take a look at this PR this week coming. I might also make some changes to get a feel for the API and understand the changes better. Does that all work for you?

@hi-ogawa
Copy link
Author

@justinvdm Yes, please feel free to dig in and make changes 🙏 For now I just commented them out, but probably more code can be removed. I'm also checking with Waku and I might still need to keep "bundler config" API though. I'll share it on discord if there's an update.

@justinvdm
Copy link
Collaborator

justinvdm commented Apr 27, 2025

Hi @hi-ogawa, I've tested it out on a few examples of ours in dev and production, and it is working great!

Here's one example deployed with this change: https://kitchensink.redwoodjs.workers.dev/

From API perspective, also great - no more __webpack_require global, or hoop jumping for creating manifest maps.

I've gone ahead and updated the codebase in this PR to expect react-server-dom-vite. We'll just wait out for the packages to be released and ready, and we'll update the PR to the relevant canary builds and merge!

Thank you again 🙏

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.

3 participants