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/modules): Use function instead of arrow function unconditionally #7273

Merged
merged 6 commits into from
Apr 15, 2023

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Apr 15, 2023

Description:

I think the minifier will optimize this as an arrow function.
This is causing a problem in next.js, so I'm checking if this will fix it.

But basically, this is not our problem. Client files of next.js are compiled to es2016 but one of unit test in next.js expects the final app to be es5.

@magic-akari I'm sorry to ask this, but do we really need this optimization in module transform?

Related issue (if exists):

@kdy1 kdy1 self-assigned this Apr 15, 2023
@magic-akari
Copy link
Member

IMO, it's OK to remove this optimization.

@kdy1
Copy link
Member Author

kdy1 commented Apr 15, 2023

Thank you!

@kdy1 kdy1 added this to the Planned milestone Apr 15, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Member Author

@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_module
  • swc_ecma_preset_env

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@kdy1 kdy1 marked this pull request as ready for review April 15, 2023 06:42
kodiakhq[bot]
kodiakhq bot previously approved these changes Apr 15, 2023
@kdy1 kdy1 changed the title feat(es/modules): Use function unconditionally feat(es/modules): Use function instead of arrow function unconditionally Apr 15, 2023
@kdy1 kdy1 enabled auto-merge (squash) April 15, 2023 06:42
@kdy1 kdy1 merged commit 5d3313a into swc-project:main Apr 15, 2023
@kdy1 kdy1 deleted the module-arrow branch April 15, 2023 13:57
@kdy1 kdy1 modified the milestones: Planned, v1.3.51 Apr 16, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators May 16, 2023
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

2 participants