3.0.9 • Published 10 years ago

ivd v3.0.9

Weekly downloads
3
License
ISC
Repository
github
Last release
10 years ago

Immutable virtual dom is a library that enables you to create templates that are static. The added benefit of this is that there are fewer moving parts, and you end up with a template engine that's a wee-bit more native than other dynamic virtual dom libraries. I.e: it's faster.

The only downside to this is that you don't have the added benefit of adding/removing elements around dynamically - creating complex UIs. Once you're template is compiled, you can only mutate the elements that you specified as dynamic.

Good news is that 99.9999% of web-apps don't need complex UIs, and the small edge cases where you might can easily be worked with.

Here's an example:

var ivd      = require("immutable-virtual-dom");
var element  = ivd.element;
var text     = ivd.text;
var dynamic  = ivd.dynamic;
var fragment = ivd.fragment;
var template = ivd.template;

// create the virtual DOM
var tpl = template(fragment(text("Hello"), dynamic(text(), function(ref, options) {
  this.update = function(context) {
    ref.nodeValue = context;
  };
})));

var view = tpl.view();

// render the container first before updating
document.body.appendChild(view.render());

// update the container data after initialization. Important you do this
// after adding the container to the DOM.
view.update({ name: "jake" });

Goals

  • Decoupled from any platform. Should work on the server, browser, and native devices (possibly native ivd in the future).
  • Interoperable with other rendering methods. SVG, canvas, HTML should all be definable within the same template.
  • Ability to change rendering engine on the fly.
  • Should work with pre-existing template engines such as mustache, handlebars, and jade.
  • Very few moving parts. Should leverage existing native APIs for speed such as cloneNode().
  • Not too inventive. Use existing specs & APIs.
3.0.9

10 years ago

3.0.8

10 years ago

3.0.7

10 years ago

3.0.6

10 years ago

3.0.5

10 years ago

3.0.4

10 years ago

3.0.3

10 years ago

3.0.2

10 years ago

3.0.1

10 years ago

3.0.0

10 years ago

2.0.13

10 years ago

2.0.12

10 years ago

2.0.11

10 years ago

2.0.10

10 years ago

2.0.9

10 years ago

2.0.8

10 years ago

2.0.7

10 years ago

2.0.6

10 years ago

2.0.5

10 years ago

2.0.4

10 years ago

2.0.3

10 years ago

2.0.2

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago