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

docs: update v19 migration guide to contain instruction about upgrading @ngrx/signals #4682

Open
2 tasks
jakehockey10 opened this issue Jan 22, 2025 · 3 comments
Labels
Accepting PRs Comp: Docs Good First Issue Good issue for first-time contributor

Comments

@jakehockey10
Copy link

Which @ngrx/* package(s) are the source of the bug?

signals

Minimal reproduction of the bug/regression with instructions

When using @ngrx/signals in an Angular application (v18) and using ng update to upgrade to version 19, it is reported that @ngrx/store is in need of update. If you run ng update @ngrx/store like the tool suggests, but you don't have this in your package.json, you rightfully get an error saying that @ngrx/store is not a dependency. You can fix this by running ng update @ngrx/signals, but I think if that's the library you are using, the ng update command should not tell you to update @ngrx/store.

Also, when you run this update, the migration fails:

[error] Error: Cannot find module '@angular-devkit/core'
Require stack:
- C:\Users\jsmith\source\repos\Navajo.Importables\navajo-data\node_modules\@ngrx\signals\schematics-core\utility\find-component.js
- C:\Users\jsmith\source\repos\Navajo.Importables\navajo-data\node_modules\@ngrx\signals\schematics-core\index.js
- C:\Users\jsmith\source\repos\Navajo.Importables\navajo-data\node_modules\@ngrx\signals\migrations\18_0_0-rc_3-protected-state\index.js
- C:\Users\jsmith\AppData\Local\Temp\angular-cli-packages-XXXXXXFNVdtw\node_modules\@angular-devkit\schematics\tools\export-ref.js
- C:\Users\jsmith\AppData\Local\Temp\angular-cli-packages-XXXXXXFNVdtw\node_modules\@angular-devkit\schematics\tools\index.js
- C:\Users\jsmith\AppData\Local\Temp\angular-cli-packages-XXXXXXFNVdtw\node_modules\@angular\cli\src\commands\update\cli.js
- C:\Users\jsmith\AppData\Local\Temp\angular-cli-packages-XXXXXXFNVdtw\node_modules\@angular\cli\src\commands\command-config.js
- C:\Users\jsmith\AppData\Local\Temp\angular-cli-packages-XXXXXXFNVdtw\node_modules\@angular\cli\src\command-builder\command-runner.js
- C:\Users\jsmith\AppData\Local\Temp\angular-cli-packages-XXXXXXFNVdtw\node_modules\@angular\cli\lib\cli\index.js
- C:\Users\jsmith\AppData\Local\Temp\angular-cli-packages-XXXXXXFNVdtw\node_modules\@angular\cli\lib\init.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Module._load (node:internal/modules/cjs/loader:986:27)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (C:\Users\jsmith\source\repos\Navajo.Importables\navajo-data\node_modules\@ngrx\signals\schematics-core\utility\find-component.js:13:14)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)

Expected behavior

When @ngrx/signals is a dependency, and an update is available, ng update should suggest running ng update @ngrx/signals instead of ng update @ngrx/store

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)

NgRx, Angular: 18

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
@markostanimirovic
Copy link
Member

V19 Migration Guide should be updated by adding the instruction for ng update @ngrx/signals@19 similar to the section from the official NgRx v19 blog post

Image

If anyone is interested to update the v19 migration guide, we're accepting PRs.

@markostanimirovic markostanimirovic added Comp: Docs Accepting PRs Good First Issue Good issue for first-time contributor labels Jan 22, 2025
@markostanimirovic markostanimirovic changed the title @ngrx/signals reports @ngrx/store needs update on ng update docs: update v19 migration guide to contain instruction about upgrading @ngrx/signals Jan 22, 2025
@timdeschryver
Copy link
Member

@markostanimirovic I think the issue is that the ng update commands shows the invalid command.

If a project only uses @ngrx/signals, then the ng update command should mention @ngrx/store.
I think we should we split both commands.

Image

@brandonroberts
Copy link
Member

For the @ngrx/signals package, we may need to move it to the top of the list in the packageGroup in the package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepting PRs Comp: Docs Good First Issue Good issue for first-time contributor
Projects
None yet
Development

No branches or pull requests

4 participants