Skip to content

[reactive-element] Hybrid decorators #4144

@justinfagnani

Description

@justinfagnani

Make a single set of decorators that work in TypeScript with experimentalDecorators set to either true or false, and in Babel with version equal to "2023-05" by duck-typing the decorator arguments.

After this effort we will have one set of decorators that work under the following cases:

  1. TypeScript with experimentalDecorators: true and no accessor keyword
  2. TypeScript with experimentalDecorators: true and accessor keywords
  3. TypeScript with experimentalDecorators: false and accessor keywords
  4. Babel with experimentalDecorators: false and accessor keywords

The trade-off is that we have to have the same behavior in each configuration:

  • We can't skip reflection for initial property values
  • We have to wrap accessors as we can't detect the difference between auto-accessors and hand-written accessors with experimental decorators

Tasks:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions