-
-
Notifications
You must be signed in to change notification settings - Fork 160
test(rsc): add navigation
example
#567
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
base: main
Are you sure you want to change the base?
Conversation
@hi-ogawa I can't get npm run build/preview to work, although it was working on vite-plugins and hydration worked in that case. ![]() |
I'll continue work in vite-plugins PR for now because build/preview works there |
navigation
example
Thanks for the PR! The build error was because there was a copy of
The dev error is due to Vite's deps optimization. I added It looks like navigation has some issues (both dev and build) and also there's typescript error, which I'm not sure about. Please continue integration and feel free to ask me if anything unclear about Vite RSC. Thanks! |
@hi-ogawa Thank you, that's amazing 🙏 |
The built-in vite hydrate does too much - handles navigation, for example, which is no good because router needs to handle it
Also renamed to Shell to match other navigation rsc examples
Copied over from vite-plugins.
Hi @hi-ogawa , thank you for working on a vite rsc implementation.
I'm the author of the Navigation router, an rsc framework for react. I'd already written example rsc apps to test out parcel and webpack. So I've started to do the same for your vite implementation. This PR isn't meant to be merged but is a good way to communicate any issues I find.
I cloned your basic example and copied in the files from my working parcel example. When I run
npm run dev
the ssr works but the hydration fails. It fails because the react context isn't populated as expected. It seems like vite has 2 versions of the file - 1 inside the bundled navigation-react.js and one standalone. You can see in the screenshot below it says "from SceneRSCView" instead of "from navigation-react.js". The react context is created from navigation-react.js so it can't be found if it's not accessed the same way. This is just my guess as to what's going wrong.For some background, The
navigation-react
package has different exports for server and client and has internal client boundaries. TheSceneRSCView
, where the error is happening, is one of these.Thanks again for all your work.