LoginSignup
5

More than 5 years have passed since last update.

Matt-Esch/virtual-dom を変換する npm package

Posted at

概要

Matt-Esch/virtual-dom を HTML や DOM と相互変換する npm package についてまとめた。公式の Wiki にも書いてあるが、分類が怪しかったので実装を確認しながら補足した。

キーワード

  • VDOM は VTree / VNode / VText のオブジェクト
  • DOM は Node / Element のオブジェクト
  • HTML は HTML 形式の文字列
  • hyperscript は hyperscript 形式の文字列
  • DOMParser は DOM Parsing and Serialization で仕様化されているもの。文字列→ DOM変換ができる。

一覧

VDOM -> DOM

VDOM -> HTML

DOM -> VDOM

HTML -> VDOM

DOM -> hyperscript

HTML -> hyperscript

補足

この記事は以前 Gist に個人用途で書いたものの転載だ。Gist じゃ活用されなさそうなので。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5