minui / docs

Documentation and general communication space
1 stars 0 forks source link

Using custom elements: guidelines #3

Open ronkorving opened 8 years ago

ronkorving commented 8 years ago

Based on my first proof of concepts (see my cute tab-system), I've concluded the following. Written as a guideline, but of course up for debate.

Guidelines for custom element development

Creation callbacks happen parent-first. If during a parent's callback phase, you need to manipulate or read from child elements, you cannot use their custom APIs yet. During creation, you can however use your own API safely. To create a consistent code-style and to ensure the above issue does not arise, the following rules must be followed:

ronkorving commented 8 years ago

One thing I wonder about is if moving structure augmentation (the first bullet point up there) to attachedCallback would make more sense (or less)...