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): implement @babel/plugin-transform-react-jsx-self #2846

Conversation

fireairforce
Copy link
Contributor

@fireairforce fireairforce commented Mar 28, 2024

@github-actions github-actions bot added the A-transformer Area - Transformer / Transpiler label Mar 28, 2024
@@ -202,6 +201,10 @@ impl<'a> VisitMut<'a> for Transformer<'a> {
self.decorators.as_mut().map(|t| t.transform_declaration(decl));
}

fn visit_jsx_opening_element(&mut self, elem: &mut JSXOpeningElement<'a>) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it seems that visit_jsx_opening_element will execute after visit_expression, so the jsx_self transformer will execute after react_jsx transformer, maybe i need to move self.jsx_self.as_mut().map(|t| t.transform_jsx_opening_element(elem)); into visit_expression ?

@fireairforce fireairforce force-pushed the support-transform-react-jsx-self branch from 0b6e4ff to 005d12e Compare March 28, 2024 12:02
@fireairforce fireairforce force-pushed the support-transform-react-jsx-self branch from 005d12e to e988491 Compare March 28, 2024 12:02
Copy link

codspeed-hq bot commented Mar 28, 2024

CodSpeed Performance Report

Merging #2846 will degrade performances by 3.12%

Comparing fireairforce:support-transform-react-jsx-self (e988491) with main (b199cb8)

Summary

❌ 1 regressions
✅ 35 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main fireairforce:support-transform-react-jsx-self Change
parser_napi[checker.ts] 233.3 ms 240.8 ms -3.12%

@Dunqing Dunqing marked this pull request as draft March 29, 2024 07:53
@Boshen
Copy link
Member

Boshen commented Apr 13, 2024

Thank you for working on this. I copied your implementation and merged them in #2946

@Boshen Boshen closed this Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transformer Area - Transformer / Transpiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants