Merged
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/59323 |
JLHwung
commented
May 13, 2025
| // Todo: support trailing comments spanned across trailing comma | ||
| "import-phases/source-expression-comments/input.js", | ||
| "import-phases/source-expression-options-comments/input.js", | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Note: this is a newly discovered issue and should be fixed in another PR.
Member
There was a problem hiding this comment.
I was wondering why they don't just work by default, aren't those comments marked as inner comments and thus printed automatically between , and ), where we should be checking for inner comments?
Contributor
Author
There was a problem hiding this comment.
Oh they are marked as trailing comments now due to
babel/packages/babel-parser/src/parser/comments.ts
Lines 174 to 176 in 205e1cf
If the experimental_preserveFormat works well, maybe we can get rid of this part in Babel 8?
liuxingbaoyu
approved these changes
May 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the first commit we removed the
createImportExpressionsrequirements for the import phase proposal.In the 2rd and 3rd commits we added more comments handling test cases and fixed a new bug surfaced from the new tests
In the 4th commit we add trailing comma handling to the ImportExpression such that
experimental_preserveFormatcan preserve the trailing comma in dynamic importIn the 5th commit we simplified the import phase comment handling.