preactjs/preact-www

Add list of APIs used by Preact

Open

#108 创建于 2017年3月14日

在 GitHub 查看
 (3 评论) (2 反应) (0 负责人)JavaScript (519 fork)github user discovery
enhancementhelp wanted

仓库指标

Star
 (380 star)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南