fix(tranformer_plugins): define plugin need to add reference to scoping#14615
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where the define plugin needs to add reference IDs to scoping for proper semantic analysis. The fix ensures that replaced expressions have proper reference IDs and that the updated scoping is reused instead of being recreated.
- Updates the replace global defines plugin to properly handle reference IDs in replaced expressions
- Modifies the compiler pipeline to reuse updated scoping instead of rebuilding it
- Adds test verification to ensure identifier references have proper reference IDs
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/oxc_transformer_plugins/src/replace_global_defines.rs | Updates plugin to assign reference IDs to replaced expressions and changes function signatures to accept mutable TraverseCtx |
| crates/oxc_transformer_plugins/tests/integrations/replace_global_defines.rs | Adds test verification with AssertAst visitor and reuses updated scoping |
| crates/oxc/src/compiler.rs | Removes unnecessary scoping rebuild and reuses the updated scoping from the plugin |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Merge activity
|
6fbc69a to
5e0ab1b
Compare
fixes vitejs/rolldown-vite#446