Skip to content

damusix/riot-vs-vue

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
vue
 
 
 
 
 
 
 
 

Riot vs Vue

A side by side comparison with examples.


For an "fair and balanced" comparison, lets see what everyone else is saying about the subject, and then we'll get down to real experiments.

Articles:
What came first?
Which is more popular?
Unbiased Pros for Both
  • Minimal learning curve
  • Small API
  • Templating very HTML / XHTML / XML like
  • Tiny library when gzipped in comparison to major players
  • Good documentation
  • IDE syntax highlighter for Sublime / Textmate / Atom
  • Plays well with other libraries, like jQuery
  • Good utilities
  • Debugging tools

Side by side

RiotJS

PROS:
  • Implements regular HTML in tags, and uses known HTML attributes for event binding
  • Semantic HTML attributes (each, if, show, etc)
  • Simpler to learn/implement than all other frameworks
  • Minimal DOM operations
  • Built-in preprocessors for CoffeeScript, ES6 (Babel), TypeScript, LiveScript and Jade
  • Scoped CSS inside components
  • Under 11KB gzipped
  • Fast rendering
  • Doesn't assume things about your workflow
  • Router is optional
  • RiotControl as a state manager / Observable can be used as state manager
  • Riot animore (transition effect systems) is optional
  • Tiny learning curve
    • 1 day if you know HTML, CSS, and JS
    • Faster to learn vs all other frameworks
CONS:
  • Not as popular as competing frameworks

Workflow without preprocessor:

<app></app>

<script type="riot/tag">
    <app>
        {{message}}
    </app>

    var self = this;
    self.root.onclick = function() {

        var name = prompt('What is your name?');
        self.message = 'Hello ' + name;

        self.update();
    }
</script>

<script>
    var riot.mount('app', {

        message: 'Hello Riot!'

    });
</script>

Workflow using processed .tag files

<app>
    {{ message }}

    <style>

        :scope {
            color: red;
        }
    </style>

    <script>

        var self = this;
        self.root.onclick = function() {

            var name = prompt('What is your name?');
            self.message = 'Hello ' + name;
        }

        self.update();
    </script>
</app>

VueJS

PROS:
  • Large community support (Laravel)
  • Bigger names behind it
  • Built-in transition effect system
  • Built-in state manager
  • Sophisticated router
  • Official support and tooling
  • Similar to Angular, but simpler and smaller
  • More sophisticated debugging tools vs Riot
  • Under 20kb gzipped
  • Slightly Faster rendering vs Riot
CONS:
  • Larger API than Riot
  • Similar to Angular, lol
  • Vue-specific directives/attributes (v-for, v-on:click, v-if, etc)
  • Assumes things about your workflow (hot reload, state control, router, animations)
  • Steeper learning curve vs RiotJS
    • Still seems a bit easier than Angular / React

Workflow without preprocessor:

<div id="app" v-on:click='askName'>
    {{ message }}
</div>

<script>
    var app = new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue!'
        },
        methods: {
            askName: function(e) {

                var name = prompt('What is your name?');
                this.message = 'Hello ' + name;
            }
        }
    });
</script>

Workflow using processed .vue tag files

<template>
    <p v-on:click='askName'>{{ message }}</p>
</template>

<script>
    var app = new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue!'
        },
        methods: {
            askName: function(e) {

                var name = prompt('What is your name?');
                this.message = 'Hello ' + name;
            }
        }
    });
</script>

<style scoped>

    #app {
        color: red;
    }
</style>

Checkout a Todo MVC

Getting Started:

npm install

To see the examples, run npm start

Riot example is found at locahost:8080/riot Vue example is found at locahost:8080/vue

About

I'm clearly biased in favor of Riot. Not sorry.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published