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

refactor(es/minifier): Remove mangle.safari10 #8857

Merged
merged 12 commits into from
Apr 16, 2024

Conversation

Auspicus
Copy link
Contributor

When the mangle.safari10 option is set to true identifiers are re-used in the try/catch block which results in a parse error.

Description:

Using the mangle.safari10 option causes identifiers to be re-used in a try/catch block.

BREAKING CHANGE:

Related issue (if exists):
#8837

Copy link

changeset-bot bot commented Apr 13, 2024

⚠️ No Changeset found

Latest commit: e5b1f32

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Apr 13, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@@ -130,7 +130,7 @@ where
{
let mut scope = {
let mut v = Analyzer {
safari_10: self.config.safari_10,
safari_10: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can use Default::default() here?

@kdy1
Copy link
Member

kdy1 commented Apr 13, 2024

You can do UPDATE=1 cargo test from ./crates/swc_ecma_minifier to update test snapshot files

@kdy1 kdy1 added this to the Planned milestone Apr 13, 2024
@Auspicus
Copy link
Contributor Author

Auspicus commented Apr 14, 2024

@kdy1 I think we'll have divergence with the terser output for the broken_safari_catch_scope test if we remove this option. Is that OK?

@kzc has an interesting stance on the safari10 option: terser/terser#117 (comment)

@kdy1
Copy link
Member

kdy1 commented Apr 14, 2024

Yeap, it's fine

@kdy1 kdy1 self-assigned this Apr 15, 2024
@Auspicus Auspicus marked this pull request as ready for review April 15, 2024 21:37
@Auspicus Auspicus requested a review from a team as a code owner April 15, 2024 21:37
Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

swc-bump:

  • swc_ecma_transforms_base
  • swc_ecma_minifier
  • swc_core

@kdy1 kdy1 enabled auto-merge (squash) April 16, 2024 00:15
@kdy1 kdy1 changed the title fix(es/minifier): mangle.safari10 is causing identifier reuse refactor(es/minifier): Remove mangle.safari10 Apr 16, 2024
Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1
Copy link
Member

kdy1 commented Apr 16, 2024

Can you run UPDATE=1 cargo test --test projects --test tsc from ./crates/swc?

Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1 kdy1 merged commit df2e056 into swc-project:main Apr 16, 2024
149 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.4.15 Apr 17, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators May 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants