From 6866122db8aaae6132af83131b2e266a3d1a4868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Mon, 18 Jul 2022 15:41:17 +0100 Subject: [PATCH] feat(angular): deprecate syntax option from the ngrx generator (#11184) --- docs/generated/packages/angular.json | 3 ++- docs/shared/guides/misc-ngrx.md | 1 - packages/angular/src/generators/ngrx/schema.d.ts | 10 +++++++++- packages/angular/src/generators/ngrx/schema.json | 3 ++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/generated/packages/angular.json b/docs/generated/packages/angular.json index 4fd3236b78c76..02c6dea1dad08 100644 --- a/docs/generated/packages/angular.json +++ b/docs/generated/packages/angular.json @@ -1467,7 +1467,8 @@ "type": "string", "enum": ["classes", "creators"], "default": "creators", - "description": "Specifies whether to use class-based or creator functions for actions, reducers, and effects." + "description": "Specifies whether to use class-based or creator functions for actions, reducers, and effects.", + "x-deprecated": "Classes syntax is deprecated and this option will be removed in v15. Creators syntax will be the default in v15 and this option will be removed." }, "useDataPersistence": { "type": "boolean", diff --git a/docs/shared/guides/misc-ngrx.md b/docs/shared/guides/misc-ngrx.md index 9323720172158..09fca980d2115 100644 --- a/docs/shared/guides/misc-ngrx.md +++ b/docs/shared/guides/misc-ngrx.md @@ -36,7 +36,6 @@ The `name` and the `--module=` arguments are required. The `no-interactive` opti The most common additional options are: - `root` - Set up the initial NgModule imports for NgRx Store, Effects, Router-Store, and Store DevTools. -- `syntax` - NgRx introduced new creator functions for actions, reducers, and effects that provide the same type-safety with less code than action classes. - `facade` - Optional. If you prefer to further encapsulate NgRx from your components, add an injectable facade. See the blog [Better State Management with Facades](https://blog.nrwl.io/nrwl-nx-6-2-angular-6-1-and-better-state-management-e139da2cd074#cb93) for details. See the [API Docs](/packages/angular/generators/ngrx) for detailed descriptions of all the available options. Also visit the [NgRx](https://ngrx.io) website for more guides and documentation about the libraries. diff --git a/packages/angular/src/generators/ngrx/schema.d.ts b/packages/angular/src/generators/ngrx/schema.d.ts index 6f9ea7273ef0d..e4d0c27512d5c 100644 --- a/packages/angular/src/generators/ngrx/schema.d.ts +++ b/packages/angular/src/generators/ngrx/schema.d.ts @@ -3,12 +3,20 @@ export interface NgRxGeneratorOptions { minimal: boolean; module: string; name: string; - useDataPersistence: boolean; barrels?: boolean; facade?: boolean; root?: boolean; skipFormat?: boolean; skipImport?: boolean; skipPackageJson?: boolean; + /** + * @deprecated This option is deprecated and will be removed in v15. + * Using the individual operators is recommended. + */ + useDataPersistence?: boolean; + /** + * @deprecated Always use the `creators` value. The `classes` syntax is + * deprecated and this option will be removed in v15. + */ syntax?: 'classes' | 'creators'; } diff --git a/packages/angular/src/generators/ngrx/schema.json b/packages/angular/src/generators/ngrx/schema.json index 679c67ab68007..ce05ac29d6f2d 100644 --- a/packages/angular/src/generators/ngrx/schema.json +++ b/packages/angular/src/generators/ngrx/schema.json @@ -61,7 +61,8 @@ "type": "string", "enum": ["classes", "creators"], "default": "creators", - "description": "Specifies whether to use class-based or creator functions for actions, reducers, and effects." + "description": "Specifies whether to use class-based or creator functions for actions, reducers, and effects.", + "x-deprecated": "Classes syntax is deprecated and this option will be removed in v15. Creators syntax will be the default in v15 and this option will be removed." }, "useDataPersistence": { "type": "boolean",