Matt-Esch / virtual-dom

A Virtual DOM and diffing algorithm
MIT License
11.65k stars 780 forks source link

Use without browserify #266

Open felipellrocha opened 9 years ago

felipellrocha commented 9 years ago

Hey guys! Anyway we can get a standalone version of virtual-dom?

Raynos commented 9 years ago

download https://github.com/Matt-Esch/virtual-dom/blob/master/dist/virtual-dom.js and put it somewhere; anywhere.

cristiano-belloni commented 9 years ago

@Raynos This is misleading, as that file points to 1.3.0. See #244

ghost commented 9 years ago

https://wzrd.in/standalone/virtual-dom@latest

husnoo commented 8 years ago

How do I use the standalone version?

  <body>
    <script src="virtual-dom.js"></script>
    <script src="main.js"></script>
  </body>
</html>

main.js: http://pastebin.com/1B0CfbuE

Error:

Hello!
main.js (line 5)
ReferenceError: require is not defined
var h = require('virtual-dom/h');
main.js (line 8, col 9)
husnoo commented 8 years ago

Never mind, figured it out. Replace the require bits with

var h = virtualDom.h;
var diff = virtualDom.diff;
var patch = virtualDom.patch;
var createElement = virtualDom.create;