You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rfcs/NNNN-decorator-roadmap.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -30,11 +30,11 @@ Migrate to using standard decorators as the only decorator implementation and un
30
30
31
31
As [standard decorators](https://github.com/tc39/proposal-decorators) are starting to ship in [compilers](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#decorators) and soon in VMs, we need to prepare for migrating Lit to use them.
32
32
33
-
Standard decorators will allow us to unify our surface syntax which is currently different in plain JS and compiled sources using TypeScript or Babel. This will let us use decorators as the one way of declaring reactive properties, instead of also offering the `static properties` feature. Removing `static properties` in turn lets us remove the infrastructure for dynamically creating reactive properties, simplifying ReactiveElement.
33
+
Standard decorators will allow us to unify our surface syntax which is currently different in plain JS and compiled sources using TypeScript or Babel. This will let us eventually use decorators as the one way of declaring reactive properties, instead of also offering the `static properties` feature. Removing `static properties` in turn lets us remove the infrastructure for dynamically creating reactive properties, simplifying ReactiveElement.
34
34
35
35
## Detailed Design
36
36
37
-
Detailed design of the new decorators should be covered in another RFC. This RFC focuses on:
37
+
Detailed design of the new decorators should be covered in pull requests and reviews, given that they follow the constraints in this RFC. This RFC focuses on:
38
38
39
39
- That standard decorators become the only way to declare reactive properties
40
40
- That breaking changes are made to remove support for dynamically adding reactive properties, since that will not be used by the new decorators
@@ -101,7 +101,7 @@ class MyElement extends LitElement {
101
101
}
102
102
```
103
103
104
-
### Changes in behavior possible with standard decorators
104
+
### Potential and required changes in behavior with standard decorators
105
105
106
106
We intend to keep the new standard decorators implementations mostly compatible with the existing legacy decorators, but the new decorator standard does force us or allow us to make some breaking changes in behavior.
107
107
@@ -113,7 +113,7 @@ As mention already, the `accessor` keyword will be required for all formerly fie
113
113
114
114
The new decorator spec passes field and accessor initial values through a separate callback from `set()`. This allows us to know when we are receiving an initial value and not reflect it to an attribute. This is part of a [long-standing issue](https://github.com/lit/lit/issues/1476) where we would like to not create any attributes spontaneously on an element.
115
115
116
-
We will _not_ do this, as it will make migrating more challenging.
116
+
We will _not_ do this initially, as it will make migrating more challenging. We will instead open another RFC on how to opt out of initial value reflection for both experimental and standard decorators.
117
117
118
118
#### Restoring default property values when attributes are removed
0 commit comments