23

Is there any guidance on how to write modular Ember.js apps? I have seen Tom Dale's position on AMD here so I am not going to force fit AMD on to the framework (as some have attempted here). It appears that Ember internally uses bpm/spade. Is that a reasonable approach to modularize Ember apps too? Any samples using this approach?

P.S. The getbpm.org site seems to be down which makes it difficult to learn about it. There is a github page but it refers to the site for install instructions.

Community
  • 1
  • 1
Naresh
  • 23,937
  • 33
  • 132
  • 204

5 Answers5

11

BPM in it's current form is no longer supported by the core team, but is community supported. The only build tools they are officially providing support for is rake-pipeline. However, BPM does still work and it works well (I still use it with my projects). For info on how to use it see this: https://github.com/ud3323/bpm/wiki/Using-BPM-with-Ember. You may want to use my fork of bpm too. I've merged in Joe West's support for a proxy middleware.

There is also community build tools for node.js called ember-runner which looks promising as well.

As for using rake-pipeline. Look at the AssetFile on the emberjs projects to see how must be configured using rake-pipeline and rake-pipeline-web-filters. Also, take a look at the answers to this question on StackOverflow (especially Yehuda's). You may also find this gist helpful as well.

Community
  • 1
  • 1
Roy Daniels
  • 6,309
  • 2
  • 27
  • 29
  • Thanks ud3323! Since I don't have much time to evaluate all of these approaches, I will start with BPM and go with it if it works reasonably well. BTW, my back-end is Java and the Ember app will access it only via AJAX. Any words of wisdom for this environment? Your docs seem to be for a Ruby app. How does bpm work in development mode - will I be debugging minified js? Also, since I will be using h5bp, how does bpm compare with https://github.com/h5bp/ant-build-script - any thoughts? I assume I would still have to learn how bpm does modularization. – Naresh Feb 12 '12 at 13:22
  • Ember is back-end agnostic so as long as you're AJAX calls are getting & receiving the correct data you'll be fine. BPM is a ruby app and you'll need to have Ruby 1.9.x installed to run it. However, you won't need to know Ruby to use BPM. There are a bunch of little tricks to using BPM that are undocumented. I'll do a quick writeup later today. As for the H5BP build script, I'm not familiar with it but after quickly looking at it you should be able to create a new project, use BPM to manage you js/css, and when you want to go to production run the project through their script – Roy Daniels Feb 12 '12 at 16:56
  • 1
    I have just created this doc which explains some useful ways to customize your build files. [https://github.com/ud3323/bpm/wiki/Project-Build-File-Tips-Tricks](https://github.com/ud3323/bpm/wiki/Project-Build-File-Tips-Tricks). Oh and if you could mark this question as answered I'd appreciate it :) – Roy Daniels Feb 12 '12 at 18:56
  • Thank you! I will trying this out today. – Naresh Feb 12 '12 at 19:38
  • Roy, I ran into a road block when trying to go through your Using-BPM-with-Ember wiki page. The very first command (bpm init hello_world) is throwing an exception (see https://github.com/bpm/bpm/issues/93). Looks like someone else also hit this issue earlier. I checked the files under execjs directory - there is no file called which.bat. Note that I installed bpm using "gem install bpm". I don't know how to build your fork (don't know Ruby - just installed the environment for this). Thanks. – Naresh Feb 13 '12 at 00:02
  • Yes there is a known issue in Windows. If I think it's something to do with the version of Ruby? I think you need 1.9.2p290 or greater... When I get some free time I'll search around and see if I can find the root to the issue. Thanks for putting that back on my radar! – Roy Daniels Feb 13 '12 at 13:43
  • Please refer to my answer here to resolve this issue: [http://stackoverflow.com/questions/9266513/cant-create-an-ember-js-application-using-bpm/9269436#9269436](http://stackoverflow.com/questions/9266513/cant-create-an-ember-js-application-using-bpm/9269436#9269436) – Roy Daniels Feb 13 '12 at 23:11
  • I appreciate the help being offered here but I am troubled that the only examples for building Ember in a modular way are using BPM but the way the core team works is really not well documented anywhere. Yes, I have looked at the AssetFile setup in the projects but this really is a poor example of an actual Ember application and how one would setup their project structure and develop and then deploy the app. – John K Feb 14 '12 at 13:54
  • Though the core team does not "officially" support BPM in its current form that obviously does not mean don't use it. Actually, BPM was the official way to build Ember apps, but they decided to try and create something even more awesome (the rake-pipeline approach) which they are still working on. That doesn't make BPM or ember-runner bad, just different. I'm not part of the core team & wouldn't dare speak for them, but I think they understand that documentation is lacking & are doing what they can to address the community's needs... just like those of us that just love this framework! – Roy Daniels Feb 14 '12 at 16:41
  • 1
    I recently ran across this skeleton project on Git which may be of use to someone for getting a Rake-Pipeline-Webfilter project off the ground: http://github.com/interline/ember-skeleton – John K Feb 21 '12 at 12:37
2

Try Ember App Kit - maybe it would help you.

petkopalko
  • 600
  • 7
  • 18
1

Perhaps ember-tools could help:

https://github.com/rpflorence/ember-tools

Ilja Sucharev
  • 201
  • 1
  • 2
  • 8
1

I have played a bit with Rails, so for me, creating a rails 3.2 app was the easiest way to achieve this. So if you don't mind using rails as a back-end, I this might suit you.

CHsurfer
  • 1,304
  • 1
  • 15
  • 34
0

I am novice still I found yeoman and ember-generator useful. In future you might need to add tests , mock rest calls you can easily npm install sinonjs and npm install ic-ajax

Rigel
  • 882
  • 1
  • 11
  • 32