It’s just data

Converting to Vue.js

Whimsy had four applications which made use of React.js; two of which previously were written using Angular.js.  One of these applications has already been converted to Vue, conversion of a second one is in progress.

The reason for the conversion was the decision by Facebook not to change their license.

Selection of Vue was based on two criteria: community size and the ability to support a React-like development model.  As a bonus, Vue supports an Angular-like development model too, is smaller in download size than either, and has a few additional features.  It is also fast, though I haven’t done any formal measurements.

Note that the API is different than React.js’s, in particular lifecycle methods and event names.  Oh, and the parameters to createElement are completely different.  Much of my conversion was made easier by the fact that I was already using a ruby2js filter, so all I needed to do was to write a new filter.

Things I like a lot:

Things I find valuable:

Things I dislike (but can work around):

Things I’m not using:

On balance, so far I like Vue best of the three (even ignoring licensing issues), and am optimistic that Vue will continue to improve.


Solution to the traceback issue mentioned above:

Vue.config.errorHandler = function(err, vm, info) {throw err};
Posted by Sam Ruby at

Workaround to the warning issue:

// Filter out "data property already declared as a prop" warnings
Vue.config.warnHandler = function(msg, vm, trace) {
  if (/^The data property "\w+" is already declared as a prop\./.test(msg)) {
    return
  };

  if (typeof console !== 'undefined') {
    console.error("[Vue warn]: " + msg + trace)
  }
};
Posted by Sam Ruby at

Bookmark: how reactivity works

Posted by Sam Ruby at

Add your comment