aurajs / aura

A scalable, event-driven JavaScript architecture for developing component-based applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Framework design flawed! Removing dependencies jQuery and Underscore.

opened this issue · comments

So the entire point of this framework is to make your code library agnostic but it has dependancies of 2 of the heaviest libraries out there Jquery and underscore. Doesn't this defeat the entire purpose of the framework. Why aren't these methods and queries abstracted and written Native?

Does anyone have a fork that doesn't have these libraries as a dependency? If not I am going to remove them and make this a native library. This is a major design flaw in this whole framework. This framework is not library agnostic its library intensive!

Why do not you provide a interface-equivalent personal lib that will cover all jquery/underscore required features.
and then you can replace them with your light library, and at the same time you can figure out was it a worth of doing it :)
At the same time, you can propose to the main developers to maintain which features of jquery/underscore they are using so you/some-one else can take care of maintenance.

@mprinc Already about half way done with the migration I got underscore taken care of. Here is a gist of minimum underscore methods needed.

https://gist.github.com/joshspivey/8531223

It will be worth doing it jquery and underscore bloat applications so much they slow them down about 10X I have tons of bench marks proving this.

Now I believe its best to rewrite the base to replace jquery because its not ideal to do events native, I will probably use bean instead, and qwery along with a custom Jeesh script I been using for a couple years.. To be honest this is something you should set just when you initialize base we should probably abstract $ factory to something similar to a extension. The only issue I see is find and deferred, which deferred I can use this. Its kind of big tho :(

https://github.com/download13/ender-deferred/blob/master/deferred.js

Now I have to open up jquery to see what find does would be nice if someone had a jquery find method. When I did benchmarks in the past find was slow so I would stay away from it but the latest version of chrome its actually faster than a query selector.

http://jsperf.com/selector-vs-find-again

So who would I talk to on getting this issue resolved, or getting my code maintained. I like auras design but its not there yet the performance wont be good enough for the type of applications my team does so I need to micro library this thing out. So far I got exoskeleton, and doT templates working, but whats the point with having jquery and underscore. Lets just put it this way I stripped backbone down last year from its dependancies before exoskeleton was around and I removed jquery and used ender with tween lite my applications went from 5 seconds to 1second. the amount of recursions they had where insane.

Agreed,

and good work...

+1.

You can talk to @sbellity, We're really interested what you're doing at hull.io.

I got permission from my work and Dustin Diaz to open source the custom code I made which is a drop in replacement for jquery. This will fix the Jquery problem and give us more library flexibility. I will have to work on the aura script more this weekend. I will be launching the custom jquery replacement which allows you to interchange libraries next week it going to be called minowjs. Right now I have tweenlight as the animation engine so I need to figure out what to do with that aspect of it default enderjs uses Morpheus and I find that as a awful animation engine.

@sbellity how should we go about packaging up this as a new base

Look for minowjs here in a week https://github.com/Lbox/minowjs right now its private till its finalized for release.

@unity @rspindel @Pickachu @mprinc
thanks for your support

@joshspivey thanks a lot for this !
It's something that we really wanted to do for a long time ;)
Here are some notes that list what is required : https://github.com/aurajs/aura/blob/d3a6c452fefc4a1bab4f070c5bbf48f88df3d21f/notes/base.md

  • underscore dependency could really be removed at some point. The current codebase uses it just for convenience, but there is nothing that really requires it
  • jquery provides a Promise implementation and selector. The issue with jQuery Promises is that they are not really Promise/A compliant, so we probably need to tweak some parts of the code to support plugging another Promises lib

other possible improvements :

  • get rid of the current dependency on eventemitter2 for its internal mediator, there are other (smaller / simpler) solutions out there...
  • almond is not currently supported (i think... because component paths are defined as packages http://requirejs.org/docs/api.html#packages there is probably another way to do it)
  • alternative to requirejs : curljs is much smaller and should work too... I think we should officially support it

If we manage to make those changes without breaking the current APIs, i would be happy to release it as a 0.9.x
We could also start a 0.10.x series that introduces some APIs changes but would focus on making Aura less dependent on 3rd party libs...

Let me know if I can help you, can't wait to see your commits !

@sbellity

  1. Underscore already removed - check out the gist above.
  2. We can use https://github.com/download13/ender-deferred/blob/master/deferred.js
  3. Bean can do this... This is the event library I am wrapping in with MinowJS
  4. I been working on the requirejs stuff as well I definitely think we should integrate almond over curl but this is something that you have grunt do. When you are developing with live reload you want full requirejs hince dev is all async you don't want to do a build every-time. Almond requires everything to be sync. That's what I am currently using on my current work boilerplate. We need to fix the extension and the view AMD wrappers there is some funky stuff going on there. Does anyone have rjs optimizer working yet?

@sbellity
One more note on # 3 we should probably setup yeoman to choose jquery or the abstracted micro libraries. Your Jquery events can do this as well you don't need event emitter at all. Which ever one you use it will setup custom events based on your library.

@mprinc @addyosmani @sbellity @Pickachu @buritica @rspindel @benichu @unity

MinowJS is public now we can be completely library agnostic and still keep the $ factory style of coding...

https://github.com/Lbox/minowjs

Please let me know if you have any issues or it needs a update on anything...