dimanche 21 juin 2015

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://ift.tt/1OvndU1 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.




Aucun commentaire:

Enregistrer un commentaire