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(es/codegen): Fix codegen of unicode surrogates #7985

Merged
merged 58 commits into from
Sep 25, 2023

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Sep 21, 2023

Description:

x-ref: https://vercel.slack.com/archives/C02HY34AKME/p1695334071194139

Reproduction: https://github.com/kdy1/repro-test-mdx-korean

Regression of next.js: v13.4.11(swc_core@v0.79.13) => v13.5.2 (swc_core@v0.83.12)

  • next@v13.4.19 works (swc_core@v0.79.59)
  • next@v13.4.20-canary.3 works (swc_core@v0.79.70)
  • next@v13.4.20-canary.32 fails (swc_core@v0.83.12)

Commit range: 662f236...e67bf05

Diff: https://gist.github.com/kdy1/047e7e5537c34180d446cb3d5b95fce8


I did more investigation by monkey-patching the next package. .minify() resolved without an exception.
It means that .minify() is producing an invalid ES code.

So... candidates are

Related issue (if exists):

@kdy1 kdy1 added this to the Planned milestone Sep 21, 2023
@kdy1 kdy1 self-assigned this Sep 21, 2023
@kdy1 kdy1 force-pushed the next-swc-regression-minify branch 3 times, most recently from 87a96e5 to c23a481 Compare September 23, 2023 07:16
@kdy1 kdy1 force-pushed the next-swc-regression-minify branch 2 times, most recently from e51bc28 to 0d513c9 Compare September 23, 2023 07:52
@kdy1 kdy1 changed the title fix(es/codegen): Fix codegen of minifier fix(es/codegen): Fix parsing and codegen of complex string literals Sep 25, 2023
@kdy1
Copy link
Member Author

kdy1 commented Sep 25, 2023

Investigation: This was not a regression. This is simply a bug. I'll take some rest and fix it.

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_codegen

@kdy1 kdy1 marked this pull request as ready for review September 25, 2023 12:02
kodiakhq[bot]
kodiakhq bot previously approved these changes Sep 25, 2023
@kdy1 kdy1 changed the title fix(es/codegen): Fix parsing and codegen of complex string literals fix(es/codegen): Fix codegen of unicode smaller than 0xffff Sep 25, 2023
@kdy1 kdy1 enabled auto-merge (squash) September 25, 2023 12:03
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 disabled auto-merge September 25, 2023 13:28
kodiakhq[bot]
kodiakhq bot previously approved these changes Sep 25, 2023
@kdy1 kdy1 enabled auto-merge (squash) September 25, 2023 23:10
@kdy1 kdy1 changed the title fix(es/codegen): Fix codegen of unicode smaller than 0xffff fix(es/codegen): Fix codegen of unicode surrogates Sep 25, 2023
@kdy1 kdy1 disabled auto-merge September 25, 2023 23:18
@kdy1 kdy1 enabled auto-merge (squash) September 25, 2023 23:18
@kdy1 kdy1 disabled auto-merge September 25, 2023 23:35
@kdy1 kdy1 merged commit 39c680d into swc-project:main Sep 25, 2023
129 checks passed
@kdy1 kdy1 deleted the next-swc-regression-minify branch September 25, 2023 23:36
@kdy1 kdy1 modified the milestones: Planned, v1.3.90 Sep 27, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 27, 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