-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
HMR should handle cyclic dependencies #10208
Comments
We just migrated from CRA to ViteJS and after all the work required found that Vite's HMR is apparently not very good at handling cyclical dependencies when CRA handled it like a champ. |
Same here. Vite is awesome, but some pieces for more complex apps still need a bit of work. Any chance of better circular dependency handling please? |
I'm looking forward for this feature. |
1 similar comment
I'm looking forward for this feature. |
|
@yyx990803 @patak-dev @sapphi-red do you have any updates or thoughts about this issue? In the current project, I am using Vite, and I have never seen this cyclic problem in CRA / Webpack. It seems that only Vite has some issues with it. Could you please tell us if there is any work being done related to this issue? |
@bluwy any thoughts about this issue? I would love to see the fix for it 🙏 |
I looked into this issue a couple weeks ago actually, and got side-tracked into #14654, but I'll take a look at this again. I'm still not sure if it's completely safe and possible to do so, the previous fix to always reload didn't have tests to prevent a regression. Anyways feel free to contribute a PR too if you like to see this fixed. |
Completely agree, it is equivalent to saying that |
Description
Previously in #2314, we've decided that HMR will not handle cyclic dependencies and instead reload the entire app, and we think that's the only way that it's correct.
However, I think we should reconsider that decision. Webpack apparently supports reloading app with circular dependencies, I haven't dig into the code, but webpack HMR works with our app with many many circular imports in it. so it's theoretically possible.
Suggested solution
Let's say I have 3 modules, A <-> B -> C,
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: