ractify

browserify 2 + precompiled Ractive.js components

npm install ractify
9 downloads in the last week
63 downloads in the last month

Ractify

Browserify 2 + ractive.js

Upgrading to v0.3.0

Rather than just return the parse from Ractive, ractify now parses a full Ractive html component with optional style and script blocks. See this issue

As a result the usage changes slightly, but makes it much cleaner to create reusable Ractive-based components.

See test input and output for an example.

Installation

Ractify does not install Ractive on its own, you must do so yourself (this allows you to update Ractive without an update to ractify).

Example:

npm install --save ractify
npm install --save ractive@0.4.0-pre1

Usage / Examples

Browserify API usage:

var browserify = require('browserify')
var ractify = require('ractify')

var bundle = browserify()
bundle.transform(ractify)

In your Client-side JavaScript, require('ractify') and it'll import the runtime-only version of ractive. require a .ract file, and ractify will parse it and export the Component:

var Foo = require('./views/foo.ract')
var foo = new Foo({
    el: document.getElementById("foo"),
    data: ...
})

Commandline Browserify usage:

$ browserify -t ractify main.js > bundle.js

License

Open source software under the zlib license.

npm loves you