preactjs/preact-www

Add list of APIs used by Preact

Open

#108 aperta il 14 mar 2017

Vedi su GitHub
 (3 commenti) (2 reazioni) (0 assegnatari)JavaScript (519 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (380 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

As suggested in developit/preact#585. Here's the list I came up with:

Browser APIs Preact Uses

  • It will use Promise only if available, falling back to setTimeout(0)
  • DOM APIs used are very minimal DOM core 1 / 2:
    • document.createElement() and document.createTextNode()
    • Text.prototype.nodeValue
    • Text.prototype.splitText - simply needs to exist (used as fast "is text node" check)
    • From Element.prototype:
      • .attributes NodeList
      • .setAttribute(), .getAttribute(), .removeAttribute()
      • .appendChild(), .insertBefore(), .replaceChild()

If you use SVG, createElementNS() and (get|set|remove)AttributeNS() are used.

Guida contributor