Hi! I was wondering if there is any way to maintain my Loopback App upgraded to the latests releases.
Should I always upgrade @loopback/cli? Is there any command inside the CLI which upgrades the app?
We use semantic versioning. Using ^ notation we can ensure that the latest non-breaking minor versions are installed every time you run npm install.
For example, if a dependency is declared like this:
"@loopback/rest": "^1.16.3",
When version 1.16.4 or 1.17.0 of @loopback/rest is released, they will be installed when you run npm install.
However, if 2.0.0 is released, it won't be installed, since a major release mean breaking changes.
Nice, thank you @hacksparrow! And what about the CLI? Is it important to update minor versions? Since I already have created an application with an older version of the CLI, I wanted to know if minor bug fixes in newer versions can be applied.
The CLI does two things:
When a new version of the CLI is released, it can affect one or both functionalities.
If the new version added new features or fixed some bugs related to scaffolding, it won't affect existing apps, it will affect only new apps you create with it.
If the new version added new features or fixed some bugs related to commands, it will affect your existing app too.
Minor releases are non-breaking, feature releases. It is highly recommended to update to them.
Oh, I see! How do you update already created artifacts?
That will have to be manual update.
Ok, thank you very much @hacksparrow! 馃槃
@gonzarascon A few more tips:
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.
It would be nice to have these tips in the CLI documentation!