Skip to content

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Oct 15, 2025

Copilot AI review requested due to automatic review settings October 15, 2025 05:17
@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 15, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added the C-bug Category - Bug label Oct 15, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Oct 15, 2025
Copy link
Member Author

Boshen commented Oct 15, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 10-15-fix_tranformer_plugins_define_plugin_need_to_add_reference_to_scoping branch from 6fbc69a to 5e0ab1b Compare October 15, 2025 05:23
@graphite-app graphite-app bot merged commit 5e0ab1b into main Oct 15, 2025
20 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Oct 15, 2025
@graphite-app graphite-app bot deleted the 10-15-fix_tranformer_plugins_define_plugin_need_to_add_reference_to_scoping branch October 15, 2025 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic in v7.1.16 when building project with nullish coalescing operators

2 participants