The Angular Language Service is not able to type-check or show jsdocs for input properties. This is because of a limitation of how the Angular Language Service works: https://github.com/angular/angular/issues/48056.
What is the new behavior?
Angular is able to verifty types on input properties and show jsDocs:
Does this introduce a breaking change?
[ ] Yes
[x] No
Feature is hidden behind experimental flag, inlineProperties.
I have tested the code on both the example component-library and our own internal design system (which has about 70 components), but there might be some unkown edge cases.
Other information
Ideally this would be solved by the Angular team, but it has been an open problem for years.
If this MR goes through it is easy to extend the code to support types/jsDocs for output properties as well. The method used to create the correct property declerations are a lot simpler than the current method used to create EventEmitters today, and I believe more robust. The current implementation fails on Array, Promises, functions or when multiple Interfaces shares the same name in the project (such as Color in the example component-library). The method used in this MR to create the input proprties does not require any additional import statements either.
Pull request checklist
Please check if your PR fulfills the following requirements:
npm run build
) was run locally for affected output targetsnpm test
) were run locally and passednpm run prettier
) was run locally and passedPull request type
Please check the type of change your PR introduces:
(I would call this a feature, but it has been reported as a bug)
What is the current behavior?
Issue URL: https://github.com/ionic-team/stencil/issues/2909
The Angular Language Service is not able to type-check or show jsdocs for input properties. This is because of a limitation of how the Angular Language Service works: https://github.com/angular/angular/issues/48056.
What is the new behavior?
Angular is able to verifty types on input properties and show jsDocs:
Does this introduce a breaking change?
Feature is hidden behind experimental flag,
inlineProperties
.I have tested the code on both the example component-library and our own internal design system (which has about 70 components), but there might be some unkown edge cases.
Other information
Ideally this would be solved by the Angular team, but it has been an open problem for years.
If this MR goes through it is easy to extend the code to support types/jsDocs for output properties as well. The method used to create the correct property declerations are a lot simpler than the current method used to create EventEmitters today, and I believe more robust. The current implementation fails on Array, Promises, functions or when multiple Interfaces shares the same name in the project (such as
Color
in the example component-library). The method used in this MR to create the input proprties does not require any additional import statements either.