fix(transformer/legacy-decorator): abstract class doesn't work in metadata#10952
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. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue in the legacy decorator transformation for abstract classes by updating type checks and ensuring proper metadata handling.
- Updated conditional checks in both decorator and metadata modules to use the new "declare" property.
- Adjusted test fixtures and updated snapshots to verify the correct behavior of abstract classes.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/abstrct-class/output.ts | Transpiled output for abstract class metadata handling |
| tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/abstrct-class/input.ts | Input fixture using abstract class syntax with legacy decorators |
| tasks/transform_conformance/snapshots/oxc.snap.md | Updated snapshot to reflect changes in metadata processing |
| crates/oxc_transformer/src/decorator/legacy/mod.rs | Adjusted class check condition to include "class.declare" |
| crates/oxc_transformer/src/decorator/legacy/metadata.rs | Modified metadata processing condition to use "class.declare" |
Comments suppressed due to low confidence (3)
tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/abstrct-class/input.ts:1
- [nitpick] Consider renaming the test fixture directory/file from 'abstrct-class' to 'abstract-class' for clarity, unless the current naming is intentional for legacy support.
import { dce, type Dependency } from "mod";
crates/oxc_transformer/src/decorator/legacy/mod.rs:811
- Verify that using 'class.declare' appropriately replaces 'class.is_typescript_syntax()' to correctly identify abstract classes, ensuring the legacy decorators metadata transformation works as intended.
if class.is_expression() || class.declare {
crates/oxc_transformer/src/decorator/legacy/metadata.rs:110
- Confirm that the change to use 'class.declare' in lieu of 'class.is_typescript_syntax()' captures the intended cases for abstract classes in metadata processing. Consider if both properties should be checked if their semantics differ.
if class.is_expression() || class.declare {
CodSpeed Instrumentation Performance ReportMerging #10952 will not alter performanceComparing Summary
|
...nsform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/abstrct-class/input.ts
Outdated
Show resolved
Hide resolved
e959420 to
a15b652
Compare
Merge activity
|
a15b652 to
a39eb85
Compare

close: #10926