This version uses the Rails asset pipeline, plain ES5 JavaScript, the jQuery that ships with Rails, and Vue.js to make componentization much simpler.
Less than 1 minute using vuejs-templates/simple as a reference.
Just launch Rails normally:
rails server
- (Almost) zero setup: Beyond our one JS file, we also add a dependency in our application layout and add a line to
application.js(there's also avuejs-railsgem for simple asset pipeline integration) - Plain ES5: no Babel or CoffeeScript required, though CoffeeScript support also comes out of the box
- Progressive: The parts of the app that have to be smart are, but everything else is just regular HTML
- Really simple scoping: No extra classes, just custom elements
- Plays well with jQuery: If you have existing UI controlled by jQuery, Vue won't freak out and break like React does
- jQuery UJS: Rails' builtin jQuery UJS automatically sends the authenticity token in the header of jQuery's web requests
- Less thinking: Using a simple component framework, there's a clear place for everything and a clear strategy for tackling any problem
- Minimized boilerplate: The template reads easily and clearly describes what the component does, even for people who don't understand JavaScript
- Still kinda ugly HTML: No HTML syntax highlighting and we have to use a lot of backslashes to escape the multiline string
- Requires a little learning: A few hours with the excellent Vue docs is recommended to be optimally productive