Skip to content

Upgrading Ember

0xADADA edited this page Jan 31, 2019 · 10 revisions

Steps to upgrade Ember, Ember-CLI, and all addons. First read the Ember-CLI release docs

Upgrade Addons

Ember addons are typically incrementally improved to guarantee backwards compatibility. With this in mind, it's best to upgrade addons first, before upgrading Ember and its core dependencies. The addon-first approach to upgrading is seriously a game changer. Upgrade each 3rd-party addon in the app, one at a time, making sure the tests are passing after each.

Run yarn outdated to view a list of packages outdated in the current project.

To update these packages, run yarn upgrade-interactive.

This command will display the outdated packages before performing any upgrade, allowing the user to select which packages to upgrade. Yarn will respect the semver version ranges in package.json when determining the version to upgrade to. So if ^1.9.1 is specified, and 2.0.0 is release, it wont appear.

Use yarn upgrade-interactve --latest to upgrade to the latest release.

Upgrade Ember CLI

Install the latest version of Ember CLI

yarn global upgrade ember-cli  # upgrade the global CLI
rm -rf dist tmp                # Remove temp directories, and re-install dependencies:
ember update                   # ember-cli-update handles upgrading

Using ember-cli-update

This updates the app to the latest Ember CLI version. It works by grabbing the current Ember CLI version and fetching the latest (or specified) version, then applying a diff of the changes from the latest verion to the current project. The current project will be modified only if there are changes between the current project and the latest (or specified) version. It will only change the section necessary, not the entire file.

ember update

This is different from the ember init command. That command tries to reset your project back to a brand new project. It removes all your changes and additions.

ember-cli "official way" ember init runs the new project blueprint on your projects directory. Please follow the prompts, and review all changes (tip: you can see a diff by pressing d). ember-cli will now run you through all of the files that it thinks need to be changed and ask you a binary question: do you want to overwrite this file or skip it and not do anything to it at all?

However, most of the time you will actually want to merge your old file with the new CLI file.

Deprecations

Use the deprecation-workflow to resolve any deprecations.

Clone this wiki locally