-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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: use a single transport for fetchModule and HMR support #18362
Conversation
Run & review this pull request in StackBlitz Codeflow. |
I polished the interface so that it's more easier to implement for the env providers. I think we need a better name and check if this is not breaking a code that was working in 5.x. |
@bluwy pointed out the inconsistency in the naming of Should we also standardise it here? |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
/ecosystem-ci run |
📝 Ran ecosystem CI on
✅ analogjs, histoire, ladle, laravel, marko, nuxt, previewjs, quasar, qwik, rakkas, redwoodjs, storybook, unocss, vite-plugin-pwa, vite-plugin-react, vite-plugin-react-swc, vite-plugin-svelte, vite-plugin-vue, vite-setup-catalogue, vitepress, vuepress |
Would it be possible to add examples of what the API looks like before and after to the description? That would help with understanding the change. |
@jamesopstad Thanks for taking a look! The diff looks like this: sapphi-red/daienjo-architecture@966c60a...feat/try-single-transport (note that this diff includes two environments, service-worker and workerd) |
Thanks @sapphi-red. That helps a lot! I really like this proposal. One thing that I'm wondering is if it might be possible to make it so that the We have this scenario where the WebSocket connection can't exist before the The only other thing I'm wondering is if it might be possible to avoid the need for |
I guess that's possible. But I'd like to leave that for this PR as this PR is already quite large.
The other ways I can think of is to:
|
This sounds good to me 👍 It looks like we cannot hide the normalization entirely anyways, so adding this won't hurt hopefully. |
I implemented |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍🏻
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good! I just double checked on my repo with pkg.pr.new
Description
so that env providers not need to implement both fetchModule transport and HMR transport.
I think this PR still needs to polish the naming and probably better to introduce a interface that wraps HotChannel so that env providers does not need to care about internal conversion that is done for(done).send
andinvoke
The upper part is how it was before and the lower part is how it is after.
The diff of the environment implementation looks like sapphi-red/daienjo-architecture@966c60a...feat/try-single-transport (note that this diff includes two environments, service-worker and workerd)