Two.js
11–20 of 64 posts
Re: Two.js
#12Re: Two.js
#13I don't mean to sound negative, I'm just not clear on the point.
Re: Two.js
#14Re: Two.js
#15Was pretty confused at first about why this would have a Backbone dependency until I looked through the source and saw they they're just pulling Backbone.Events. I think it says a lot about Backbone that people are doing things like that. Modularity is nice. Oh, and thumbs up for Two.js. Well done.
The decision for Backbone events vs other events is based on this performance review: http://jsperf.com/events-vs-events2/25
I'm curious, though, why they added an external dependency instead of just inlining a solution. There's a couple of good MIT licenced barebones implementations[1][2] floating around, and it's pretty straightforward to reimplement yourself in an hour or two if you prefer.
[1] https://github.com/Wolfy87/EventEmitter [2] https://github.com/hij1nx/EventEmitter2
Re: Two.js
#16I don't get it. Retained-mode vector graphics == SVG. Browsers with canvas or webgl also have SVG. So what does this accomplish? I don't mean to sound negative, I'm just not clear on the point.
Along these lines I've written projects in canvas only to realize later I should've written in SVG. One of the aims of two.js is to afford a canonical API for the developer. So the idea is that if you're rendering lots of particles and not doing any manipulation to individual particles, canvas or webgl will render faster than svg. Two.js aims to make it easier to test and switch around between the contexts. However, I should caveat all of this with two.js is very nascent...
Re: Two.js
#17Earlier quoted context omitted.
The decision for Backbone events vs other events is based on this performance review: http://jsperf.com/events-vs-events2/25
That's not a big surprise. jQuery's events use native browser events behind the scenes. Which is nice for dom-oriented plugins; you get bubbling for free and all the native event listeners just work. It's got a pretty fair amount of overhead though. Backbone's events are just a pure JS event emitter implementation. I'm curious, though, why they added an external dependency instead of just inlining a solution. There's…