Stencil: docs: missing docs for various features

Created on 14 Jul 2018  路  6Comments  路  Source: ionic-team/stencil

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 options

@Component() options

  • how does styleUrls 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'
  }
})

Special Class methods

  /**
   * 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
      }
    };
  }

ShadowDOM

  • what will happen in non nativeShadow DOM browsers if component uses 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 own

Expected behavior:

  • document all public API and guides mentioned above

related: https://github.com/ionic-team/stencil/issues/891

documentation needed help wanted

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? 馃馃樁

All 6 comments

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!!

Was this page helpful?
0 / 5 - 0 ratings