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

fix(plugin-legacy): force set build.target #10072

Merged
merged 3 commits into from
Sep 18, 2022

Conversation

sapphi-red
Copy link
Member

Description

See #10052 (comment) for reasons.
I'm not sure whether this is a breaking change.

close #10052

Additional context


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 Commit 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 plugin: legacy p4-important Violate documented behavior or significantly improves performance (priority) labels Sep 11, 2022
@patak-dev
Copy link
Member

It is interesting that this wasn't found before, thanks for digging into it Sapphi.
I think this PR is a good first step. We can release it as a minor for plugin-legacy to be on the safe side. In Vite 3.2 or maybe directly in Vite 4 I think it would be a good idea to decide if both targets should be same. I think it is a possibility that the best is the scheme after this PR, but in that case, we should better document how this work and why (for example because we want to avoid transpiling some features for a very small percentage of users if the target is modern browsers only)

Co-authored-by: patak <matias.capeletto@gmail.com>
patak-dev
patak-dev previously approved these changes Sep 12, 2022
bluwy
bluwy previously approved these changes Sep 17, 2022
@bluwy
Copy link
Member

bluwy commented Sep 17, 2022

Oh looks like there are conflicts after I approved 😅

In Vite 3.2 or maybe directly in Vite 4 I think it would be a good idea to decide if both targets should be same.

I think we should keep them different for now. The modern build target could be changed by #6922 in the future, so I think the difference could be treated as a plugin-legacy feature.

@sapphi-red sapphi-red dismissed stale reviews from bluwy and patak-dev via 0605081 September 18, 2022 13:50
@patak-dev patak-dev merged commit a13a7eb into vitejs:main Sep 18, 2022
@sapphi-red
Copy link
Member Author

I think we should keep them different at least until Vite 4. I don't find any big benefits of doing this breaking change in Vite 3.x.

@patak-dev
Copy link
Member

Let's release this PR in a new minor for plugin-legacy tomorrow.

@sapphi-red sapphi-red deleted the fix/legacy-force-target branch September 20, 2022 07:26
@kingyue737
Copy link
Contributor

Hope #2476 can be fixed to make build.target align with browserslist

mklein994 added a commit to mklein994/playground-vue that referenced this pull request Sep 27, 2022
There was a recent change[^1] to `@vitejs/plugin-legacy` that made it
hard-code the target to `['es2020', 'edge79', 'firefox67', 'chrome64',
'safari11.1']`. This unfortunately means the build fails if there are
any async generators (i.e. `function* foo() {}`). I can't figure out how
to make Vite ignore the `ForAwait*.vue` components, so I'll remove the
legacy plugin for now.

[^1]:
    [PR](vitejs/vite#10072),
    [commit](vitejs/vite@a13a7eb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4-important Violate documented behavior or significantly improves performance (priority) plugin: legacy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants