-
Notifications
You must be signed in to change notification settings - Fork 819
Closed
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within Stencil
Description
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
2.19.0
Current Behavior
If a property is decorated with both @State and another decorator, the code for the other decorator will never be invoked.
In the following component nothing will be logged to the console with Stencil 2.19.0. It works perfectly in 2.18.1. Probably introduced in #3614
const MyDecorator: () => PropertyDecorator = () => {
return (target: Object, propertyKey: string) => {
console.log({target, propertyKey});
};
};
@Component({
tag: 'my-component',
shadow: true,
})
export class MyComponent {
@State()
@MyDecorator()
decoratedProp: any;
}After inspecting the compiled javascript files, the TypeScript __decorate helper function is missing for the component in 2.19.0, and is present in 2.18.1
Expected Behavior
Decorators added to properties also decorated with @State should be invoked
Steps to Reproduce
Create a new component with a property decorated with both @State and something else. The other decorator will not work
Code Reproduction URL
https://github.com/jgroth/stencil-decorator-bug
Additional Information
No response
Kiarokh, mjlime, FredrikWallstrom, jensgustafsson, BregenzerK and 13 more
Metadata
Metadata
Assignees
Labels
Bug: ValidatedThis PR or Issue is verified to be a bug within StencilThis PR or Issue is verified to be a bug within Stencil