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
Lit 3.0 added support for standard decorators. While, the choice between TypeScript experimental decorators and standard decorators is a local choice - components and libraries built with one work with the other - it is impossible to mix decorator types in a single compilation unit. One component has to use all experimental or all standard decorators.
This means that someone can't mix @watch(), @debounce(), or @defaultValue() with standard decorators. It also means that those decorators might be written in a way that difficult to port to standard decorators due to its more restrictive API with regards to class access and mutation. Making the decorators work with both specs could then be good future-proofing to limit breaking changes.
In Lit we made the same decorators work with both specs by duck-typing the arguments to the decorator functions, and tested by having two tsconfigs for the tests. This should be doable within your build script.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Lit 3.0 added support for standard decorators. While, the choice between TypeScript experimental decorators and standard decorators is a local choice - components and libraries built with one work with the other - it is impossible to mix decorator types in a single compilation unit. One component has to use all experimental or all standard decorators.
This means that someone can't mix
@watch()
,@debounce()
, or@defaultValue()
with standard decorators. It also means that those decorators might be written in a way that difficult to port to standard decorators due to its more restrictive API with regards to class access and mutation. Making the decorators work with both specs could then be good future-proofing to limit breaking changes.In Lit we made the same decorators work with both specs by duck-typing the arguments to the decorator functions, and tested by having two tsconfigs for the tests. This should be doable within your build script.
Beta Was this translation helpful? Give feedback.
All reactions