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
Add support for using the vite dev server on remotes #551
base: main
Are you sure you want to change the base?
Conversation
Great, thank you for your contribution. |
When I have some free time, I will start the code review. |
@ruleeeer |
Hi @ruleeeer! Thanks for the time for mantain this awesome plugin! Maybe I can help you adding some examples or test to evaluate if this PR is possible? (to reduce the time or the responsability of the review) I would be happy to help!! |
@jlillywhite @jlillywhite-mc |
I added a line to packages/examples/vue3-demo-esm/package.json that I can use to test the effect of dev remotes dev:remotes": "pnpm --parallel --filter \"./home\" --filter \"./css-modules\" --filter \"./common-lib\" --filter \"./dynamic-remote\" dev" Or go to |
Thanks for providing help !! 1): Test cases are needed, the easiest way to do this is to add a start 2): Then change the test dev's script after. https://github.com/originjs/vite-plugin-federation/blob/main/packages/examples/vitestSetup-dev.ts#L83-L84 |
Hey, thanks for taking the time to look at this. I will update it with tests and fixes as soon as I can. |
Any idea when this will get merged? I also need this. |
I tried to use this PR in my project, it does not work for me. I have warnings like |
Handle references to import.meta.env.BASE_URL
I'm still seeing a few issues with sharing images and manually setting package paths. I will continue working on this. |
I have noticed that if you use vite-plugin-react, both host and remote have to be in dev mode. |
It was because I had enable profiling on the host and not on the remote : |
I ran into this same issue when I was working on this. I'm still working on a clean way to resolve it. |
bump |
@ruleeeer @PicoI2 @jlillywhite How can we help you guys to unblock this and get it merged? |
@MrDeerly, I'm primarily a React developer, so it was pretty easy for me to get this working in dev mode for React, but I'm not familiar some of the other UI frameworks, so I'm having trouble tracking down the issues in other frameworks. If you have the expertise to do that, I would love any help I could get. |
I think it could be merged as using dev mode is not working at all without this, it's not like it will break anything. |
Description
This adds support for using the vite dev server for remotes. This addresses issue 204
Additional context
While this appears to work with the examples and the project where I'm consuming it, I'm not sure that it's very efficient. If there are ways to be more efficient with
importShared
and its associated module cache I would appreciate the input.I also didn't find a way to support version checking importShared without copying the
satisfy
code.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).