-
-
Notifications
You must be signed in to change notification settings - Fork 720
refactor(transformer): Use to @babel/plugin-transform-explicit-resource-management
#12874
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
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. |
@babel/plugin-proposal-explicit-resource-management to @babel/plugin-transform-explicit-resource-management
CodSpeed Instrumentation Performance ReportMerging #12874 will not alter performanceComparing Summary
|
… to @babel/plugin-transform-explicit-resource-management Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
9b1e980 to
8738e3c
Compare
@babel/plugin-transform-explicit-resource-management
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should rename babel-plugin-proposal-explicit-resource-management to babel-plugin-transform-explicit-resource-management. This is the reason why oxc.snap misses 4 test cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot could you create another PR to fix it?
…nagement` test directory (#12894) Fixes missing test cases for explicit resource management by renaming the test directory to match the updated plugin name. ## Background PR #12874 updated references from the deprecated `@babel/plugin-proposal-explicit-resource-management` to the newer `@babel/plugin-transform-explicit-resource-management` package. However, the test directory under `tasks/transform_conformance/tests/` was not renamed, causing the test runner to miss 4 test cases. ## Issue The transform conformance test runner iterates through plugins defined in `constants.rs` and looks for test fixtures in directories matching the plugin names. Since the plugin name was updated to `babel-plugin-transform-explicit-resource-management` but the directory remained `babel-plugin-proposal-explicit-resource-management`, the test runner couldn't find the test cases. This resulted in 4 missing test cases in the `oxc.snap` file as noted by @Dunqing. ## Solution Renamed the test directory: ``` tasks/transform_conformance/tests/babel-plugin-proposal-explicit-resource-management/ → tasks/transform_conformance/tests/babel-plugin-transform-explicit-resource-management/ ``` ## Verification After the fix, running the transform conformance tests now correctly discovers and executes all 4 test cases: - export-class-name - for-of-no-block - function-with-scopes-in-params - try-catch The `oxc.snap` file now shows `babel-plugin-transform-explicit-resource-management (2/4)` indicating all 4 test cases are found (2 pass, 2 have implementation issues unrelated to this fix). Closes the follow-up issue identified in #12874. <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/oxc-project/oxc/issues/new?title=✨Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
This PR updates references from the deprecated
@babel/plugin-proposal-explicit-resource-managementto the newer@babel/plugin-transform-explicit-resource-managementpackage.Background
The
@babel/plugin-proposal-explicit-resource-managementpackage has been deprecated in favor of@babel/plugin-transform-explicit-resource-managementas the explicit resource management proposal has moved from experimental to stable status in the JavaScript specification.Changes Made
tasks/transform_conformance/src/constants.rsfrombabel-plugin-proposal-explicit-resource-managementtobabel-plugin-transform-explicit-resource-managementtasks/transform_conformance/package.jsonto use the new@babel/plugin-transform-explicit-resource-managementpackagecrates/oxc_transformer/src/proposals/explicit_resource_management.rsto reference the correct Babel plugin documentation URLsImpact
This change ensures that oxc stays current with the Babel ecosystem and avoids using deprecated packages.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.