Skip to content
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

feat(legacy)!: bump modern target to support async generator #11896

Merged

Conversation

sapphi-red
Copy link
Member

Description

After this PR, browsers that doesn't support async generators now runs on legacy chunks.

Plugin-legacy fails to build when the source code included async generators. The reason why this happens is because esbuild doesn't support transpiling async generators. (#11835)

Async generators is supported by edge79, firefox55, chrome63, safari12. The modern target we use currently is es2020, edge79, firefox67, chrome64, safari11.1.
If we changed safari11.1 to safari12, we can avoid transpiling on modern chunks and the build will pass.

Because Safari 11.1 is only used by 0.01%, I think it's fine to bump the target.

I tested this with Safari 11.1, 12.1, Chrome 62, 63, 64, IE11.

close #11835

Additional context

I fixed a bug that I found during implementing this. 5ac8417

When import.meta is not used in the source code, the code was running twice (once with modern chunks and once with legacy chunks) on Chrome 63.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@sapphi-red sapphi-red added p2-nice-to-have Not breaking anything but nice to have (priority) breaking change labels Feb 2, 2023
Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

Awesome work

@patak-dev patak-dev merged commit 55b9711 into vitejs:main Feb 2, 2023
@sapphi-red sapphi-red deleted the feat/legacy-modern-target-async-generator branch February 2, 2023 10:17
@Pinpickle
Copy link

Thanks for sorting this so quickly @sapphi-red!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Legacy plugin breaks async generators
3 participants