Skip to content

Commit

Permalink
refactor(transformer/react): remove CalculateSignatureKey implement…
Browse files Browse the repository at this point in the history
…ation from refresh (#5289)

follow-up: #4587 (comment)

The `CalculateSignatureKey`is used to collect signature keys, but since it requires a double visit, it doesn't perform very well. Now I use ScopeId to store the signature key that is generated in `CallExpression`. This way we can then determine which ArrowFunction/Function the `CallExpression` belongs to.
  • Loading branch information
Dunqing committed Aug 30, 2024
1 parent fe62687 commit 7e2a7af
Show file tree
Hide file tree
Showing 2 changed files with 172 additions and 212 deletions.
4 changes: 4 additions & 0 deletions crates/oxc_transformer/src/react/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ impl<'a> React<'a> {
if self.display_name_plugin {
self.display_name.transform_call_expression(call_expr, ctx);
}

if self.refresh_plugin {
self.refresh.transform_call_expression(call_expr, ctx);
}
}

pub fn transform_jsx_opening_element(
Expand Down
Loading

0 comments on commit 7e2a7af

Please sign in to comment.