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

feat(transformer): drop this parameter from typescript functions #1019

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

@Boshen Boshen requested a review from magic-akari October 20, 2023 09:18
@magic-akari
Copy link
Contributor

Great Investigation

@@ -144,4 +144,14 @@ impl<'a> VisitMut<'a> for Transformer<'a> {
self.visit_class_element(class_element);
});
}

fn visit_formal_parameters(&mut self, params: &mut FormalParameters<'a>) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean that we need to place a lot of AST visitor functions?
TypeScript AST are in many syntactic positions, and they produce a lot of extra statements.

However, when these AST visitor functions need to cooperate with each other in context, this will become very complicated.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, our codegen only prints javascript now so we don't need to remove nodes in the transformer.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a clever method.
So, I supposed there should be some methods, such as getInnerExpr, to get the JavaScript context AST that is wrapped by the TypeScript AST. Right?

@codspeed-hq
Copy link

codspeed-hq bot commented Oct 20, 2023

CodSpeed Performance Report

Merging #1019 will not alter performance

Comparing ts-remove-this (e69b752) with main (ee134f0)

Summary

✅ 22 untouched benchmarks

@Boshen Boshen merged commit d31a667 into main Oct 20, 2023
17 checks passed
@Boshen Boshen deleted the ts-remove-this branch October 20, 2023 15:15
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.

2 participants