Getting started with Riot JS. We'll discuss riot's compile and mount process and build a small hello world component with simple data-binding.
[00:01] Riot.js is a micro framework. It's only three and a half kilobytes. With it you get custom tags, eventing, and rounding, that's all. Otherwise it just gets out of your way and lets you code. I was able to learn the entirety of Riot.js in about two days, one day to read the docs, and one day to write a small app. The ability to get started quickly, and for such a small size is why I think Riot could become a very popular framework.
[01:51] This is implied, so I don't have to write this.what, I can just write what. I'll add my file to my index file as a script of type = Riot/tag. You also have to explicitly mount any custom tag used outside of a .tag file. For example, here in the body of my index. You just say riot.mount and then you can pass a * if you want to mount every custom tag on the page, or you can pass in specific tags.
[02:27] Now I'm free to use my Hello World component in my index file. When I refresh, you'll see that we've successfully created a simple Riot component, complete with databinding and runtime compilation.