Repository navigation
Conversation
Contributor
Merging this PR will not alter performanceWarning oxc-project has exceeded the Hobby plan limit of 5 active contributors. Upgrade your plan or apply to the open source program by December 8, 2026 to keep using CodSpeed.
Comparing Footnotes
|
Dunqing
force-pushed
the
decorators-lowering
branch
from
November 6, 2026 07:47
5ade138 to
b61c5a0
Compare
5 of 8 tasks
Dunqing
force-pushed
the
decorators-lowering
branch
2 times, most recently
from
November 11, 2026 00:44
b0e34e4 to
2023d40
Compare
This was referenced Nov 11, 2026
Dunqing
force-pushed
the
decorators-lowering
branch
7 times, most recently
from
November 12, 2026 02:28
5107a9b to
9514c86
Compare
Dunqing
force-pushed
the
decorators-lowering
branch
from
November 12, 2026 17:05
7c98aec to
83f5e02
Compare
Dunqing
changed the base branch from
decorators-test-infra
to
graphite-base/28882
November 13, 2026 16:36
This was referenced Nov 13, 2026
Dunqing
force-pushed
the
decorators-lowering
branch
from
November 13, 2026 16:38
f42988c to
c5ed32c
Compare
Dunqing
changed the base branch from
graphite-base/28882
to
decorators-test-infra
November 13, 2026 16:38
This was referenced Nov 17, 2026
Dunqing
force-pushed
the
decorators-lowering
branch
from
November 19, 2026 03:28
a2282f8 to
14ac79b
Compare
Dunqing
force-pushed
the
decorators-lowering
branch
2 times, most recently
from
November 19, 2026 15:55
979e186 to
ce150dc
Compare
Dunqing
force-pushed
the
decorators-lowering
branch
from
November 19, 2026 16:00
ce150dc to
729cf68
Compare
Dunqing
force-pushed
the
decorators-lowering
branch
2 times, most recently
from
November 20, 2026 00:09
d631584 to
cbcdc72
Compare
Dunqing
force-pushed
the
decorators-lowering
branch
from
November 20, 2026 08:28
cbcdc72 to
c7d11b3
Compare
Dunqing
force-pushed
the
decorators-lowering
branch
from
November 23, 2026 06:40
c7d11b3 to
d57e2df
Compare
Dunqing
force-pushed
the
decorators-lowering
branch
2 times, most recently
from
November 24, 2026 01:03
889244c to
66ef37a
Compare
…get is set
Lower standard decorators and auto-accessors by default at any concrete
target; `decorator: { lower: false }` keeps them. Programs without
decorators or `accessor` skip the work, using a flag recorded by
`oxc_semantic`. Add `DecoratorOptions::transforms_decorators` so callers
can tell whether a program needs decorator lowering.
BREAKING CHANGE: with a concrete target, standard decorators and
auto-accessors are now lowered by default.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack 4/4 for standard (TC39 2023-11) decorators. This PR lowers no new syntax; it decides when the lowering from #29749, #29750 and #29751 runs. That is now by default at any concrete target, instead of only with
decorator: { lower: true }.target: "es2022"(or engine versions), nodecoratoroption@decandaccessorkeptesnextdecorator: { lower: false }decorator: { legacy: true }Breaking change: with a concrete target (an ES edition, engine versions, or a mix), standard decorators and auto-accessors are now lowered by default. In
Runtimehelper mode, the output importsdecoratorStart,decorateElement,runInitializers,decoratorMetadata,decoratorKeyandsetClassNamefrom@oxc-project/runtime(added in #29447).This also adds
DecoratorOptions::transforms_decorators(env, scoping): callers that skip the transformer whenEnvOptions::lowers_syntax()(#30251) isfalsecan ask whether a program still needs it for decorators oraccessorproperties, from the same decisionTransformer::build_with_scopinguses.Cost
With the new default, every concrete target would run class-properties on every class, statement and expression.
SemanticBuilder, which visits every node anyway, now records whether the program has a decorator or anaccessorproperty; without one, the transformer builds the same transforms as before.@in comments, strings or CSS templates andaccessoras an identifier don't count.Transform-only instruction counts (callgrind) for files without decorators, compared with main:
Below es2022, where main already runs class-properties, the cost comes from #29749, #29750 and #29751; this PR itself is 0.1% to 0.5% cheaper than #29751 at every target. A file with at least one decorator or
accessortakes the full path, so class-properties' hooks run on every node of that file. With one class appended that has a decorated method and a decoratedaccessor,es2022costs +9.4% (App.tsx), +6.6% (checker.ts) and +18.6% (react.development.js) compared with main, which leaves that syntax in place.cargo allocssnapshots are unchanged.Transformer and semantic tests, transform conformance with execution, napi tests and full coverage pass. Compared with #29751, conformance differs only in Oxc execution, 453 → 457/459, from this PR's fixtures. The Test262 runtime suite passes 17453/18403 against main's 17430: 22 decorator and
accessorsyntax tests now pass, and the remaining difference is a timeout flake in main's snapshot.Follow-ups that don't block the stack are tracked in #30265.
Depends on #29751. Part of #9170.
AI disclosure: implemented and described with AI assistance; this revision was written with Claude Code (Claude Opus 5.5; reasoning effort not recorded).