Skip to content

Instantly share code, notes, and snippets.

@tunnckoCore
Forked from balupton/README.md
Last active August 29, 2015 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tunnckoCore/ee86546bb848ae77a810 to your computer and use it in GitHub Desktop.
Save tunnckoCore/ee86546bb848ae77a810 to your computer and use it in GitHub Desktop.

Riot.js & MicroJS, a misplaced initiative

I was recently asked for my opinion about Riot.js and what I thought about the MicroJS movement, as part of my residency for the wonderful Hacker Retreat initiative. Here's my thoughts.

Looking at the source, Riot.js is only a jQuery based event emitter you can attach to instances called observable with a trivial router that aliases to pushState. Everything else, you create, including the the CRUD abilities.

As someone who've recently tried to go Micro.js. I've actually given up on this rebuild from the ground up style approach. There is no support, no documentation, and no community to help you accomplish big prime time applications. Once you hit a wall, or try do to something that isn't included in the trivial amount of code there is, you're on your own, with no help besides "figure it out! that's what micro.js is about!".

This problem at it's core is about context. What Backbone, Ember, jQuery, and all the "monolithic" frameworks/libraries have in common, is that they have context, and with that context comes community, and with community comes support and sustainability. They all work well because they are a house built of bricks through a consistent process. Rather than a bunch of bricks, with a DIY process.

That being said, the underlying problem people have with monolithic libraries, is not that they don't do their job well, they do it incredibly well, but that you end up with the kitchensink, meaning you get things you don't need. The promise of MicroJS, is misplaced. It's not that people want to build their own homes with their own bricks by themself. But rather, people want control over the building process of their home.

The solution as I see it, isn't being left with a bunch of bricks and told to DIY (MicroJS), or with a house and saying your stuck with it (Monolithic), but rather with unbundled frameworks. To imagine this, it is Backbone being a specification, and then frameworks go about meeting that specification. You have a module for events, a module for models, a module for views, a module for routing, etc. Rather than one monolithic module, you have a bunch of bundled modules which make a suite.

This idea has been well executed with underscore. If you look at underscore as a spec, then you have underscore.js and lodash that meet it. With lodash you also have custom builds, making it as micro as you want. Same story with jQuery as a standard, implemented by jQuery and Zepto.

The closest I've found this to exist with full fledged frameworks, is just like how it's applied to underscore with lodash, the same is happening to backbone with exoskeleton.

This idea, has allowed me to use the conventions, support, and community (the eco-system together) of Backbone for webwrite/inlinegui, with the views/controllers and routing of SpineMVC. Which is working very nicely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment