-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
(wmr) - fix stale hmr module graph #427
Conversation
🦋 Changeset detectedLatest commit: 2af3aa7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: -87 B (0%) Total Size: 690 kB
ℹ️ View Unchanged
|
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.
Love this! Can imagine that this took a while to debug 👍
Resolves #426
This PR aims to point out what's going wrong here, let's look at a simple file-tree.
We got
App.js
,Header.js
andstore.js
.When we make a change in
store.js
this will bubble up to bothHeader
andApp
as they both usestore.js
but store doesn't accept its own updates. When this happens we go into our module-graph and mark store as stale so we know we have to cache bust this import by adding?t=
. However we eagerly unmarked modules as stale, this means thatHeader
would import a stale copy whileApp
would have the newest one.