EmberJS: How to update Ember CLI based apps - ember.js

Angular has https://update.angular.io/ that guides with the proper way to update (along with dependencies et al.). Likewise, is there a way to know how to update an Ember app properly?
Obviously, changing the version of the ember package in bower.json and doing an bower install && npm install doesn't seem to be the ideal way.

Detailed update information are included in release notes provided for ember-cli on GitHub: https://github.com/ember-cli/ember-cli/releases/
For projects that aren't using a very old version, the workflow is mostly this one:
Update globally installed ember-cli to latest stable release
Update globally installed ember-cli-update to latest stable release
Clean up your project by deleting tmp, dist and node_modules folders.
Run ember-cli-update to update project to match current blueprint.
Run ember-cli-update --run-codemods to update project to match current best practices.
Before ember-cli-update has become the official tool for updating projects, running ember init again after updating projects ember-cli dependency manually was the officially recommended workflow. ember-cli#3.2.0 was the last release for which this workflow was recommended. But ember-cli-update should support all versions for which a tag exists in ember-new-output repo, which should be true for all stable releases of ember-cli.
You could of course update your dependencies individually and not follow the recommended configuration provided by ember-cli. But be aware that uncommon combination may not work as stable as you are used to.
If your app still uses Ember App Kit, which has been deprecated in 2014, you could find a migration guide in their readme. But you should consider carefully if rewriting wouldn't be quicker than updating such an outdated app.

You can find a complete step-by-step guide for upgrading an ember here,
https://cli.emberjs.com/release/basic-use/upgrading/

Related

Updating Loopback 4

I am using Loopback 4 to create a REST-ful API. I'm a mobile developer by trade so typescript et al is all pretty new to me, so please be kind ;)
I created the app using CLI v1.21.4, and saw a message to say that an update is available. I therefore updated my global installation of the CLI. But then when I try and run one of the commands such as lb4 model I see the message:
The project was originally generated by #loopback/cli#1.21.4.
The following dependencies are incompatible with #loopback/cli#1.23.1:
typescript: ~3.5.3 (cli ~3.6.3)
#loopback/authentication: ^2.2.2 (cli ^3.1.1)
I would of course like to take advantage of these newer modules, but I am unsure how to update my app scaffolding and dependencies. Could anyone offer some advice please?
Please check out https://github.com/strongloop/loopback-next/issues/3608:
During lb4 app, we add the cli version to .yo.rc.json, such as:
{
"#loopback/cli": {
"version": "1.21.4"
}
}
lb4 -v lists compatible modules that are released with the cli.
lb4 commands check if the project has incompatible versions with the current cli and prompts users to force or exit.
I would of course like to take advantage of these newer modules, but I am unsure how to update my app scaffolding and dependencies.
The process for updating dependencies is not specific to LoopBack. If you are using npm, then simply run npm update.
Please note that TypeScript often introduces backwards-incompatible changes in semver-minor releases, 3.6 brought few of them. Be prepared to manually fix few compilation errors after the upgrade.
I think that npm update is not going to jump from v2 to v3 for #loopback/authentication, you have to request that upgrade explicitly:
$ npm install #loopback/authentication#latest
There is now a supported update procedure, which is documented here:
https://loopback.io/doc/en/lb4/Update-generator.html
It seems to be simply:
# Ensure you have the latest version of the CLI tool
npm install -g #loopback/cli
# Then ask the tool to check which packages should be upgraded
lb4 update

Updating Ember.js with moment.js, lost bower and now?

We have been using moment for the past few year in our software via ember-moment. After some time with production version frozen we are now updating. First step was to move up to 2.16 when we got the perception that we should not use shim any more, and so we don't know how to do regarding the moment dependency.
The goal is to update until most recent versions 3.x
just use ember-moment. ember-moment switched to using npm a while ago.
Actually ember-moment uses ember-cli-moment-shim which does all you need.
You can just remove ember-moment, moment and ember-cli-moment-shim from your bower.json and package.json and then do ember install ember-moment and it will install all of it to your package.json.

How to create a ember version specific project?

When i use,
ember new projname
project is getting created with 2.7.0 ember version. I want to create a older version ember project. What i should use? [i checked options that can be used with new command, but none helps for this.]
Here's what I ended up doing:
create a new directory for my project and cd inside of it
npm init (enter through some bogus details, doesn't matter, we're going to erase soon)
npm install --save-dev ember-cli#desired.version
delete package.json and package-lock.json
ember new app
This got me a node_modules folder with the desired version of ember, and then also allowed me to use the ember cli to generate a project. It will create a folder with the name of the app, of course, and you can safely delete the node_modules folder in the app's parent directory.
This feels like a little bit of a round-about way of doing things, but it worked, and it seemed easier than trying to mess with my global versions.
Hope this helps someone out!
Ember new will create project at the most current version installed on your system.
There are 2 ways around this.
Install an older version of ember-cli globally for the desired version. The benefit would be that you create a new app at the desired version from the get go:
(change #2.11.0 to the desired version from https://github.com/emberjs/ember.js/releases)
npm uninstall -g ember-cli
npm cache clean
npm install -g ember-cli#2.11.0
Keep the current ember-cli version and then downgrade by changing the ember value in package.json :
(this will work for small version changes, not major changes)
you will need to re init your ember app (change 2.11.0 to what you need from https://github.com/emberjs/ember.js/releases)
rm -rf node_modules dist tmp
npm install --save-dev ember-cli#2.11.0
ember init
Node.js is required with every Ember installation and you have to check which version of node is required for the desired version of Ember you want to install. Most likely itll work well with the version currently installed.
you can download the latest (LTS) from: https://nodejs.org/en/
or older versions from: https://nodejs.org/dist/
OSx for example https://nodejs.org/dist/v4.7.0/node-v4.7.0-linux-x64.tar.gz
results

How to upgrade my Ember application?

What is the recommended way to upgrade Ember from version 1.13.8 to version 2.3?
I have seen an example on this link How to upgrade the Ember version in an Ember CLI application?.
Is that the only thing that I have to change?
If you want to fully upgrade your application and dependencies, I recommend following the instructions on the ember-cli release post.
If you only want to upgrade Ember.js itself, the version in bower.js is indeed the only thing you need to change.

How to start a new ember project

I've been asked to use ember again, at it's been a while since i left it;
I was reading that, like in the past, ember-cli is the recommended way to start a new ember project;
But my concern is: the official stable version of ember-cli uses an outdated ember version; on the other hand the ember-cli with the latest ember (2.22) is a beta;
can someone share his experience in order to understand the preferred way to deal with ember projects right now?
You can use ember-cli 1.13.13 with Ember 2.2. Just after typing ember new, edit your bower.json and package.json appropriately and run bower install and npm install.