|
| 1 | +<a name="19.0.0-beta.0""></a> |
| 2 | + |
| 3 | +# [19.0.0-beta.0"](https://github.com/ngrx/platform/compare/18.1.1...19.0.0-beta.0") (2024-11-20) |
| 4 | + |
| 5 | +### Features |
| 6 | + |
| 7 | +- **schematics:** change standalone default to true for components ([#4569](https://github.com/ngrx/platform/issues/4569)) ([c7d0ce6](https://github.com/ngrx/platform/commit/c7d0ce6)) |
| 8 | +- **signals:** rename `rxMethod.unsubscribe` to `destroy` ([#4584](https://github.com/ngrx/platform/issues/4584)) ([57ad5c5](https://github.com/ngrx/platform/commit/57ad5c5)) |
| 9 | +- **signals:** throw error in dev mode on state mutation ([#4526](https://github.com/ngrx/platform/issues/4526)) ([7a84209](https://github.com/ngrx/platform/commit/7a84209)) |
| 10 | + |
| 11 | +### BREAKING CHANGES |
| 12 | + |
| 13 | +- **signals:** The `signalState`/`signalStore` state object is frozen in development mode. |
| 14 | + If a mutable change occurs to the state object, an error will be thrown. |
| 15 | + |
| 16 | +BEFORE: |
| 17 | + |
| 18 | +```ts |
| 19 | +const userState = signalState(initialState); |
| 20 | +patchState(userState, (state) => { |
| 21 | + state.user.firstName = 'mutable change'; // mutable change which went through |
| 22 | + return state; |
| 23 | +}); |
| 24 | +``` |
| 25 | + |
| 26 | +AFTER: |
| 27 | + |
| 28 | +```ts |
| 29 | +const userState = signalState(initialState); |
| 30 | +patchState(userState, (state) => { |
| 31 | + state.user.firstName = 'mutable change'; // throws in dev mode |
| 32 | + return state; |
| 33 | +}); |
| 34 | +``` |
| 35 | + |
| 36 | +- **signals:** The `unsubscribe` method from `rxMethod` is renamed to `destroy`. |
| 37 | + |
| 38 | +BEFORE: |
| 39 | + |
| 40 | +```ts |
| 41 | +const logNumber = rxMethod<number>(tap(console.log)); |
| 42 | + |
| 43 | +const num1Ref = logNumber(interval(1_000)); |
| 44 | +const num2Ref = logNumber(interval(2_000)); |
| 45 | + |
| 46 | +// destroy `num1Ref` after 2 seconds |
| 47 | +setTimeout(() => num1Ref.unsubscribe(), 2_000); |
| 48 | + |
| 49 | +// destroy all reactive method refs after 5 seconds |
| 50 | +setTimeout(() => logNumber.unsubscribe(), 5_000); |
| 51 | +``` |
| 52 | + |
| 53 | +AFTER: |
| 54 | + |
| 55 | +```ts |
| 56 | +const logNumber = rxMethod<number>(tap(console.log)); |
| 57 | + |
| 58 | +const num1Ref = logNumber(interval(1_000)); |
| 59 | +const num2Ref = logNumber(interval(2_000)); |
| 60 | + |
| 61 | +// destroy `num1Ref` after 2 seconds |
| 62 | +setTimeout(() => num1Ref.destroy(), 2_000); |
| 63 | + |
| 64 | +// destroy all reactive method refs after 5 seconds |
| 65 | +setTimeout(() => logNumber.destroy(), 5_000); |
| 66 | +``` |
| 67 | + |
| 68 | +- **schematics:** The default setting for generating components using schematics is updated. |
| 69 | + |
| 70 | +BEFORE: |
| 71 | + |
| 72 | +The default setting for generating components using schematics does not use standalone components. |
| 73 | + |
| 74 | +AFTER: |
| 75 | + |
| 76 | +The default setting for generating components using schematics uses standalone components. |
| 77 | + |
| 78 | +- The minimum required version of Angular has been updated. |
| 79 | + |
| 80 | +BEFORE: |
| 81 | + |
| 82 | +The minimum required version is Angular 18.x |
| 83 | + |
| 84 | +AFTER: |
| 85 | + |
| 86 | +The minimum required version is Angular 19.x |
| 87 | + |
1 | 88 | <a name="18.1.1"></a>
|
2 | 89 |
|
3 | 90 | ## [18.1.1](https://github.com/ngrx/platform/compare/18.1.0...18.1.1) (2024-10-29)
|
|
0 commit comments