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

refactor: process_js_with_custom_pass should accept comments as paramter #6290

Merged

Conversation

JSerFeng
Copy link
Contributor

@JSerFeng JSerFeng commented Oct 29, 2022

Description:
process_js_with_custom_pass() should accept comments as parameter instead of using it internally, as user may pass an already parsed AST, and parse also need comments as parameter, so those comments should be the same.

Breaking Change
It's a breaking change, and I remember that next.js is using this API.
Also bindings/binding_core_wasm is using too.
Do I need to edit CHANGELOG, or if it can be done by swc-bot

@JSerFeng JSerFeng force-pushed the refactor/change-process-js-with-custom-pass branch 2 times, most recently from c47496a to 764ae4d Compare October 29, 2022 02:37
@kdy1 kdy1 added this to the Planned milestone Oct 29, 2022
@kdy1 kdy1 self-assigned this Oct 29, 2022
@@ -851,24 +851,24 @@ impl Compiler {
program: Option<Program>,
handler: &Handler,
opts: &Options,
custom_before_pass: impl FnOnce(&Program, &SingleThreadedComments) -> P1,
custom_after_pass: impl FnOnce(&Program, &SingleThreadedComments) -> P2,
comments: Option<&SingleThreadedComments>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this non-optional, and take ownership

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, modified

@JSerFeng JSerFeng force-pushed the refactor/change-process-js-with-custom-pass branch from 764ae4d to 1986c80 Compare October 29, 2022 07:04
Copy link
Member

@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 enabled auto-merge (squash) October 29, 2022 07:11
@kdy1 kdy1 merged commit 1024a55 into swc-project:main Oct 29, 2022
@kdy1 kdy1 modified the milestones: Planned, v1.3.12, v1.3.13 Nov 2, 2022
@swc-project swc-project locked as resolved and limited conversation to collaborators Dec 3, 2022
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