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(es/minifier): Implement correct hoist_props #8593

Merged
merged 77 commits into from Feb 7, 2024

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Feb 2, 2024

Description:

  • The option hoist_props now does what it's supposed to do.
  • Dropping of unused properties now does not drop properties too aggressively.
  • The initializer of a dropped variable declaration is now properly visited.
  • Indexing with string literals is not marked as a dynamic index anymore. This is required to handle codes like
    var obj_foo = 1;
    var obj_bar = 2;
    function f() {
    var obj = { foo: 3, bar: 4, "b-r": 5, "b+r": 6, "b!r": 7 };
    console.log(obj_foo, obj.foo, obj.bar, obj["b-r"], obj["b+r"], obj["b!r"]);
    }
    f();
    .

@kdy1 kdy1 added this to the Planned milestone Feb 2, 2024
@kdy1 kdy1 self-assigned this Feb 2, 2024
Copy link

changeset-bot bot commented Feb 2, 2024

⚠️ No Changeset found

Latest commit: 1971c22

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

kodiakhq[bot]
kodiakhq bot previously approved these changes Feb 6, 2024
Austaras
Austaras previously approved these changes Feb 6, 2024
@kdy1 kdy1 enabled auto-merge (squash) February 6, 2024 10:46
@kdy1 kdy1 dismissed stale reviews from Austaras and kodiakhq via c23d3f1 February 6, 2024 10:48
kodiakhq[bot]
kodiakhq bot previously approved these changes Feb 6, 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

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

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 3122e94 into swc-project:main Feb 7, 2024
142 checks passed
@kdy1 kdy1 deleted the new-hoist-props branch February 7, 2024 03:25
@kdy1 kdy1 modified the milestones: Planned, v1.4.1 Feb 13, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators Mar 14, 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

3 participants