-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Disable react refresh for library targets #7914
Conversation
"source": "index.js", | ||
"main": "dist/main.js", | ||
"dependencies": { | ||
"@parcel/transformer-react-refresh-wrap": "*", |
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.
Is this dependency needed?
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.
oh, probably not. This is probably from when I was experimenting with different package configs. I'll trim this down.
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.
Actually, I think it is; if this is removed, forcing the the test to fail (by commenting out the fix) doesn't manifest because External dependency "@parcel/transformer-react-refresh-wrap" is not declared in package.json.
Benchmark ResultsKitchen Sink 🚨
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... React HackerNews ✅
Timings
Cold Bundles
Cached BundlesNo bundle changes detected. AtlasKit Editor 🚨
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
For library targets:
JSTransformer
ReactRefreshRuntime
ReactRefreshWrapTransformer
Fixes #7359, #7496, #7652, #7900
See also: #6892
Background
This was a tough one to track down because it often 'failed' silently,
and when it did produce a symptom at build time, it looked like a scope hoisting bug:
The error would only occur when:
in a way that required deep symbol resolution in the packaging step.
For a while, the working theory was that there was an issue in symbol resolution because the last condition would result in the build failure. But the underlying problem was actually the combination of the first two conditions.
The issue can be summarized as:
Testing
One integration test was added:
yarn test:integration --grep "refresh.*library"
Additionally, reproductions involving library targets from all of the linked issues were resolved with this fix.