So after a long time I came back to skim stencil docs, and again got confused by undocumented behaviors. This issue is a report of things that I didn't find answer to within the docs or just got confused by missing explanation :)
@Prop optionsconnect option do? https://github.com/ionic-team/stencil/blob/bcc579ae9ad40e0a5737d31832141185e57fbf7a/src/declarations/decorators.ts#L30@Prop({ connect: 'ion-menu-controller' }) lazyMenuCtrl: Lazy<MenuController>;
? reflectToAttr: true how will casing work here ? ( I assume camelCase -> dash-case )@Watch or within componentWillUpdate LC hook?context docs to prop + reference to Context guide@Component() optionsstyleUrls object resolution work ?@Component({
tag: 'ion-something',
// this will be loaded by default
styleUrl: 'something.scss',
// how does following work ?
styleUrls: {
ios: 'something.ios.scss',
md: 'something.md.scss',
wp: 'something.wp.scss'
}
})
hostData from style-guide chapter /**
* 11. hostData() function
* Used to dynamically set host element attributes.
* Should be placed directly above render()
*/
hostData() {
return {
attribute: 'navigation',
side: this.isRightSide ? 'right' : 'left',
type: this.type,
class: {
'something-is-animating': this.isAnimating
}
};
}
this.el.shadowRoot.querySelector() for getting data imperatively within stencil component? Will it be transformed in runtime as fallback with CSS or it will throw and error and user is responsible to handle this on his ownExpected behavior:
Any assistance with improving the docs would be appreciated. The repo can be found here: https://github.com/ionic-team/stencil-site
I would love to contribute to the docs, but how could I, when I don't have answers to all questions that I've asked? 馃馃樁
For those coming after me wondering how styleUrls work, I found this blogpost to be helpful.
I'm a bit amazed that the .d.ts files don't include documentation. Having jsdocs on these declarations would go a long way towards an in-IDE reference.
Some more information on PropOptions for context. Couldn鈥檛 find anything on PropOptions for attr and connect though.
Context and connect were not documented for good reason, in stencil one are finally deprecated!!
Most helpful comment
I would love to contribute to the docs, but how could I, when I don't have answers to all questions that I've asked? 馃馃樁