2 ms·
I've been working in Ember full time now for a few months, and I really advocate using just two files, at least to start: one for Javascript and one for HTML.
by erikpukinskis 13y ago
I've been working in Ember full time now for a few months, and I really advocate using just two files, at least to start: one for Javascript and one for HTML.
I know, it's a terrible, horrible practice, but hear me out.
Learning Ember, especially at the beginning, required me to sort of rewire my brain about what goes where. It's "MVC", but the M, V, and C mean totally different things than they mean in Rails. Really it's more like MVCRT (model view controller route template).
I found all the different files extremely confusing at first, especially since each tutorial told you to lay things out slightly differently.
If you put it all in one file though, you can really easily move stuff around. You'll find yourself frequently pulling stuff out of a controller and sticking it in a view, or a route. Having to constantly switch files, remember where things are, create new files, and remove stuff from version control really puts a damper on things.
My advice to anyone starting with Ember: download the starter kit from emberjs.com and try to stick inside that as long as you can. You can just drop it into your Rails /public folder and get up and running.
Once you have a solid understanding of the architecture, and your app is getting bigger, it's literally an hour's work to pull everything out into separate files and drop it into something like the Rails asset system.
- iamstef 13y agoAlthough lots of work still needs to be done. http://github.com/stefanpenner/ember-app-kit http://github.com/stefanpenner/ember-app-kit aims to prevent and mitigate the tooling pain, by having the community bear the burden.
- zwily 13y agoI wrote the first ~25% of my first few Ember apps completely in jsbin. The ease of starting and sharing what I'd done with others was great.