I have begun using ember app kit and heave read through its guides. However I having trouble wrapping my head around the differences between a regular app and this way that Ember App Kit structures the various bits using ES6 modules instead of stuffing everything into a global variable used as a namespace (e.g. App).
I found that this aspect is not very clearly explained:
Much appreciated in advance!
EDIT (20140506):
These resources explain ES6 modules and EAK really well:
I actually did a blog series on this very topic just a few weeks ago. I start with a basic (globals) ember app and transform it over 8 different posts.
In the end, you have a Gruntfile w/ tasks just like EAK (but you've built it all by hand -one step at a time)
Stefan Penner does a pretty good job of explaining modules on Ember App Kit's site, but to summarize:
Ember App Kit uses the ES6 Module Transpiler to convert all your app's Ember classes into AMD modules. In "normal" Ember development, you assign classes as properties of your app...
App.IndexController = Ember.Controller.extend(...);
But with EAK, you write your modules in ES6 syntax:
export default Ember.Controller.extend(...);
The transpiler will use the file name as the basis for its module name (assuming that it's saved at app/controllers/index.js
:
define('controllers/index', Ember.Controller.extend(...));
Ember App Kit then uses a custom resolver to look up modules using AMD, rather than looking for them as camel cased properties of your App. (I don't have the rep to post another link, so google for ember-jj-abrams-resolver.)
If Ember looks for a module and doesn't find it, it behaves the same way it does outside of EAK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With