Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(decorators): update decorator types @W-16373548@ (#4429)
* chore: hushsky * feat(wire): ensure prop type matches adapter value * fix(wire): account for reactive prop replacement * feat(wire): drop experimental decorator signature * refactor(api): only support modern decorators also, only allow @api on LightningElement classes * refactor(track): only support modern decorators also, only allow on LightningElements * refactor(wire): only support modern decorators also, only allow on LightningElements * refactor(integration-types): remove tests for experimental decorators * docs: add comment explaining assertions * refactor(playground): remove experimental decorator support * refactor(integration-types): split decorator tests into multiple files one file per decorator * refactor(track): make function signature work as decorator and non-decorator * refactor(wire): allow values to be undefined * test(wire): expand type validations * docs: simplify comment * test(wire): expand type validations * feat(wire): properly type reactive values * test(wire): expand type validations * test(decorators): validate type error when used on non-components * refactor(wire): method param is never explicit undefined * test(wire): split type validations into separate classes * refactor(wire): @wire cannot be used on getters/setters * test(wire): validate that nested props are not reactive * fix(test): use correct context type * docs: clarify comment * revert(track): check arguments instead of undefined * test(wire): validate wire doesn't work on non-component with superclass * fix(wire): make wire work with adapters typed as `any` * test(types): assert decorators don't work on non-LightningElement classes * refactor(wire): remove type error if extending a non-component TypeScript can't differentiate between a class without a superclass and a class that extends `any`. Because extending `any` is probably a fairly common use case (e.g. base components without a type stub), we need to allow it, at the cost of also allowing non-extended classes. * feat(wire): update signature to allow decorating getters/setters * docs(wire): add comments to decorator type * refactor(wire): update type def to always split on "." runtime behavior is to use "." as a delimiter, never as part of the property key * test(wire): update type validations for prop/method decorators * test(wire): add type validations for decorated getters * test(wire): add type validations for decorated setters * feat(wire): allow undefined in wired getter * refactor(decorators): relax type constraint restricting to LightningElement Components could extend a superclass typed as `any` * chore(decorators): remove useless generic type param * docs(test): clarify use of nested.prop * chore: prettier
- Loading branch information