-
-
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
Web extension patches #9068
Web extension patches #9068
Conversation
cc @devongovett |
Bump - this should be relatively safe to merge, I've been using a |
Benchmark ResultsKitchen Sink ✅
Timings
Cold BundlesNo bundle changes detected. Cached Bundles
React HackerNews ✅
Timings
Cold Bundles
Cached Bundles
AtlasKit Editor ✅
Timings
Cold Bundles
Cached Bundles
Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
}, | ||
{ | ||
filePath: __filename, | ||
// cache bust on non-asset manifest.json changes |
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.
Why exactly are all of these caching workaround necessary here (this and invalidateOnBuild
above)?
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.
This seems to be the only way to make the extension reload (i.e. have an HMR update sent out) when the manifest.json
changes. I tried many other strategies but none seemed to work.
And once again: thank you for your contributions for the web extension functionality! |
Thank you @101arrowz! |
program.permissions.push('scripting'); | ||
} | ||
const hostPerms = [ | ||
...new Set(program.content_scripts.flatMap(sc => sc.matches)), |
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.
I'm getting an error here: @parcel/transformer-webextension: Cannot read properties of undefined (reading 'flatMap')
Trying to build a MV2 without content_scripts
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.
Already tracked in #9335
Are these changes already available in Parcel 2.10.2? If not, is it foreseeable when they are going to be released? Thanks! |
Yes, this was released as part of 2.10.0 |
The issue described in #8785 appears to still be happening for me using v2.10.3. |
↪️ Pull Request
Fixes #8159
Fixes #8404
Fixes #8590
Fixes #8707
Fixes #8785
Closes #8906
This PR should generally fix some of the key issues with the web extension transformer. The main key issue remaining is #8071; the rest of the open issues are mostly QoL things. This PR might fix also #8071 but I can't test it extensively enough to verify.
This PR also makes two key changes to how HMR works. Now, extension reloads cause all active content scripts to reload as well, and content scripts wait 500ms to give time for the extension to reload before they reload their own webpages.
Not sure how testable these changes are, but there are some questionable modifications I made in
hmr-runtime.js
that may be worth looking at closely.