Thanks to visit codestin.com
Credit goes to github.com

Skip to content

transformer: ecma decorators #9170

@Boshen

Description

@Boshen

https://github.com/tc39/proposal-decorators?tab=readme-ov-file#how-should-i-use-decorators-in-transpilers-today

esbuild: evanw/esbuild#3754
babel: https://babel.dev/docs/babel-plugin-proposal-decorators#versiont
tsc: https://devblogs.microsoft.com/typescript/announcing-typescript-5-0/#decorators

The conformance suite we should follow is tc39/test262#4103, it should be ready in a month or two, we should help out and provide feedback to it.

I talked to pzuraq (decorators champion), we agree to defer implementing legacy if possible, but actual real world usage require us to implement legacy decorators first (for rolldown).


EDIT: The legacy decorator and metadata emitter have already been supported for a while.

Important

We are going to hold off on implementing decorators for now.

Implementing transform for decorators requires a huge amount of work.
The spec was updated multiple times since it reached stage 3. The implementation in the engines is still in progress and other changes may be introduced during the process.
We currently don't have the bandwidth to catch up with the spec changes, which otherwise would make the ecosystem fragmented.

We will revisit once we are confident that the spec is stable or have a bandwidth to catch up.

See tc39/test262#4042 for the progress on the standard side

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-transformerArea - Transformer / TranspilerC-enhancementCategory - New feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions