preactjs/preact-www

Add list of APIs used by Preact

Open

#108 opened on Mar 14, 2017

View on GitHub
 (3 comments) (2 reactions) (0 assignees)JavaScript (519 forks)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (380 stars)
PR merge metrics
 (PR metrics pending)

Description

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.

Contributor guide