Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng update should provide instructions for updating major versions incrementally #19381

Closed
1 of 15 tasks
dzhavat opened this issue Nov 13, 2020 · 3 comments · Fixed by #22033
Closed
1 of 15 tasks

ng update should provide instructions for updating major versions incrementally #19381

dzhavat opened this issue Nov 13, 2020 · 3 comments · Fixed by #22033
Labels
area: @angular/cli feature Issue that requests a new feature ng update DX
Milestone

Comments

@dzhavat
Copy link

dzhavat commented Nov 13, 2020

🚀 Feature request

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

A clear and concise description of the problem or missing capability...

Say I'm on Angular v8.0.0 and run ng update. The current instructions displayed in the console shows a list of packages that can be updated together with a command.

The suggested command is ng update @angular/core (as an example) which always attempts to update Angular to the latest stable version (11 at the time). This goes against the idea of incremental updates (also recommended in the official docs) where one will go from v8 -> v9 -> v10 ... latest.

Describe the solution you'd like

If you have a solution in mind, please describe it.

The suggested commands should take into consideration the current major project version and the current major stable version and provide appropriate instructions (commands) depending on the version "jump". If the difference is just one version thenng update @angular/core should be fine. If the jump is bigger, then an incremental update can be recommended.

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?
@sebastian-zarzycki-apzumi

Or just provide the ability to update to specified version (like npm) and advise users to go through the motion of ng update @angular/core@8.0.0 -> ng update @angular/core@9.0.0 -> ng update @angular/core@10.0.0 and so on.

@clydin
Copy link
Member

clydin commented Feb 4, 2021

Using a package version specifier is currently supported. For example, running ng update @angular/core@10 will attempt to update Angular framework packages to the latest version of 10.x.

alan-agius4 added a commit that referenced this issue Oct 28, 2021
With #21986 we now error when updating `@angular/` and `@nguniversal/` packages across multiple major versions. With this chnage we update `ng update` output to show the correct instructions.

Before
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 13.0.0-rc.2   ng update @angular/core --next
```

Now
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 12.2.9        ng update @angular/core@12
```

Closes #19381

(cherry picked from commit 9b32066)
alan-agius4 added a commit that referenced this issue Oct 28, 2021
With #21986 we now error when updating `@angular/` and `@nguniversal/` packages across multiple major versions. With this chnage we update `ng update` output to show the correct instructions.

Before
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 13.0.0-rc.2   ng update @angular/core --next
```

Now
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 12.2.9        ng update @angular/core@12
```

Closes #19381
alan-agius4 added a commit that referenced this issue Nov 24, 2021
With #21986 we now error when updating `@angular/` and `@nguniversal/` packages across multiple major versions. With this change we update `ng update` output to show the correct instructions.

Before
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 13.0.0-rc.2   ng update @angular/core --next
```

Now
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 12.2.9        ng update @angular/core@12
```

Closes #19381

(cherry picked from commit 9b32066)
alan-agius4 added a commit that referenced this issue Nov 24, 2021
With #21986 we now error when updating `@angular/` and `@nguniversal/` packages across multiple major versions. With this change we update `ng update` output to show the correct instructions.

Before
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 13.0.0-rc.2   ng update @angular/core --next
```

Now
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 12.2.9        ng update @angular/core@12
```

Closes #19381

(cherry picked from commit 9b32066)
alan-agius4 added a commit that referenced this issue Nov 24, 2021
With #21986 we now error when updating `@angular/` and `@nguniversal/` packages across multiple major versions. With this chnage we update `ng update` output to show the correct instructions.

Before
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 13.0.0-rc.2   ng update @angular/core --next
```

Now
```
$ ng update --next

 We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       12.2.12 -> 13.0.0-rc.2   ng update @angular/cli --next
      @angular/core                      11.2.14 -> 12.2.9        ng update @angular/core@12
```

Closes #19381

(cherry picked from commit 9b32066)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/cli feature Issue that requests a new feature ng update DX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants