[reactive-element] 3.0 hybrid decorators#4140
Conversation
🦋 Changeset detectedLatest commit: 940151b The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Tachometer Benchmark ResultsSummarynop-update
render
update
update-reflect
Resultsthis-change
render
update
update-reflect
this-change, tip-of-tree, previous-release
render
update
nop-update
this-change, tip-of-tree, previous-release
render
update
this-change, tip-of-tree, previous-release
render
update
update-reflect
|
|
The size of lit-html.js and lit-core.min.js are as expected. |
d38782a to
2be0a12
Compare
8a524f1 to
139430c
Compare
packages/reactive-element/src/legacy-decorators/query-assigned-nodes.ts
Outdated
Show resolved
Hide resolved
packages/reactive-element/src/legacy-decorators/query-assigned-nodes.ts
Outdated
Show resolved
Hide resolved
packages/reactive-element/src/legacy-decorators/event-options.ts
Outdated
Show resolved
Hide resolved
AndrewJakubowicz
left a comment
There was a problem hiding this comment.
Nice!!! – all comments are non blocking nits
| const legacyProperty = ( | ||
| options: PropertyDeclaration, | ||
| options: PropertyDeclaration | undefined, | ||
| proto: Object, |
There was a problem hiding this comment.
i know this is already merged but should we use object rather than Object here?
There was a problem hiding this comment.
It's ultimately not that helpful of a type, but it's Object the because the prototype extends from Object the value.
| ) | ||
| : legacyProperty( | ||
| options, | ||
| protoOrTarget as Object, |
Part of #4144
Make a single set of decorators that work in TypeScript with
experimentalDecoratorsset to either true or false, and in Babel withversionequal to "2023-05" (not working because of lack of metadata). This works by duck-typing the decorator arguments.After this effort we will have one set of decorators that work under the following cases:
experimentalDecorators: trueand no accessor keywordexperimentalDecorators: trueand accessor keywordsexperimentalDecorators: falseand accessor keywordsexperimentalDecorators: falseand accessor keywordsThe trade-off is that we have to have the same behavior in each configuration:
Tasks:
experimentalDecorators: falseand pass the std-decorators testsexperimentalDecorators: true.noAccessor: truein all casescreatePropertyandgetPropertyDescriptor