Anahita Project

Anahita Project's Topics

Nick Swinford

Nick Swinford

September 06 2014

Katniss, a girl on fire!

I've been thinking about how to proceed with replacing the #mootools code in #Anahita for awhile. The idea of using #Emberjs crossed my mind a few times so I sat down today and threw together a quick example. It's not much, but you can check out a demo here (click on People in the menu) and the source code here.

Anahita already has some great APIs to handle this sort of thing.  I just threw together the people example as a way to get started.  Its definitely interesting and a fun side project, but I think #backbone is still a better way to go.

For those don't understand the name, Anahita + Ember = a girl on fire, Katniss Everdeen; from the Hunger Games trilogy. Yes, I'm a nerd.

Johan Janssens
Johan Janssens
September 06 2014 Permalink
Hi Nick, moving away from #mootools is definitly a great next step. I would be carefull though to replace it with Emberjs, or any other full page js framework by default. It all depends what you are trying to achieve and what your usecase is.

A few points that we use ourselves as guidance :

1. We have replaced #mootools in in Nooku Fw 2.0 with jQuery where required but try to do this in such a way to generate minimal overhead possible and make sure to not need to load jQuery all the time, only when needed.

2. In a (Joomla) context where you cannot contol the full page backbone nor ember make much sense. In that context a js framework like is a better option due to it's tight integration with jQuery. Less overhead, great flexibility.

3. Nooku FW 2.0 REST and JSONAPI is inspired by which is build by the #emberjs team to compatible with ember data. The spec is still in development but we are watching it closely.

When ember data is done and the spec finalised you will get out of the box support for ember data in Nooku.

4. Finally, full page apps build with emberjs, backbone, angularjs are not always the most performant option. Especially if you are using them to serve and build html that has a high degree of static ness. 

Your demo is a good example here. In that case solutions like :

- turblinks : pjax :

can deliver you better results because you can make use of the server side or proxy cache and you don't need to build the html n the browser.

Hope that helps,

2 people liked this

Powered by Anahita