940 karma · joined September 28, 2011
In particular if you don't need hot updates, adding Object.freeze() to your data will make the rendering 2x faster than React.
Vue 2.0's vdom implementation is mutation resistant - as long as you don't replace the element directly controlled by Vue (same as 1.0), the rendering will not run into problems. If you are really concerned you can always create a custom component that returns an empty element so that you can do arbitrary manipulations inside.
2) & 3): See http://blog.evanyou.me/2015/10/25/vuejs-re-introduction/ and http://vuejs.org/guide/comparison.html
Re moving away from JS classes: ES2015 class is inadequate due to the lack of static property initializers, and I don't want to force users to use stage 0 transforms. A Vue component definition is essentially an object of options, which is in fact easier than having to extend a base class. Also see https://medium.com/@dan_abramov/how-to-use-classes-and-sleep...
For the template, that's just because it's a one-pager demo and I don't want to use an inline string template. The proper experience is using single file Vue components: http://vuejs.org/guide/application.html#Single_File_Componen...
`replace: true` is a legacy option I forgot to remove in the demo :P
Anyway, for those of you who are not familiar with Vue, here's a blog post explaining why it's worth taking a look at: http://blog.evanyou.me/2015/10/25/vuejs-re-introduction/
r.table('users').filter(row => row('age').gt(30))If what you are saying is with "standard JS style" you will never add a newline after return, then I can also assume with "standard JS style" you will not:
- start a line with ++ or --
- start a line with a regex literal
- split a for statement into separate lines
So, the only issue you need to be aware of when writing semicolon-less javascript is when you start a new line with ( or [. Easy enough to remember, no?
I've personally been writing semicolon-less JS for almost two years now, and this one simple rule has been more than enough.
Disclaimer: I'm the author of Vue.js. The benchmark is a fork of a fork of the Vue.js perf benchmark (http://vuejs.org/perf/).
A fork of the fork from the article using async measuring: http://jsfiddle.net/yyx990803/VrLjY/
It's easy to notice that the majority of the time is actually spent on the repaint and the difference between implementation becomes much less significant. The only takeaway from this benchmark is that innerHTML/DOM thrashing your entire view is slow, and as long as data binding is implemented in a sane manner, it is almost never the bottleneck.
The arguments against DOM templating are, as the author admitted, pretty opinionated. Personally for me I much prefer working with real HTML and find it more readable. However, I do agree the real advantage of a virtual/parallel DOM implementation is the ability to render isomorphically on both client and server, and it is something most DOM-based templating solutions haven’t been able to properly address yet (although not impossible).
That said, I really like the project because I'm also a big fan of simplicity. Curious to see if there will be a TodoMVC implementation with Mithril for easier horizontal comparisons of actual code.
Shameless plug here because author's site doesn't have comments: maybe you could try Vue.js: it is <12k gzipped, support IE9 and above only, and even less opinionated.
Design decision wise, it's mostly about simplicity, so no dependency injection, no pre-compiling jsx, no $digest/$apply, no services/factories etc... it's mostly up to you how to structure your app.
It also does not include routing/ajax/REST resource parts and focuses on the interface only. It is designed to be module ecosystem friendly (e.g. Component/Browserify) so you can easily leverage other libraries to fill in the missing pieces.