Skip to content

Commit

Permalink
feat(angular): deprecate syntax option from the ngrx generator (#11184)
Browse files Browse the repository at this point in the history
  • Loading branch information
leosvelperez committed Jul 18, 2022
1 parent edc9ce1 commit 6866122
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion docs/generated/packages/angular.json
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion docs/shared/guides/misc-ngrx.md
Expand Up @@ -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.
Expand Down
10 changes: 9 additions & 1 deletion packages/angular/src/generators/ngrx/schema.d.ts
Expand Up @@ -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';
}
3 changes: 2 additions & 1 deletion packages/angular/src/generators/ngrx/schema.json
Expand Up @@ -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",
Expand Down

1 comment on commit 6866122

@vercel
Copy link

@vercel vercel bot commented on 6866122 Jul 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx.dev

Please sign in to comment.