Skip to content

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

Merged
patak-cat merged 5 commits into
vitejs:mainfrom
sapphi-red:feat/legacy-modern-target-async-generator
Feb 2, 2023
Merged

feat(legacy)!: bump modern target to support async generator#11896
patak-cat merged 5 commits into
vitejs:mainfrom
sapphi-red:feat/legacy-modern-target-async-generator

Conversation

@sapphi-red

Copy link
Copy Markdown
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.