[Retracted.] ... but, if you're going to test Underscore templates for speed, you need to use the `variable` setting to avoid the `with` block.
Riot.js – A 1kb client-side MVP framework
31–40 of 147 posts
Re: Riot.js – A 1kb client-side MVP framework
#32How can someone just beat Resig's or Jashkenas' code performance "that easily"?
https://github.com/moot/riotjs/blob/master/riot.js#L12-L21 By only supporting simple single property accesses. All that this can do is print values from an object — no loops, conditionals, filters, methods, or anything else — like the others support. Think string interpolation, not templates.
Re: Riot.js – A 1kb client-side MVP framework
#33Re: Riot.js – A 1kb client-side MVP framework
#34Here is the entire source: https://github.com/moot/riotjs/blob/master/riot.js
Re: Riot.js – A 1kb client-side MVP framework
#35Uh MVP (Minimum Viable Product) vs. MVP (Model View Presenter). That will be confusing. (still nice project of course)
I still find it hard not to think "Most Valuable Player" whenever i read MVP
Re: Riot.js – A 1kb client-side MVP framework
#36@tipirai Could you please put up more posts on usage and the documentation?
Re: Riot.js – A 1kb client-side MVP framework
#37This sort of thing is a beautiful demonstration of marketing, big promises, and bombastic rhetoric in open source. But one of the best things about open source is that you don't have to take such claims at face value. If you actually look at the source, you'll find:
https://github.com/moot/riotjs/blob/29ae687ca0633b703e124331...
* A funny syntax for string interpolation. (Not templates)
* A strange bug relating to "popstate", ignoring browser support for folks on IE.
* A simple proxy to jQuery's `on`, `off`, `emit`, and `one` functions. (Why not just use jQuery events directly?)
* A simple proxy to "pushstate" and "popstate". (Ditto)
... and that's about it.
Calling this, "The fastest, smallest and most powerful client side framework for building large scale web applications," is pretty funny stuff — but I guess it might also be true. There's almost literally nothing here except for jQuery.
That said, if this were rewritten as a "you don't need a library to do MVC" blog post, then more power to it — it would be right on. But at the moment, it's a pretty spectacular piece of puffery — the sad thing being just how effective this sort of thing can be: http://cl.ly/SFzy. "Riot.js" might be a particularly egregious example, but similar tactics can be found all over the place. As a community, it would be nice if we could spend a little more time reading source, and seeing what libraries actually do and what can be done with them, and less time just drinking down the PR.
(And if this is all an elaborate joke, then I'm an ass for falling for it ;) But that's not the sense I get.)
Re: Riot.js – A 1kb client-side MVP framework
#38[Retracted.] ... but, if you're going to test Underscore templates for speed, you need to use the `variable` setting to avoid the `with` block.
I don't think that's fair since a templating engine could easily avoid the actual with statement but provide same convenience. Optimization should be done in the implementation (which is fully possible here) and not at the cost of API ergonomics.
> a templating engine could easily avoid the actual with
> statement but provide same convenience
I'm afraid that's not possible. If you look at other micro-templating libraries that allow arbitrary JavaScript values, you'll find that there are two options. Either you can support naked variables, and you have to use "with" to bring them into scope ... or you have to prefix all of your variable accesses off a "data" object, which is less ergonomic, but faster. Underscore supports both.If you've got a patch that is able to do otherwise, I'd love to see it ;)
Re: Riot.js – A 1kb client-side MVP framework
#39Re: Riot.js – A 1kb client-side MVP framework
#40key feature of many frameworks is that they break if you don't follow them carefully, limiting damage from 10x developer's hacked together code. does riot provide similar functionality?
Developing with Riot is completely different from other frameworks. It's just 3 functions and after 1.0 the API will be hardened. It's more of a design pattern than a framework. The application developer is the biggest culprit for breaking things.