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

use schematicCollections instead of defaultCollection #3383

Closed
1 of 2 tasks
timdeschryver opened this issue Apr 19, 2022 · 10 comments · Fixed by #3441
Closed
1 of 2 tasks

use schematicCollections instead of defaultCollection #3383

timdeschryver opened this issue Apr 19, 2022 · 10 comments · Fixed by #3441
Labels
14.x Accepting PRs community watch Someone from the community is working this issue/PR Good First Issue Good issue for first-time contributor Project: Schematics

Comments

@timdeschryver
Copy link
Member

Information

In Angular 14, the defaultCollection is deprecated in favor of schematicCollections, which supports an array of schematics (instead of a single one).
We should update the NgRx schematics to add the ngrx schematics to the collection, instead of overwriting the defaultCollection option.

See angular/angular-cli#22860 for more info.

The code that does this is located at https://github.com/ngrx/platform/blob/master/modules/schematics/src/ng-add/index.ts.

Describe any alternatives/workarounds you're currently using

If you want to pick this issue up, please add a comment below :)

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

  • Yes
  • No
@suke
Copy link
Contributor

suke commented May 15, 2022

May I work on this issue?

@markostanimirovic
Copy link
Member

@suke Sure!

@markostanimirovic markostanimirovic added the community watch Someone from the community is working this issue/PR label May 16, 2022
@timdeschryver
Copy link
Member Author

@suke This can only be done once we've updated Angular to v14 (because that release includes the schematicCollections option).

@suke
Copy link
Contributor

suke commented May 17, 2022

OK! I will work on it when Angular v14 is released!

@timdeschryver
Copy link
Member Author

@suke We've updated the repo to use Angular 14, feel free to work on this.

@suke
Copy link
Contributor

suke commented May 27, 2022

@timdeschryver I would like to discuss a specification.
Should I remove the properties in schema.json and automatically add ngrx schematics to the schematicCollections?

https://github.com/ngrx/platform/blob/master/modules/schematics/src/ng-add/schema.json#L6

@timdeschryver
Copy link
Member Author

Yes, that's a good idea!
I think we could also log an error if schematicCollections is not defined within the workspace.

@suke
Copy link
Contributor

suke commented May 28, 2022

Yes, that's a good idea! I think we could also log an error if schematicCollections is not defined within the workspace.

If schematicCollections is not defined, I can create them automatically, but would you prefer to log an error?

@timdeschryver
Copy link
Member Author

I think throwing would be better, it probably means that the user didn't upgrade Angular.

@suke
Copy link
Contributor

suke commented May 28, 2022

I understand.
I'll make it a spec to throw exception!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
14.x Accepting PRs community watch Someone from the community is working this issue/PR Good First Issue Good issue for first-time contributor Project: Schematics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants