riot/riotify

Support riot 2.0.5

Closed this issue · 4 comments

Since riot 2.0.5, the compiler can be called programmatically.

For instance:

var compiler = require('riot/compiler/compiler')

compiler(riot_tag) // where `riot_tag` is the contents of a `.tag` file.

And so it can be used like a normal transform.

I recommend using browserify-transform-tools for simpler code.

This seems to work if you'd like to get inspired. https://github.com/compose-ui/riotify

I didn't want to rewrite all your code. I'd much rather have just one source for a riotify package :) (yours ideally, since you instigated this)

The API changed in 2.0.7, so this is outdated.

I've also considered browserify-transform-tools, but I don't see any benefit over doing it manually. I might be a slow learner though 😺

Thank you anyway.

The issue with the current way is that you need 2 commands to get your bundle? I'm not sure, but that's what the readme seems to say.

With the other technique (using riot's compiler's Node API), then you can do it in a single step. One command or just one entry in your package.json's 'browserify' property.

No, you only need one command, but there's two ways to do the same thing. I will update the README to make that more obvious.