-
Notifications
You must be signed in to change notification settings - Fork 472
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: add comments in module code generation #2893
feat: add comments in module code generation #2893
Conversation
🦋 Changeset detectedLatest commit: 0587b99 The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
this pr also includes some expected file change, and the |
Would you mind adding an option to control this behavior? Not everyone wants comments in their outputs, also this would slow the codegen phase. You could add some tests in another dir, comments are kinds of noise in tree shaking test. |
Ok, I will add |
I don't think it is a good option to mix this behavior with minifyOption, because according to your implementation, this option should control development mode code generation behavior as well. Would you mind waiting about one day or so? Maybe we could discuss where should we put the option, or we don't need a option just codegenerate the comments anyway. |
Hey @IWANABETHATGUY , after discussing how this option should be designed🤔️ |
We don't want this feature to introduce too much overhead, so let's bench it first. |
Benchmark Results
|
bd0735d
to
a7f578f
Compare
!bench |
please make sure to pass the CI, you could run |
Benchmark Results
|
!bench |
Benchmark Results
|
32b144c
to
2e73575
Compare
the |
Do you use Windows? |
OS: macOS 13.0
rspack/crates/cargo-rst/src/rst.rs Lines 347 to 363 in 4e25faf
Is this problem due to diff? |
I think you could add an option to control this behavior, like |
By default this option should be disabled, you could add extra test case to test this behavior, this will not conflict with current test case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
* feat: add comments in module code generation * feat: add builtins.codeGeneration.keepComments * chore: update
Related issue (if exists)
#2868
Summary
🤖 Generated by Copilot at 15c7690
Add support for comments in the JavaScript plugin. Modify the
stringify
function instringify.rs
to pass the comments from the AST to theprint
function.Walkthrough
🤖 Generated by Copilot at 15c7690