-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Description
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,
- If B is changed, we can clearly see that we only need to reload A + B, but leaving C
- Theoretically, when a module is changed, it should only go up until all its transitive importers change, and whenever we hit a cycle, we should return instead of bail out the HMR.
- This logic made me believe this is a simple change, but maybe I missed something obvious.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable