visdom

1.0.0-beta.3 • Public • Published

visdom

Another virtual DOM library for JavaScript made with focus on simplicity, functional programming and a modular architecture.

WORK IN PROGRESS.

Usage

const el = require('visdom/lib/createVNode');
const diff = require('visdom/lib/diff');
const toVNode = require('visdom/lib/dom/toVNode');
const patch = require('visdom/lib/dom/patch');

const container = document.querySelector('#app');
const prevVnode = toVNode(container);
const nextVnode = el('div', { id: 'app' }, 'Hello, world!');
const patches = diff(prevVnode, nextVnode);

patch(container, patches);

Motivation

  • To be a tool for DOM diffing and patching that allows for a clean separation between the following environments (no shared code unless needed):

    • browser (toVNode, patch)
    • server (createVNode, toNodeHtml)
    • web worker (createVNode, diff)
  • Inspired by React, virtual-dom, snabbdom.

TODOs

  • [x] Extract example to its own GitHub repository.
  • [ ] Lifecycle hooks.
  • [ ] Improve error handling and provide warnings.
  • [ ] Improve documentation.
  • [x] Make available via npm install visdom.

Readme

Keywords

none

Package Sidebar

Install

npm i visdom

Weekly Downloads

1

Version

1.0.0-beta.3

License

ISC

Last publish

Collaborators

  • mariuslundgard