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): Fix default value of jsc.minify.format.comments #7853

Merged
merged 4 commits into from
Aug 24, 2023

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Aug 24, 2023

@kdy1 kdy1 added this to the Planned milestone Aug 24, 2023
@kdy1 kdy1 self-assigned this Aug 24, 2023
@kdy1 kdy1 marked this pull request as ready for review August 24, 2023 17:50
kodiakhq[bot]
kodiakhq bot previously approved these changes Aug 24, 2023
@kdy1 kdy1 enabled auto-merge (squash) August 24, 2023 17:50
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

@kdy1 kdy1 merged commit 64e51d3 into swc-project:main Aug 24, 2023
@kdy1 kdy1 deleted the issue-7842 branch August 24, 2023 18:50
@kdy1 kdy1 modified the milestones: Planned, v1.3.79 Aug 25, 2023
kdy1 pushed a commit that referenced this pull request Aug 27, 2023
**Description:**

Looks like the bug I ran into had nothing to do with the changes in
#7856, since it's reproducible without it. Looks like it might have only
surfaced now because #7853
changed the default value of `jsc.minify.format.comments`? Added a
minimal test case here with the expected result.

Here's the actual output:

```js
 export var padding = '';
 export function exec2({ commands }) {
     return __awaiter(this, void 0, void 0, function*() {
         for(let i2 = 0; i2 < commands.length; i2++){
             let command = commands[i2];
             yield // some-comment
             function({ command }) {
                 command();
             }({
                 command,
                 handleError
             });
         }
     });
 }
```

The comment ends up getting added after the yield, which makes the
output invalid.

Going to see if I can figure out a fix tomorrow, but let me know if you
have any ideas on where to start looking in the meantime!
@swc-project swc-project locked as resolved and limited conversation to collaborators Sep 24, 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.

comment is not preserved even when the minification is not enabled
1 participant