GitXplorerGitXplorer
l

basic-virtual-dom

public
13 stars
4 forks
1 issues

Commits

List of commits on branch master.
Verified
aca71fe8c735f57297eb87adcd1a28627ccffed9

Merge pull request #2 from 0x7130/master

llinuxenko committed 3 years ago
Unverified
123479954a0529fc058caa323bffca27f7b0f1dd

zero props element bug fix

committed 3 years ago
Verified
3874ea1a0c06a2a7ee4b1b3e0106cd4d68c3141d

Update README.md

llinuxenko committed 5 years ago
Unverified
80a933bf9ae03906b6cbb6ccdee0d4f4695c0d66

Update README.md

llinuxenko committed 7 years ago
Verified
b5c8633cb5c906cdd79e703490c2e85631da4d98

Useless .call() removed

llinuxenko committed 8 years ago
Verified
211a668ddc6756718e107c9ff1fe64ef3871f5e5

Update components props fix

llinuxenko committed 8 years ago

README

The README file for this repository.

Very basic virtual-dom implementation

Build Status Coverage Status dependencies alpha npm version

Features

Support of following patch types:

  • PATCH_CREATE
  • PATCH_REMOVE
  • PATCH_REORDER
  • PATCH_PROPS
  • Small amount of diffing iterations
  • Referal based patches without identifiers
  • No iterations over the virtual or dom tree when applying patches

Seems like it has not so bad memory usage and rendering performance

Example

Example

Simple day countdown example

/** @jsx h */

import {h, patch, diff} from '../../';

var initialDom = (
  <div>
    <div><h3>Counter</h3></div>
  </div>
);

document.getElementById('application')
  .appendChild(initialDom.render());

setInterval(function() {
  var cd = countDown();
  var countDownDom = (
    <div>
      <div><h3>Day Countdown</h3></div>
      <div className="clock">
        <strong>{cd.h}</strong> :&nbsp;
        <strong>{cd.m}</strong> :&nbsp;
        <strong>{cd.s}</strong>
      </div>
    </div>
  );

  var diffs = diff(initialDom, countDownDom);
  patch(initialDom, diffs);

}, 1000);

TODO

  • test browser support

License

MIT (c) Svetlana Linuxenko