Managing HMR State Preservation with Circular Dependencies
Vite uses a dependency graph to manage Hot Module Replacement (HMR), allowing modules to opt-in to updates via import.meta.hot . When a module is updated, Vite attempts to invalidate only the affected branch of the graph to avoid a full page reload. A challenge arises when circular dependencies exist within the module graph. In these scenarios, the HMR bound