Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
developit wants to merge8 commits intomaster
base:master
Choose a base branch
Loading
fromlegacy-bundles-regenerator

Conversation

@developit
Copy link
Member

What kind of change does this PR introduce?

Transpiles generators to regenerator in legacy bundles.

Summary

In 3.3.0, we stopped usingfast-async to 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.

@developitdevelopit requested a review froma team as acode ownerNovember 18, 2021 16:29
@changeset-bot
Copy link

changeset-botbot commentedNov 18, 2021
edited
Loading

🦋 Changeset detected

Latest commit:dcf6a21

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
preact-cliPatch

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

@developit
Copy link
MemberAuthor

Not sure how I managed to make the Service Worker tests fail with this PR.

@rschristian
Copy link
Member

rschristian commentedNov 19, 2021
edited
Loading

Seems both service workers (esm and legacy) are having regenerator inserted in. I imagine they should be excluded?

developit reacted with thumbs up emoji

@developit
Copy link
MemberAuthor

@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).

@developit
Copy link
MemberAuthor

Darn, functionUse entries are only supported as of Webpack 4

{babelrc:false},
createBabelConfig(env,{ browsers}),
createBabelConfig(env,{
browsers:info.compiler.name==='InjectManifest'

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?

Copy link
MemberAuthor

@developitdevelopitNov 22, 2021
edited
Loading

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ah, right

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)=>({

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

Copy link
MemberAuthor

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?

Copy link
Member

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ForsakenHarmonyForsakenHarmonyForsakenHarmony approved these changes

@rschristianrschristianrschristian approved these changes

@JoviDeCroockJoviDeCroockJoviDeCroock approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@developit@rschristian@ForsakenHarmony@JoviDeCroock

[8]ページ先頭

©2009-2025 Movatter.jp