sANTo L
sANTo L

Reputation: 33

Ember-cli required for latest version(s)?

Until recently I always used Gulp to compile/uglify/minify my Ember.js code and it worked great. This was up to Ember 1.11

Now I wanted to upgrade to Ember 1.12 and noticed that Ember-cli is now the preferred and recommended way to install/upgrade Ember.js Does this mean it's not recommended anymore to download the individual Ember libraries and compile everything myself via gulp?

My main concerns in using ember-cli are the following:

[1] It feels like I don't have enough control anymore over what's happening. E.g. I need to have two html files in my frontend - 1 publicly accessible and 1 protected - and ember-cli seems to look explicitly for an index.html file. I can work around it by placing the other html file in the "public" folder, but this feels more like a hack rather that a final solution.

[2] ember-cli is taking a lot of time to compile my application. With Ember 1.11 and gulp it took only 2 or 3 seconds, while with ember-cli (using Ember 1.12) it's taking a lot more time for an even simpler application. (Actually it currently only contains the login/registration part of the application whereas the app with Ember 1.11 and gulp also contained the application logic)

$ time ember build
version: 0.2.7
0.2.7

Could not find watchman, falling back to NodeWatcher for file system events.
Visit http://www.ember-cli.com/#watchman for more info.
Building..
services/websocket.js: line 39, col 31, 'SockJS' is not defined.
services/websocket.js: line 298, col 13, 'observerFunction' is defined but never used.

2 errors

services/util.js: line 6, col 9, Bad line breaking before '+'.
services/util.js: line 7, col 9, Bad line breaking before '+'.
services/util.js: line 8, col 9, Bad line breaking before '+'.
services/util.js: line 9, col 9, Bad line breaking before '+'.

4 errors

===== 2 JSHint Errors

Built project successfully. Stored in "dist/".

real    0m55.876s
user    0m35.935s
sys 0m2.643s

As you can see it takes almost 1 minute to build this very simple Ember code.

[3] With gulp I can update my live app on the fly using gulp-watch. With ember-cli something similar is available via "ember serve", but this expects the application to run standalone, which is not the case with my app. I have to serve it from my backend app, which is written in java.

Upvotes: 0

Views: 139

Answers (1)

Daniel
Daniel

Reputation: 18672

Ember CLI is recommended, but it's not required for latest versions. You can still use "globals style", even for version 2.0-beta. So, if you are aware of what you are loosing you can still go with grunt, but I'd say you shouldn't expect support from official documentation/guides etc. Most addons are nowadays converted to Ember CLI, so it requires some effort to make it work with globals style app(there was ember-cli-export-addon repository on GitHub before, but now it's gone), however it's still possible to make Ember CLI addon work with globals.

Now, about your concerns:

  1. It's possible that Engines RFC will solve your problem.
  2. 1 minute is long, maybe you've misconfigured something, or your app is indeed very big even with not many logic included, or you're running into Ember CLI performance problems on Windows, which can be solved.
  3. Maybe you could bind filesystem changes, for example via ln -s from dist/ to your backend app directory, or, for development purposes separate Ember app from your Java backend.

Upvotes: 0

Related Questions