Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork375
Enable regenerator in legacy bundles#1617
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
changeset-botbot commentedNov 18, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
🦋 Changeset detectedLatest commit:dcf6a21 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 |
Not sure how I managed to make the Service Worker tests fail with this PR. |
rschristian commentedNov 19, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Seems both service workers (esm and legacy) are having regenerator inserted in. I imagine they should be excluded? |
@rschristian I was thinking that was the case, yeah. Neither should have it, or at least the modern one shouldn't have it (the legacy sw file never gets used, no browsers support SW that don't also support ESM). |
Darn, function |
| {babelrc:false}, | ||
| createBabelConfig(env,{ browsers}), | ||
| createBabelConfig(env,{ | ||
| browsers:info.compiler.name==='InjectManifest' |
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.
what exactly does this do?
developitNov 22, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
It's supposed to keep modern syntax in both generatedsw.js outputs, since service worker is only supported by fairly modern browsers with generator/async support anyway. Thecompiler.name check is looking for the child compiler created by theworkbox-webpack-pluginInjectManfiest plugin.
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.
ah, right
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.
maybe it would make sense to add a comment for future reference
| module:{ | ||
| rules:[ | ||
| { | ||
| (info)=>({ |
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.
The tests seem to be failing because this is a function
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 only supported in newer Webpack?
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.
No, isn't supported in newer Webpack either. Rules have to be objects.
What kind of change does this PR introduce?
Transpiles generators to regenerator in legacy bundles.
Summary
In 3.3.0, we stopped using
fast-asyncto transpile async functions, however this meant they were transpiled to generators, which we don't transpile at all. The modern bundles should be unaffected by all of these changes, so let's enable regenerator to handle both async and generator functions in legacy bundles.Does this PR introduce a breaking change?
No, it fixes an unintentionally-breaking change.