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 import insertion code into its own module #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chancancode
Copy link
Contributor

Ultimately the goal is to fix #71 (which this commit does not do)

While working on that I decided to refactor the existing import related code and add some commentary to help others understand how it works. This just moves code around without changing behavior.

Ultimately the goal is to fix embroider-build#71 (which this commit does *not* do)

While working on that I decided to refactor the existing import
related code and add some commentary to help others understand how
it works. This just moves code around without changing behavior.
@@ -29,7 +29,7 @@ swc_ecma_codegen = { git = "https://github.com/ef4/swc.git", branch = "content-t
swc_ecma_ast = { git = "https://github.com/ef4/swc.git", branch = "content-tag" }
swc_ecma_visit = { git = "https://github.com/ef4/swc.git", branch = "content-tag" }
swc_ecma_utils = { git = "https://github.com/ef4/swc.git", branch = "content-tag" }
swc_ecma_transforms = { git = "https://github.com/ef4/swc.git", branch = "content-tag" }
swc_ecma_transforms_base = { git = "https://github.com/ef4/swc.git", branch = "content-tag" }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change isn't strictly necessary here, but the hygiene, resolver etc are all actually defined in swc_ecma_transforms_base and just re-exported from swc_ecma_transforms. There are some extra stuff (renamer, etc) that I may need to actually fix #71 so keeping it here.

template_identifier: Ident,
found_it: Option<&'a mut bool>,
pub has_template_tags: bool,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Inverted the awaked mut pointer passing, and instead make the Transformer expose this field, the caller is free to read it

@ef4 ef4 mentioned this pull request Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bad transform of fake this param
1 participant