From 0c1050a1bfe5c19d2fe0b84a39dbc13fed162fab Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Thu, 3 Nov 2022 07:50:12 -0500 Subject: [PATCH] chore: release 15.0.0-beta.0 --- CHANGELOG.md | 319 ++++++++++++++---- MIGRATION.md | 4 +- modules/component-store/package.json | 4 +- .../schematics-core/utility/libs-version.ts | 2 +- modules/component/package.json | 6 +- .../schematics-core/utility/libs-version.ts | 2 +- modules/data/package.json | 12 +- .../schematics-core/utility/libs-version.ts | 2 +- modules/effects/package.json | 6 +- .../schematics-core/utility/libs-version.ts | 2 +- modules/entity/package.json | 6 +- .../schematics-core/utility/libs-version.ts | 2 +- modules/eslint-plugin/package.json | 2 +- modules/router-store/package.json | 10 +- .../schematics-core/utility/libs-version.ts | 2 +- .../schematics-core/utility/libs-version.ts | 2 +- modules/schematics/package.json | 2 +- .../schematics-core/utility/libs-version.ts | 2 +- modules/store-devtools/package.json | 4 +- .../schematics-core/utility/libs-version.ts | 2 +- modules/store/package.json | 4 +- .../schematics-core/utility/libs-version.ts | 2 +- package.json | 2 +- .../ngrx.io/content/guide/migration/v15.md | 184 ++++++++++ projects/ngrx.io/content/navigation.json | 4 + 25 files changed, 486 insertions(+), 103 deletions(-) create mode 100644 projects/ngrx.io/content/guide/migration/v15.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c281a3535..9cf93882be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,115 +1,304 @@ - + + +# [15.0.0-beta.0](https://github.com/ngrx/platform/compare/14.3.2...15.0.0-beta.0) (2022-11-03) + +### Features + +- **component:** add migration for replacing ReactiveComponentModule ([#3506](https://github.com/ngrx/platform/issues/3506)) ([49c6cf3](https://github.com/ngrx/platform/commit/49c6cf3)), closes [#3491](https://github.com/ngrx/platform/issues/3491) +- **component:** handle observable dictionaries ([#3602](https://github.com/ngrx/platform/issues/3602)) ([42efccb](https://github.com/ngrx/platform/commit/42efccb)), closes [#3545](https://github.com/ngrx/platform/issues/3545) +- **component:** remove ReactiveComponentModule ([#3643](https://github.com/ngrx/platform/issues/3643)) ([4bdf345](https://github.com/ngrx/platform/commit/4bdf345)), closes [#3623](https://github.com/ngrx/platform/issues/3623) +- **component-store:** Add SelectorObject to `select` ([#3629](https://github.com/ngrx/platform/issues/3629)) ([f8d0241](https://github.com/ngrx/platform/commit/f8d0241)), closes [#3632](https://github.com/ngrx/platform/issues/3632) [#3631](https://github.com/ngrx/platform/issues/3631) +- **effects:** change the signature of provideEffect ([#3587](https://github.com/ngrx/platform/issues/3587)) ([899afe7](https://github.com/ngrx/platform/commit/899afe7)) +- **effects:** migration for provideEffects argument ([#3601](https://github.com/ngrx/platform/issues/3601)) ([f7dfeab](https://github.com/ngrx/platform/commit/f7dfeab)) +- **effects:** remove @Effect decorator ([#3634](https://github.com/ngrx/platform/issues/3634)) ([96c5bdd](https://github.com/ngrx/platform/commit/96c5bdd)), closes [#3617](https://github.com/ngrx/platform/issues/3617) +- **eslint-plugin:** remove rules using @Effect ([#3635](https://github.com/ngrx/platform/issues/3635)) ([5f74e61](https://github.com/ngrx/platform/commit/5f74e61)) +- **schematics:** drop support for TypeScript <4.8 ([#3631](https://github.com/ngrx/platform/issues/3631)) ([b9c1ab6](https://github.com/ngrx/platform/commit/b9c1ab6)) +- **store:** make reducers arg of StoreModule.forRoot optional ([#3632](https://github.com/ngrx/platform/issues/3632)) ([e5177aa](https://github.com/ngrx/platform/commit/e5177aa)) +- **store:** strict projector for selectors with props ([#3640](https://github.com/ngrx/platform/issues/3640)) ([351459f](https://github.com/ngrx/platform/commit/351459f)), closes [#3571](https://github.com/ngrx/platform/issues/3571) +- **store:** strict projectors ([#3581](https://github.com/ngrx/platform/issues/3581)) ([43198a2](https://github.com/ngrx/platform/commit/43198a2)), closes [#3571](https://github.com/ngrx/platform/issues/3571) + +### BREAKING CHANGES + +- **component:** `ReactiveComponentModule` is removed in favor of `LetModule` and `PushModule`. + +BEFORE: + +```ts +import { ReactiveComponentModule } from '@ngrx/component'; + +@NgModule({ + imports: [ + // ... other imports + ReactiveComponentModule, + ], +}) +export class MyFeatureModule {} +``` + +AFTER: + +```ts +import { LetModule, PushModule } from '@ngrx/component'; + +@NgModule({ + imports: [ + // ... other imports + LetModule, + PushModule, + ], +}) +export class MyFeatureModule {} +``` + +- **store:** The projector method has become strict + +BEFORE: + +You could pass any arguments to the projector method + +const selector = createSelector( +selectString, // returning a string +selectNumber, // returning a number +(s, n, prefix: string) => { +return prefix + s.repeat(n); +} +) + +// you could pass any argument +selector.projector(1, 'a', true); + +AFTER: + +const selector = createSelector( +selectString, // returning a string +selectNumber, // returning a number +(s, n, prefix: string) => { +return prefix + s.repeat(n); +} +) + +// this throws +selector.projector(1, 'a', true); +// this does not throw because the arguments have the correct type +selector.projector(1, 'a', 'prefix'); + +- **store:** The projector function on the selector is type-safe by default. + +BEFORE: + +The projector is not type-safe by default, allowing for potential mismatch types in the projector function. + +```ts +const mySelector = createSelector( + () => 'one', + () => 2, + (one, two) => 3 +); + +mySelector.projector(); // <- type is projector(...args: any[]): number +``` + +AFTER: + +The projector is strict by default, but can be bypassed with an `any` generic parameter. + +```ts +const mySelector = createSelector( + () => 'one', + () => 2, + (one, two) => 3 +); + +mySelector.projector(); // <- Results in type error. Type is projector(s1: string, s2: number): number +``` + +To retain previous behavior + +```ts +const mySelector = createSelector( + () => 'one', + () => 2, + (one, two) => 3 +)(mySelector.projector as any)(); +``` + +- **effects:** The @Effect decorator is removed + +BEFORE: + +Defining an effect is done with @Effect + +@Effect() +data$ = this.actions$.pipe(); + +AFTER: + +Defining an effect is done with createEffect + +data$ = createEffect(() => this.actions$.pipe()); + +- **effects:** The signature of `provideEffects` is changed to expect a + spreaded array of effects. + +BEFORE: + +`provideEffects` expecteded the effects to be passed as an array. + +````ts +// single effect +provideEffects([MyEffect]) + +// multiple effects +provideEffects([MyEffect, MySecondEffect]) +```ts + +AFTER: + +`provideEffects` expects the effects as a spreaded array as argument. + +```ts +// single effect +provideEffects(MyEffect) + +// multiple effects +provideEffects(MyEffect, MySecondEffect) +```ts + + + ## [14.3.2](https://github.com/ngrx/platform/compare/14.3.1...14.3.2) (2022-10-04) + ### Bug Fixes -- **component:** replace animationFrameScheduler with requestAnimationFrame ([#3592](https://github.com/ngrx/platform/issues/3592)) ([0a4d2dd](https://github.com/ngrx/platform/commit/0a4d2dd)), closes [#3591](https://github.com/ngrx/platform/issues/3591) -- **component-store:** use asapScheduler to schedule lifecycle hooks check ([#3580](https://github.com/ngrx/platform/issues/3580)) ([02431b4](https://github.com/ngrx/platform/commit/02431b4)), closes [#3573](https://github.com/ngrx/platform/issues/3573) -- **eslint-plugin:** avoid-combining-selectors with arrays should warn ([#3566](https://github.com/ngrx/platform/issues/3566)) ([4b0c6de](https://github.com/ngrx/platform/commit/4b0c6de)) -- **router-store:** set undefined for unserializable route title ([#3593](https://github.com/ngrx/platform/issues/3593)) ([8eb4001](https://github.com/ngrx/platform/commit/8eb4001)), closes [#3495](https://github.com/ngrx/platform/issues/3495) -- **store:** fix typing of on fn ([#3577](https://github.com/ngrx/platform/issues/3577)) ([d054aa9](https://github.com/ngrx/platform/commit/d054aa9)), closes [#3576](https://github.com/ngrx/platform/issues/3576) +* **component:** replace animationFrameScheduler with requestAnimationFrame ([#3592](https://github.com/ngrx/platform/issues/3592)) ([0a4d2dd](https://github.com/ngrx/platform/commit/0a4d2dd)), closes [#3591](https://github.com/ngrx/platform/issues/3591) +* **component-store:** use asapScheduler to schedule lifecycle hooks check ([#3580](https://github.com/ngrx/platform/issues/3580)) ([02431b4](https://github.com/ngrx/platform/commit/02431b4)), closes [#3573](https://github.com/ngrx/platform/issues/3573) +* **eslint-plugin:** avoid-combining-selectors with arrays should warn ([#3566](https://github.com/ngrx/platform/issues/3566)) ([4b0c6de](https://github.com/ngrx/platform/commit/4b0c6de)) +* **router-store:** set undefined for unserializable route title ([#3593](https://github.com/ngrx/platform/issues/3593)) ([8eb4001](https://github.com/ngrx/platform/commit/8eb4001)), closes [#3495](https://github.com/ngrx/platform/issues/3495) +* **store:** fix typing of on fn ([#3577](https://github.com/ngrx/platform/issues/3577)) ([d054aa9](https://github.com/ngrx/platform/commit/d054aa9)), closes [#3576](https://github.com/ngrx/platform/issues/3576) - + + ## [14.3.1](https://github.com/ngrx/platform/compare/14.3.0...14.3.1) (2022-09-08) + ### Bug Fixes -- add support for TypeScript 4.8 ([#3548](https://github.com/ngrx/platform/issues/3548)) ([d558ce1](https://github.com/ngrx/platform/commit/d558ce1)), closes [#3547](https://github.com/ngrx/platform/issues/3547) -- **eslint-plugin:** avoid-mapping-selectors don't report on ThisExpression ([#3546](https://github.com/ngrx/platform/issues/3546)) ([a28175c](https://github.com/ngrx/platform/commit/a28175c)), closes [#3511](https://github.com/ngrx/platform/issues/3511) +* add support for TypeScript 4.8 ([#3548](https://github.com/ngrx/platform/issues/3548)) ([d558ce1](https://github.com/ngrx/platform/commit/d558ce1)), closes [#3547](https://github.com/ngrx/platform/issues/3547) +* **eslint-plugin:** avoid-mapping-selectors don't report on ThisExpression ([#3546](https://github.com/ngrx/platform/issues/3546)) ([a28175c](https://github.com/ngrx/platform/commit/a28175c)), closes [#3511](https://github.com/ngrx/platform/issues/3511) - + + # [14.3.0](https://github.com/ngrx/platform/compare/14.2.0...14.3.0) (2022-08-25) + ### Features -- **effects:** add provideEffects function ([#3524](https://github.com/ngrx/platform/issues/3524)) ([db35bfe](https://github.com/ngrx/platform/commit/db35bfe)), closes [#3522](https://github.com/ngrx/platform/issues/3522) -- **router-store:** add provideRouterStore function ([#3532](https://github.com/ngrx/platform/issues/3532)) ([511b7cf](https://github.com/ngrx/platform/commit/511b7cf)), closes [#3528](https://github.com/ngrx/platform/issues/3528) -- **store:** add provideStore and provideState functions for standalone APIs ([#3539](https://github.com/ngrx/platform/issues/3539)) ([5639c1e](https://github.com/ngrx/platform/commit/5639c1e)), closes [#3526](https://github.com/ngrx/platform/issues/3526) -- **store-devtools:** add provideStoreDevtools function ([#3537](https://github.com/ngrx/platform/issues/3537)) ([6b0db4e](https://github.com/ngrx/platform/commit/6b0db4e)), closes [#3527](https://github.com/ngrx/platform/issues/3527) +* **effects:** add provideEffects function ([#3524](https://github.com/ngrx/platform/issues/3524)) ([db35bfe](https://github.com/ngrx/platform/commit/db35bfe)), closes [#3522](https://github.com/ngrx/platform/issues/3522) +* **router-store:** add provideRouterStore function ([#3532](https://github.com/ngrx/platform/issues/3532)) ([511b7cf](https://github.com/ngrx/platform/commit/511b7cf)), closes [#3528](https://github.com/ngrx/platform/issues/3528) +* **store:** add provideStore and provideState functions for standalone APIs ([#3539](https://github.com/ngrx/platform/issues/3539)) ([5639c1e](https://github.com/ngrx/platform/commit/5639c1e)), closes [#3526](https://github.com/ngrx/platform/issues/3526) +* **store-devtools:** add provideStoreDevtools function ([#3537](https://github.com/ngrx/platform/issues/3537)) ([6b0db4e](https://github.com/ngrx/platform/commit/6b0db4e)), closes [#3527](https://github.com/ngrx/platform/issues/3527) - + + # [14.2.0](https://github.com/ngrx/platform/compare/14.1.0...14.2.0) (2022-08-18) + ### Bug Fixes -- **component-store:** make synchronous updater errors catchable ([#3490](https://github.com/ngrx/platform/issues/3490)) ([1a906fd](https://github.com/ngrx/platform/commit/1a906fd)) -- **component-store:** move isInitialized check to queueScheduler context on state update ([#3492](https://github.com/ngrx/platform/issues/3492)) ([53636e4](https://github.com/ngrx/platform/commit/53636e4)), closes [#2991](https://github.com/ngrx/platform/issues/2991) +* **component-store:** make synchronous updater errors catchable ([#3490](https://github.com/ngrx/platform/issues/3490)) ([1a906fd](https://github.com/ngrx/platform/commit/1a906fd)) +* **component-store:** move isInitialized check to queueScheduler context on state update ([#3492](https://github.com/ngrx/platform/issues/3492)) ([53636e4](https://github.com/ngrx/platform/commit/53636e4)), closes [#2991](https://github.com/ngrx/platform/issues/2991) + ### Features -- **component-store:** handle errors in next callback ([#3533](https://github.com/ngrx/platform/issues/3533)) ([551c8eb](https://github.com/ngrx/platform/commit/551c8eb)) +* **component-store:** handle errors in next callback ([#3533](https://github.com/ngrx/platform/issues/3533)) ([551c8eb](https://github.com/ngrx/platform/commit/551c8eb)) + - + # [14.1.0](https://github.com/ngrx/platform/compare/14.0.2...14.1.0) (2022-08-09) + ### Bug Fixes -- **eslint-plugin:** allow sequential dispatches in a different block context ([#3515](https://github.com/ngrx/platform/issues/3515)) ([faf446f](https://github.com/ngrx/platform/commit/faf446f)), closes [#3513](https://github.com/ngrx/platform/issues/3513) -- **eslint-plugin:** Remove the md suffix from the docsUrl path ([#3518](https://github.com/ngrx/platform/issues/3518)) ([71d4d4b](https://github.com/ngrx/platform/commit/71d4d4b)) -- **store:** improve error for forbidden characters in createActionGroup ([#3496](https://github.com/ngrx/platform/issues/3496)) ([398fbed](https://github.com/ngrx/platform/commit/398fbed)) +* **eslint-plugin:** allow sequential dispatches in a different block context ([#3515](https://github.com/ngrx/platform/issues/3515)) ([faf446f](https://github.com/ngrx/platform/commit/faf446f)), closes [#3513](https://github.com/ngrx/platform/issues/3513) +* **eslint-plugin:** Remove the md suffix from the docsUrl path ([#3518](https://github.com/ngrx/platform/issues/3518)) ([71d4d4b](https://github.com/ngrx/platform/commit/71d4d4b)) +* **store:** improve error for forbidden characters in createActionGroup ([#3496](https://github.com/ngrx/platform/issues/3496)) ([398fbed](https://github.com/ngrx/platform/commit/398fbed)) + ### Features -- **component:** add RenderScheduler to the public API ([#3516](https://github.com/ngrx/platform/issues/3516)) ([4642919](https://github.com/ngrx/platform/commit/4642919)) -- **component:** replace markDirty with custom TickScheduler ([#3488](https://github.com/ngrx/platform/issues/3488)) ([3fcd8af](https://github.com/ngrx/platform/commit/3fcd8af)) +* **component:** add RenderScheduler to the public API ([#3516](https://github.com/ngrx/platform/issues/3516)) ([4642919](https://github.com/ngrx/platform/commit/4642919)) +* **component:** replace markDirty with custom TickScheduler ([#3488](https://github.com/ngrx/platform/issues/3488)) ([3fcd8af](https://github.com/ngrx/platform/commit/3fcd8af)) + ### Performance Improvements -- **component:** do not schedule render for synchronous events ([#3487](https://github.com/ngrx/platform/issues/3487)) ([bb9071c](https://github.com/ngrx/platform/commit/bb9071c)) +* **component:** do not schedule render for synchronous events ([#3487](https://github.com/ngrx/platform/issues/3487)) ([bb9071c](https://github.com/ngrx/platform/commit/bb9071c)) - + + ## [14.0.2](https://github.com/ngrx/platform/compare/14.0.1...14.0.2) (2022-07-12) + ### Bug Fixes -- **component:** import operators from rxjs/operators ([#3479](https://github.com/ngrx/platform/issues/3479)) ([20ef7a4](https://github.com/ngrx/platform/commit/20ef7a4)) -- **component-store:** effect handles generics that extend upon a type ([#3485](https://github.com/ngrx/platform/issues/3485)) ([9d2bda7](https://github.com/ngrx/platform/commit/9d2bda7)), closes [#3482](https://github.com/ngrx/platform/issues/3482) -- **data:** add TSDoc annotations ([#3483](https://github.com/ngrx/platform/issues/3483)) ([cbbc49f](https://github.com/ngrx/platform/commit/cbbc49f)) -- **eslint-plugin:** fix configuration guide link ([#3480](https://github.com/ngrx/platform/issues/3480)) ([8219b1d](https://github.com/ngrx/platform/commit/8219b1d)) +* **component:** import operators from rxjs/operators ([#3479](https://github.com/ngrx/platform/issues/3479)) ([20ef7a4](https://github.com/ngrx/platform/commit/20ef7a4)) +* **component-store:** effect handles generics that extend upon a type ([#3485](https://github.com/ngrx/platform/issues/3485)) ([9d2bda7](https://github.com/ngrx/platform/commit/9d2bda7)), closes [#3482](https://github.com/ngrx/platform/issues/3482) +* **data:** add TSDoc annotations ([#3483](https://github.com/ngrx/platform/issues/3483)) ([cbbc49f](https://github.com/ngrx/platform/commit/cbbc49f)) +* **eslint-plugin:** fix configuration guide link ([#3480](https://github.com/ngrx/platform/issues/3480)) ([8219b1d](https://github.com/ngrx/platform/commit/8219b1d)) - + + ## [14.0.1](https://github.com/ngrx/platform/compare/14.0.0...14.0.1) (2022-06-29) + ### Bug Fixes -- **component-store:** allow void callbacks in effect ([#3466](https://github.com/ngrx/platform/issues/3466)) ([e6dedd6](https://github.com/ngrx/platform/commit/e6dedd6)), closes [#3462](https://github.com/ngrx/platform/issues/3462) -- **component-store:** import operators from rxjs/operators ([#3465](https://github.com/ngrx/platform/issues/3465)) ([f9ba513](https://github.com/ngrx/platform/commit/f9ba513)) -- **schematics:** add workingDirectory to schemas ([#3473](https://github.com/ngrx/platform/issues/3473)) ([50ea6b3](https://github.com/ngrx/platform/commit/50ea6b3)), closes [#3469](https://github.com/ngrx/platform/issues/3469) -- **schematics:** create schematicCollections if not exists ([#3470](https://github.com/ngrx/platform/issues/3470)) ([011cbcc](https://github.com/ngrx/platform/commit/011cbcc)) +* **component-store:** allow void callbacks in effect ([#3466](https://github.com/ngrx/platform/issues/3466)) ([e6dedd6](https://github.com/ngrx/platform/commit/e6dedd6)), closes [#3462](https://github.com/ngrx/platform/issues/3462) +* **component-store:** import operators from rxjs/operators ([#3465](https://github.com/ngrx/platform/issues/3465)) ([f9ba513](https://github.com/ngrx/platform/commit/f9ba513)) +* **schematics:** add workingDirectory to schemas ([#3473](https://github.com/ngrx/platform/issues/3473)) ([50ea6b3](https://github.com/ngrx/platform/commit/50ea6b3)), closes [#3469](https://github.com/ngrx/platform/issues/3469) +* **schematics:** create schematicCollections if not exists ([#3470](https://github.com/ngrx/platform/issues/3470)) ([011cbcc](https://github.com/ngrx/platform/commit/011cbcc)) - + + # [14.0.0](https://github.com/ngrx/platform/compare/14.0.0-rc.0...14.0.0) (2022-06-20) + ### Bug Fixes -- **component:** do not exclude falsy types from LetDirective's input type ([#3460](https://github.com/ngrx/platform/issues/3460)) ([7028adb](https://github.com/ngrx/platform/commit/7028adb)) +* **component:** do not exclude falsy types from LetDirective's input type ([#3460](https://github.com/ngrx/platform/issues/3460)) ([7028adb](https://github.com/ngrx/platform/commit/7028adb)) - + + # [14.0.0-rc.0](https://github.com/ngrx/platform/compare/14.0.0-beta.0...14.0.0-rc.0) (2022-06-08) + ### Code Refactoring -- **router-store:** change name for full router state serializer ([#3430](https://github.com/ngrx/platform/issues/3430)) ([d443f50](https://github.com/ngrx/platform/commit/d443f50)), closes [#3416](https://github.com/ngrx/platform/issues/3416) +* **router-store:** change name for full router state serializer ([#3430](https://github.com/ngrx/platform/issues/3430)) ([d443f50](https://github.com/ngrx/platform/commit/d443f50)), closes [#3416](https://github.com/ngrx/platform/issues/3416) + ### Features -- **component:** add separate modules for PushPipe and LetDirective ([#3449](https://github.com/ngrx/platform/issues/3449)) ([eacc4b4](https://github.com/ngrx/platform/commit/eacc4b4)), closes [#3341](https://github.com/ngrx/platform/issues/3341) -- **component:** deprecate ReactiveComponentModule ([#3451](https://github.com/ngrx/platform/issues/3451)) ([b4dd2c8](https://github.com/ngrx/platform/commit/b4dd2c8)) -- **eslint-plugin:** improve install flow ([#3447](https://github.com/ngrx/platform/issues/3447)) ([8ddaf60](https://github.com/ngrx/platform/commit/8ddaf60)) -- **schematics:** use schematicCollections instead of defaultCollection ([#3441](https://github.com/ngrx/platform/issues/3441)) ([5abf828](https://github.com/ngrx/platform/commit/5abf828)), closes [#3383](https://github.com/ngrx/platform/issues/3383) +* **component:** add separate modules for PushPipe and LetDirective ([#3449](https://github.com/ngrx/platform/issues/3449)) ([eacc4b4](https://github.com/ngrx/platform/commit/eacc4b4)), closes [#3341](https://github.com/ngrx/platform/issues/3341) +* **component:** deprecate ReactiveComponentModule ([#3451](https://github.com/ngrx/platform/issues/3451)) ([b4dd2c8](https://github.com/ngrx/platform/commit/b4dd2c8)) +* **eslint-plugin:** improve install flow ([#3447](https://github.com/ngrx/platform/issues/3447)) ([8ddaf60](https://github.com/ngrx/platform/commit/8ddaf60)) +* **schematics:** use schematicCollections instead of defaultCollection ([#3441](https://github.com/ngrx/platform/issues/3441)) ([5abf828](https://github.com/ngrx/platform/commit/5abf828)), closes [#3383](https://github.com/ngrx/platform/issues/3383) + ### BREAKING CHANGES -- **router-store:** The full router state serializer has been renamed. +* **router-store:** The full router state serializer has been renamed. BEFORE: @@ -119,43 +308,49 @@ AFTER: The full router state serializer is named `FullRouterStateSerializer`. A migration is provided to rename the export in affected projects. - + + # [14.0.0-beta.0](https://github.com/ngrx/platform/compare/13.1.0...14.0.0-beta.0) (2022-05-30) -- Closes #3344, #3345 ([70056a8](https://github.com/ngrx/platform/commit/70056a8)), closes [#3344](https://github.com/ngrx/platform/issues/3344) [#3345](https://github.com/ngrx/platform/issues/3345) + +* Closes #3344, #3345 ([70056a8](https://github.com/ngrx/platform/commit/70056a8)), closes [#3344](https://github.com/ngrx/platform/issues/3344) [#3345](https://github.com/ngrx/platform/issues/3345) + ### Bug Fixes -- **store:** rename template literal to string literal for createActionGroup ([#3426](https://github.com/ngrx/platform/issues/3426)) ([7d08db1](https://github.com/ngrx/platform/commit/7d08db1)) +* **store:** rename template literal to string literal for createActionGroup ([#3426](https://github.com/ngrx/platform/issues/3426)) ([7d08db1](https://github.com/ngrx/platform/commit/7d08db1)) + ### Features -- **schematics:** remove creators option ([#3311](https://github.com/ngrx/platform/issues/3311)) ([e86278a](https://github.com/ngrx/platform/commit/e86278a)) -- update Angular packages to latest v14 RC ([#3425](https://github.com/ngrx/platform/issues/3425)) ([f15dd1e](https://github.com/ngrx/platform/commit/f15dd1e)), closes [#3417](https://github.com/ngrx/platform/issues/3417) -- **component:** add error as value to LetDirective's context ([#3380](https://github.com/ngrx/platform/issues/3380)) ([6452e24](https://github.com/ngrx/platform/commit/6452e24)), closes [#3343](https://github.com/ngrx/platform/issues/3343) -- **component:** add suspense template input to LetDirective ([#3377](https://github.com/ngrx/platform/issues/3377)) ([345ee53](https://github.com/ngrx/platform/commit/345ee53)), closes [#3340](https://github.com/ngrx/platform/issues/3340) -- **component:** use global render strategy in zone-less mode ([#3379](https://github.com/ngrx/platform/issues/3379)) ([f233dae](https://github.com/ngrx/platform/commit/f233dae)), closes [#3342](https://github.com/ngrx/platform/issues/3342) -- **component-store:** add OnStoreInit and OnStateInit lifecycle hooks ([#3368](https://github.com/ngrx/platform/issues/3368)) ([0ffed02](https://github.com/ngrx/platform/commit/0ffed02)), closes [#3335](https://github.com/ngrx/platform/issues/3335) -- **eslint-plugin:** add NgRx ESLint Plugin ([#3373](https://github.com/ngrx/platform/issues/3373)) ([ae0041b](https://github.com/ngrx/platform/commit/ae0041b)) -- **store:** add createActionGroup function ([#3381](https://github.com/ngrx/platform/issues/3381)) ([2cdecb3](https://github.com/ngrx/platform/commit/2cdecb3)), closes [#3337](https://github.com/ngrx/platform/issues/3337) -- **store:** install and configure the [@ngrx](https://github.com/ngrx)/eslint-plugin on ng-add ([#3386](https://github.com/ngrx/platform/issues/3386)) ([bf2672e](https://github.com/ngrx/platform/commit/bf2672e)) +* **schematics:** remove creators option ([#3311](https://github.com/ngrx/platform/issues/3311)) ([e86278a](https://github.com/ngrx/platform/commit/e86278a)) +* update Angular packages to latest v14 RC ([#3425](https://github.com/ngrx/platform/issues/3425)) ([f15dd1e](https://github.com/ngrx/platform/commit/f15dd1e)), closes [#3417](https://github.com/ngrx/platform/issues/3417) +* **component:** add error as value to LetDirective's context ([#3380](https://github.com/ngrx/platform/issues/3380)) ([6452e24](https://github.com/ngrx/platform/commit/6452e24)), closes [#3343](https://github.com/ngrx/platform/issues/3343) +* **component:** add suspense template input to LetDirective ([#3377](https://github.com/ngrx/platform/issues/3377)) ([345ee53](https://github.com/ngrx/platform/commit/345ee53)), closes [#3340](https://github.com/ngrx/platform/issues/3340) +* **component:** use global render strategy in zone-less mode ([#3379](https://github.com/ngrx/platform/issues/3379)) ([f233dae](https://github.com/ngrx/platform/commit/f233dae)), closes [#3342](https://github.com/ngrx/platform/issues/3342) +* **component-store:** add OnStoreInit and OnStateInit lifecycle hooks ([#3368](https://github.com/ngrx/platform/issues/3368)) ([0ffed02](https://github.com/ngrx/platform/commit/0ffed02)), closes [#3335](https://github.com/ngrx/platform/issues/3335) +* **eslint-plugin:** add NgRx ESLint Plugin ([#3373](https://github.com/ngrx/platform/issues/3373)) ([ae0041b](https://github.com/ngrx/platform/commit/ae0041b)) +* **store:** add createActionGroup function ([#3381](https://github.com/ngrx/platform/issues/3381)) ([2cdecb3](https://github.com/ngrx/platform/commit/2cdecb3)), closes [#3337](https://github.com/ngrx/platform/issues/3337) +* **store:** install and configure the [@ngrx](https://github.com/ngrx)/eslint-plugin on ng-add ([#3386](https://github.com/ngrx/platform/issues/3386)) ([bf2672e](https://github.com/ngrx/platform/commit/bf2672e)) + ### Performance Improvements -- **component:** reset state / trigger CD only if necessary ([#3328](https://github.com/ngrx/platform/issues/3328)) ([f5b055b](https://github.com/ngrx/platform/commit/f5b055b)) +* **component:** reset state / trigger CD only if necessary ([#3328](https://github.com/ngrx/platform/issues/3328)) ([f5b055b](https://github.com/ngrx/platform/commit/f5b055b)) + ### BREAKING CHANGES -- 1. The context of `LetDirective` is strongly typed when `null` or - `undefined` is passed as input. +* 1. The context of `LetDirective` is strongly typed when `null` or +`undefined` is passed as input. BEFORE: ```html

{{ n }}

{{ u }}

-``` +```` - The type of `n` is `any`. - The type of `u` is `any`. @@ -281,14 +476,14 @@ AFTER: BEFORE: ```ts -createSelector +createSelector; ``` AFTER: ```ts // needs to be a tuple 👇 -createSelector +createSelector; ``` - **data:** Now both the `getWithQuery` and `getAll` methods are consistent and do set `loaded` property to true on dispatching their success actions respectively. diff --git a/MIGRATION.md b/MIGRATION.md index d4d5237617..4d5af99bae 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -1,3 +1,3 @@ -# V14 Migration guide +# V15 Migration guide -This document has been moved to https://ngrx.io/guide/migration/v14. +This document has been moved to https://ngrx.io/guide/migration/v15. diff --git a/modules/component-store/package.json b/modules/component-store/package.json index 6021e7680d..8a5c7012d4 100644 --- a/modules/component-store/package.json +++ b/modules/component-store/package.json @@ -1,6 +1,6 @@ { "name": "@ngrx/component-store", - "version": "14.3.2", + "version": "15.0.0-beta.0", "description": "Reactive store for component state", "repository": { "type": "git", @@ -22,7 +22,7 @@ }, "homepage": "https://github.com/ngrx/platform#readme", "peerDependencies": { - "@angular/core": "^14.0.0", + "@angular/core": "^15.0.0-rc.0", "rxjs": "^6.5.3 || ^7.5.0" }, "schematics": "./schematics/collection.json", diff --git a/modules/component-store/schematics-core/utility/libs-version.ts b/modules/component-store/schematics-core/utility/libs-version.ts index a8f1aba471..a61e6397ce 100644 --- a/modules/component-store/schematics-core/utility/libs-version.ts +++ b/modules/component-store/schematics-core/utility/libs-version.ts @@ -1 +1 @@ -export const platformVersion = '^14.3.2'; +export const platformVersion = '^15.0.0-beta.0'; diff --git a/modules/component/package.json b/modules/component/package.json index 8172b7b051..dd2ec4b481 100644 --- a/modules/component/package.json +++ b/modules/component/package.json @@ -1,6 +1,6 @@ { "name": "@ngrx/component", - "version": "14.3.2", + "version": "15.0.0-beta.0", "description": "Reactive Extensions for Angular Components", "repository": { "type": "git", @@ -20,8 +20,8 @@ }, "homepage": "https://github.com/ngrx/platform#readme", "peerDependencies": { - "@angular/common": "^14.0.0", - "@angular/core": "^14.0.0", + "@angular/common": "^15.0.0-rc.0", + "@angular/core": "^15.0.0-rc.0", "rxjs": "^6.5.3 || ^7.5.0" }, "schematics": "./schematics/collection.json", diff --git a/modules/component/schematics-core/utility/libs-version.ts b/modules/component/schematics-core/utility/libs-version.ts index a8f1aba471..a61e6397ce 100644 --- a/modules/component/schematics-core/utility/libs-version.ts +++ b/modules/component/schematics-core/utility/libs-version.ts @@ -1 +1 @@ -export const platformVersion = '^14.3.2'; +export const platformVersion = '^15.0.0-beta.0'; diff --git a/modules/data/package.json b/modules/data/package.json index 965d423595..8543451708 100644 --- a/modules/data/package.json +++ b/modules/data/package.json @@ -1,6 +1,6 @@ { "name": "@ngrx/data", - "version": "14.3.2", + "version": "15.0.0-beta.0", "description": "API management for NgRx", "repository": { "type": "git", @@ -20,11 +20,11 @@ }, "homepage": "https://github.com/ngrx/platform#readme", "peerDependencies": { - "@angular/common": "^14.0.0", - "@angular/core": "^14.0.0", - "@ngrx/store": "14.3.2", - "@ngrx/effects": "14.3.2", - "@ngrx/entity": "14.3.2", + "@angular/common": "^15.0.0-rc.0", + "@angular/core": "^15.0.0-rc.0", + "@ngrx/store": "15.0.0-beta.0", + "@ngrx/effects": "15.0.0-beta.0", + "@ngrx/entity": "15.0.0-beta.0", "rxjs": "^6.5.3 || ^7.5.0" }, "schematics": "./schematics/collection.json", diff --git a/modules/data/schematics-core/utility/libs-version.ts b/modules/data/schematics-core/utility/libs-version.ts index a8f1aba471..a61e6397ce 100644 --- a/modules/data/schematics-core/utility/libs-version.ts +++ b/modules/data/schematics-core/utility/libs-version.ts @@ -1 +1 @@ -export const platformVersion = '^14.3.2'; +export const platformVersion = '^15.0.0-beta.0'; diff --git a/modules/effects/package.json b/modules/effects/package.json index c3bd5f7b13..71259f844c 100644 --- a/modules/effects/package.json +++ b/modules/effects/package.json @@ -1,6 +1,6 @@ { "name": "@ngrx/effects", - "version": "14.3.2", + "version": "15.0.0-beta.0", "description": "Side effect model for @ngrx/store", "repository": { "type": "git", @@ -21,8 +21,8 @@ }, "homepage": "https://github.com/ngrx/platform#readme", "peerDependencies": { - "@angular/core": "^14.0.0", - "@ngrx/store": "14.3.2", + "@angular/core": "^15.0.0-rc.0", + "@ngrx/store": "15.0.0-beta.0", "rxjs": "^6.5.3 || ^7.5.0" }, "schematics": "./schematics/collection.json", diff --git a/modules/effects/schematics-core/utility/libs-version.ts b/modules/effects/schematics-core/utility/libs-version.ts index a8f1aba471..a61e6397ce 100644 --- a/modules/effects/schematics-core/utility/libs-version.ts +++ b/modules/effects/schematics-core/utility/libs-version.ts @@ -1 +1 @@ -export const platformVersion = '^14.3.2'; +export const platformVersion = '^15.0.0-beta.0'; diff --git a/modules/entity/package.json b/modules/entity/package.json index 0427d73aaf..fc35233e99 100644 --- a/modules/entity/package.json +++ b/modules/entity/package.json @@ -1,6 +1,6 @@ { "name": "@ngrx/entity", - "version": "14.3.2", + "version": "15.0.0-beta.0", "description": "Common utilities for entity reducers", "repository": { "type": "git", @@ -20,8 +20,8 @@ }, "homepage": "https://github.com/ngrx/platform#readme", "peerDependencies": { - "@angular/core": "^14.0.0", - "@ngrx/store": "14.3.2", + "@angular/core": "^15.0.0-rc.0", + "@ngrx/store": "15.0.0-beta.0", "rxjs": "^6.5.3 || ^7.5.0" }, "schematics": "./schematics/collection.json", diff --git a/modules/entity/schematics-core/utility/libs-version.ts b/modules/entity/schematics-core/utility/libs-version.ts index a8f1aba471..a61e6397ce 100644 --- a/modules/entity/schematics-core/utility/libs-version.ts +++ b/modules/entity/schematics-core/utility/libs-version.ts @@ -1 +1 @@ -export const platformVersion = '^14.3.2'; +export const platformVersion = '^15.0.0-beta.0'; diff --git a/modules/eslint-plugin/package.json b/modules/eslint-plugin/package.json index 829eca42bd..5d06cf1ff9 100644 --- a/modules/eslint-plugin/package.json +++ b/modules/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@ngrx/eslint-plugin", - "version": "14.3.2", + "version": "15.0.0-beta.0", "description": "NgRx ESLint Plugin", "repository": { "type": "git", diff --git a/modules/router-store/package.json b/modules/router-store/package.json index 2bba261d52..54001a5fb1 100644 --- a/modules/router-store/package.json +++ b/modules/router-store/package.json @@ -1,6 +1,6 @@ { "name": "@ngrx/router-store", - "version": "14.3.2", + "version": "15.0.0-beta.0", "description": "Bindings to connect @angular/router to @ngrx/store", "repository": { "type": "git", @@ -20,10 +20,10 @@ }, "homepage": "https://github.com/ngrx/platform#readme", "peerDependencies": { - "@angular/common": "^14.0.0", - "@angular/core": "^14.0.0", - "@angular/router": "^14.0.0", - "@ngrx/store": "14.3.2", + "@angular/common": "^15.0.0-rc.0", + "@angular/core": "^15.0.0-rc.0", + "@angular/router": "^15.0.0-rc.0", + "@ngrx/store": "15.0.0-beta.0", "rxjs": "^6.5.3 || ^7.5.0" }, "schematics": "./schematics/collection.json", diff --git a/modules/router-store/schematics-core/utility/libs-version.ts b/modules/router-store/schematics-core/utility/libs-version.ts index a8f1aba471..a61e6397ce 100644 --- a/modules/router-store/schematics-core/utility/libs-version.ts +++ b/modules/router-store/schematics-core/utility/libs-version.ts @@ -1 +1 @@ -export const platformVersion = '^14.3.2'; +export const platformVersion = '^15.0.0-beta.0'; diff --git a/modules/schematics-core/utility/libs-version.ts b/modules/schematics-core/utility/libs-version.ts index a8f1aba471..a61e6397ce 100644 --- a/modules/schematics-core/utility/libs-version.ts +++ b/modules/schematics-core/utility/libs-version.ts @@ -1 +1 @@ -export const platformVersion = '^14.3.2'; +export const platformVersion = '^15.0.0-beta.0'; diff --git a/modules/schematics/package.json b/modules/schematics/package.json index 14a04717c7..500e23f46e 100644 --- a/modules/schematics/package.json +++ b/modules/schematics/package.json @@ -1,6 +1,6 @@ { "name": "@ngrx/schematics", - "version": "14.3.2", + "version": "15.0.0-beta.0", "description": "NgRx Schematics for Angular", "repository": { "type": "git", diff --git a/modules/schematics/schematics-core/utility/libs-version.ts b/modules/schematics/schematics-core/utility/libs-version.ts index a8f1aba471..a61e6397ce 100644 --- a/modules/schematics/schematics-core/utility/libs-version.ts +++ b/modules/schematics/schematics-core/utility/libs-version.ts @@ -1 +1 @@ -export const platformVersion = '^14.3.2'; +export const platformVersion = '^15.0.0-beta.0'; diff --git a/modules/store-devtools/package.json b/modules/store-devtools/package.json index 465351f782..c444735851 100644 --- a/modules/store-devtools/package.json +++ b/modules/store-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@ngrx/store-devtools", - "version": "14.3.2", + "version": "15.0.0-beta.0", "description": "Developer tools for @ngrx/store", "repository": { "type": "git", @@ -20,7 +20,7 @@ }, "homepage": "https://github.com/ngrx/platform#readme", "peerDependencies": { - "@ngrx/store": "14.3.2", + "@ngrx/store": "15.0.0-beta.0", "rxjs": "^6.5.3 || ^7.5.0" }, "schematics": "./schematics/collection.json", diff --git a/modules/store-devtools/schematics-core/utility/libs-version.ts b/modules/store-devtools/schematics-core/utility/libs-version.ts index a8f1aba471..a61e6397ce 100644 --- a/modules/store-devtools/schematics-core/utility/libs-version.ts +++ b/modules/store-devtools/schematics-core/utility/libs-version.ts @@ -1 +1 @@ -export const platformVersion = '^14.3.2'; +export const platformVersion = '^15.0.0-beta.0'; diff --git a/modules/store/package.json b/modules/store/package.json index e66e830dc0..334ff11f79 100644 --- a/modules/store/package.json +++ b/modules/store/package.json @@ -1,6 +1,6 @@ { "name": "@ngrx/store", - "version": "14.3.2", + "version": "15.0.0-beta.0", "description": "RxJS powered Redux for Angular apps", "repository": { "type": "git", @@ -21,7 +21,7 @@ }, "homepage": "https://github.com/ngrx/platform#readme", "peerDependencies": { - "@angular/core": "^14.0.0", + "@angular/core": "^15.0.0-rc.0", "rxjs": "^6.5.3 || ^7.5.0" }, "schematics": "./schematics/collection.json", diff --git a/modules/store/schematics-core/utility/libs-version.ts b/modules/store/schematics-core/utility/libs-version.ts index a8f1aba471..a61e6397ce 100644 --- a/modules/store/schematics-core/utility/libs-version.ts +++ b/modules/store/schematics-core/utility/libs-version.ts @@ -1 +1 @@ -export const platformVersion = '^14.3.2'; +export const platformVersion = '^15.0.0-beta.0'; diff --git a/package.json b/package.json index c1ce53c8bc..74545b33a0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ngrx/platform", - "version": "14.3.2", + "version": "15.0.0-beta.0", "description": "monorepo for ngrx development", "scripts": { "ng": "ng", diff --git a/projects/ngrx.io/content/guide/migration/v15.md b/projects/ngrx.io/content/guide/migration/v15.md new file mode 100644 index 0000000000..eca4bb4cfd --- /dev/null +++ b/projects/ngrx.io/content/guide/migration/v15.md @@ -0,0 +1,184 @@ +# V15 Update Guide + +## Angular CLI update + +NgRx supports using the Angular CLI `ng update` command to update your dependencies. Migration schematics are run to make the upgrade smoother. These schematics will fix some of the breaking changes. + +To update your packages to the latest released version, run the command below. + +```sh +ng update @ngrx/store@15 +``` + +## Dependencies + +Version 15 has the minimum version requirements: + +- Angular version 15.x +- Angular CLI version 15.x +- TypeScript version 4.8.x +- RxJS version ^6.5.3 || ^7.5.0 + +## Breaking changes + +### @ngrx/store + +The projector function on the selector is type-safe by default. + +BEFORE: + +The projector is not type-safe by default, allowing for potential mismatch types in the projector function. + +```ts +const mySelector = createSelector( + () => 'one', + () => 2, + (one, two) => 3 +) + +mySelector.projector() // <- type is projector(...args: any[]): number +``` + +AFTER: + +The projector is strict by default, but can be bypassed with an `any` generic parameter. + +```ts +const mySelector = createSelector( + () => 'one', + () => 2, + (one, two) => 3 +) + +mySelector.projector() // <- Results in type error. Type is projector(s1: string, s2: number): number +``` + +To retain previous behavior + +```ts +const mySelector = createSelector( + () => 'one', + () => 2, + (one, two) => 3 +) + +(mySelector.projector as any)() +``` + +The projector method has become strict for selectors with props + +BEFORE: + +You could pass any arguments to the projector method + +```ts +const selector = createSelector( + selectString, // returning a string + selectNumber, // returning a number + (s, n, prefix: string) => { + return prefix + s.repeat(n); + } +) + +// you could pass any argument +selector.projector(1, 'a', true); +``` + +AFTER: + +```ts +const selector = createSelector( + selectString, // returning a string + selectNumber, // returning a number + (s, n, prefix: string) => { + return prefix + s.repeat(n); + } +) + +// this throws +selector.projector(1, 'a', true); +// this does not throw because the arguments have the correct type +selector.projector(1, 'a', 'prefix'); +``` + +### @ngrx/effects + +The @Effect decorator is removed + +BEFORE: + +Defining an effect is done with @Effect + +```ts +@Effect() +data$ = this.actions$.pipe(); +``` + +A migration was added in the v13 release to upgrade existing codebases to the `createEffect` function. + +AFTER: + +Defining an effect is done with createEffect + +```ts +data$ = createEffect(() => this.actions$.pipe()); +``` + +The signature of `provideEffects` is changed to expect a +spreaded array of effects. + +BEFORE: + +`provideEffects` expected the effects to be passed as an array. + +```ts +// single effect +provideEffects([MyEffect]) + +// multiple effects +provideEffects([MyEffect, MySecondEffect]) +```ts + +AFTER: + +`provideEffects` expects the effects as a spreaded array as argument. + +```ts +// single effect +provideEffects(MyEffect) + +// multiple effects +provideEffects(MyEffect, MySecondEffect) +``` + +## @ngrx/component + + `ReactiveComponentModule` is removed in favor of `LetModule` and `PushModule`. + +BEFORE: + +```ts +import { ReactiveComponentModule } from '@ngrx/component'; + +@NgModule({ + imports: [ + // ... other imports + ReactiveComponentModule, + ], +}) +export class MyFeatureModule {} +``` + +AFTER: + +```ts +import { LetModule, PushModule } from '@ngrx/component'; + +@NgModule({ + imports: [ + // ... other imports + LetModule, + PushModule, + ], +}) +export class MyFeatureModule {} diff --git a/projects/ngrx.io/content/navigation.json b/projects/ngrx.io/content/navigation.json index 6fdd39cda2..09c8c00d68 100644 --- a/projects/ngrx.io/content/navigation.json +++ b/projects/ngrx.io/content/navigation.json @@ -501,6 +501,10 @@ { "title": "Migrations", "children": [ + { + "title": "V15", + "url": "guide/migration/v15" + }, { "title": "V14", "url": "guide/migration/v14"