Loopback-next: Maintaining Loopback application up-to-date

Created on 27 Aug 2019  路  8Comments  路  Source: strongloop/loopback-next

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?

question

All 8 comments

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:

  1. Scaffold a new LoopBack app
  2. Provide interfaces (commands) for creating / updating the artifacts of the app (like adding a model etc.)

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:

  1. During lb4 app, we add the cli version to .yo.rc.json, such as:
{
  "@loopback/cli": {
    "version": "1.21.4"
  }
}
  1. lb4 -v lists compatible modules that are released with the cli.

  2. 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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

milindsingh picture milindsingh  路  3Comments

half-blood-programmer picture half-blood-programmer  路  3Comments

rexliu0715 picture rexliu0715  路  3Comments

ThePinger picture ThePinger  路  3Comments

mhdawson picture mhdawson  路  3Comments