Disable react refresh for library targets#7914
Merged
Merged
Conversation
mischnic
reviewed
Apr 6, 2022
| "source": "index.js", | ||
| "main": "dist/main.js", | ||
| "dependencies": { | ||
| "@parcel/transformer-react-refresh-wrap": "*", |
Contributor
Author
There was a problem hiding this comment.
oh, probably not. This is probably from when I was experimenting with different package configs. I'll trim this down.
Contributor
Author
There was a problem hiding this comment.
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. |
mischnic
approved these changes
Apr 7, 2022
devongovett
approved these changes
Apr 7, 2022
This was referenced Apr 7, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For library targets:
JSTransformerReactRefreshRuntimeReactRefreshWrapTransformerFixes #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.