Upgrading to Ember 2.0

So… until Ember-CLI catches up, what’s the recommended way to update to Ember 2.0?

I tried changing the version numbers in the package.json and bower.json files (good thing I looked in both files, didn’t realize ember data was also in the package.json file…), did npm install and bower install and tried to start the app. I got:

Missing bower packages:
Package: ember
  * Specified: 2.0.0
  * Installed: 1.13.7

Run `bower install` to install missing dependencies.

I had already run bower install, so I did it again and it didn’t add anything. So I removed the bower_components directory and bower installed again. Trying to run the app now gives me:

Unable to find a suitable version for ember, please choose one:
    1) ember#>=1.4 <2 which resolved to 1.13.8 and is required by ember-cli-shims#0.0.3, ember-load-initializers#0.1.5
    2) ember#>= 1.8.1 < 2.0.0 which resolved to 1.13.8 and is required by ember-data#1.13.9
    3) ember#2.0.0 which resolved to 2.0.0 and is required by ember-note
    4) ember#> 1.5.0-beta.3 which resolved to 2.0.0 and is required by ember-resolver#0.1.18

Prefix the choice with ! to persist it to bower.json

? Answer:

So…yeah. Any hints to make all the fiddly bits happy?

Choose #3. Prepend it with an exclamation: !3 to make it stick.

as @fr33dm said, choosing 3 with the exclamation mark will force your app to use 2.0.0. In my upgrade process, I was still getting a message similar to this after running bower install.

Please note that,
ember-cli-shims#0.0.3, ember-load-initializers#0.0.2 depends on ember#>=1.4 <2 which resolved to ember#1.13.8
ember-data#1.13.5 depends on ember#>= 1.8.1 < 2.0.0 which resolved to ember#1.13.8
ember-resolver#0.1.18 depends on ember#> 1.5.0-beta.3 which resolved to ember#2.0.0
ember-simple-auth#0.8.0 depends on ember#>=1.2 which resolved to ember#2.0.0
Resort to using ember#~2.0.0 which resolved to ember#2.0.0
Code incompatibilities may occur.

You’ll need to open the bower.json file or the package.json file to update the version numbers of any add-ons that are pinned to an earlier version of ember. In this case, ember-cli-shims will need to be at 0.0.4, ember load initializers will need to be at 0.1.6, and ember-data will need to be at 2.0.0-beta.2 . Check for the most recent releases on Github to get the correct version numbers.

Ahhh … And there’s the “fiddly bits” I was referring to… having to check 20+ separate packages in the package.json and bower.json files to make sure everything is the right version - whatever that may be…

The packages that show up in that message were the only ones I had to change. In your case that would be bumping the version numbers for ember-cli-shims, ember-load-initializers, and ember-data. Those are the ones that are resolving to 1.13.8 right now.

So now that there has been a couple updates to ember and ember data, what’s the schedule for an up to date ember-cli?

I guess in the very near future (days) at least a beta 2.0 will be released. You can follow progress here:

https://github.com/ember-cli/ember-cli/issues/4671

yeah, I actually did see that a few days ago. And that also hasn’t had any updates for almost a week too. Just curious.

Sigh. Now when I update bower.json to “ember-data”: “2.0.0”, “ember”:“2.0.0” and package.json to “ember-data”:“2.0.0”, doing bower update gives me:

Please note that,
    ember-cli-shims#0.0.3, ember-load-initializers#0.1.5 depends on ember#>=1.4 <2 which resolved to ember#1.13.9
    ember-simple-blog depends on ember#2.0.0 which resolved to ember#2.0.0
    ember-resolver#0.1.19 depends on ember#> 1.5.0-beta.3 which resolved to ember#2.0.0
    ember-data#2.0.0 depends on ember#^2.0.0 which resolved to ember#2.0.0
Resort to using ember#2.0.0 which resolved to ember#2.0.0
Code incompatibilities may occur.

Guess it’s always going to be something…

You need to update ember-cli-shims to 0.0.4

Yup. Since there’s no easy way to see what the latest version of all the npm and bower packages that Ember uses are, I went to the ember-cli repo, in the blueprints/app/files directory and compared from there. Updated a couple outdated lines and it seems to be working. Again, seem to be quite a bit of work just to get everything up to date, but it is what it is :smile:

So more updates to ember and ember-cli update is nowhere in sight.

Any word?

For the moment, the latest release of ember-cli generates projects with ember(-data) 1.13.8. You’ll have to wait for the next version in order to have Ember 2.0.0 natively.

But, there are 2 things to take into account:

Don’t hesitate to build with Ember 1.13.8 until ember-cli is updated, the transition to the newer version (coming with Ember 2.0.0) will be mostly painless. It’s easy and the Ember team does everything to ease the pain.