diff --git a/modules/router-store/src/router_store_module.ts b/modules/router-store/src/router_store_module.ts index 74f82a8abd..3ee2d58bfc 100644 --- a/modules/router-store/src/router_store_module.ts +++ b/modules/router-store/src/router_store_module.ts @@ -49,8 +49,8 @@ export type StateKeyOrSelector< > = string | Selector>; /** - * Full = Serializes the router event with FullRouterStateSerializer * Minimal = Serializes the router event with MinimalRouterStateSerializer + * Full = Serializes the router event with FullRouterStateSerializer */ export const enum RouterState { Full, @@ -72,8 +72,8 @@ export interface StoreRouterConfig< navigationActionTiming?: NavigationActionTiming; /** * Decides which router serializer should be used, if there is none provided, and the metadata on the dispatched @ngrx/router-store action payload. - * Set to `Full` to use the `FullRouterStateSerializer` and to set the angular router events as payload. * Set to `Minimal` to use the `MinimalRouterStateSerializer` and to set a minimal router event with the navigation id and url as payload. + * Set to `Full` to use the `FullRouterStateSerializer` and to set the angular router events as payload. */ routerState?: RouterState; } @@ -213,8 +213,7 @@ export class StoreRouterConnectingModule { 'with the FullRouterStateSerializer. The FullRouterStateSerializer ' + 'has an unserializable router state and actions that are not serializable. ' + 'To use the serializability runtime checks either use ' + - 'the MinimalRouterStateSerializer or implement a custom router state serializer. ' + - 'This also applies to Ivy with immutability runtime checks.' + 'the MinimalRouterStateSerializer or implement a custom router state serializer.' ); } diff --git a/modules/router-store/src/serializers/full_serializer.ts b/modules/router-store/src/serializers/full_serializer.ts index 139a086f91..76f7b8dc77 100644 --- a/modules/router-store/src/serializers/full_serializer.ts +++ b/modules/router-store/src/serializers/full_serializer.ts @@ -6,9 +6,6 @@ export interface SerializedRouterStateSnapshot extends BaseRouterStoreState { url: string; } -/** - * @deprecated The FullRouterStateSerializer cannot be used when serializability runtime checks are enabled. Use the {@link MinimalRouterStateSerializer} or a {@link https://ngrx.io/guide/router-store/configuration#custom-router-state-serializer custom serializer} instead. - */ export class FullRouterStateSerializer implements RouterStateSerializer { diff --git a/projects/ngrx.io/content/guide/router-store/configuration.md b/projects/ngrx.io/content/guide/router-store/configuration.md index e559378a14..960cd7a405 100644 --- a/projects/ngrx.io/content/guide/router-store/configuration.md +++ b/projects/ngrx.io/content/guide/router-store/configuration.md @@ -101,7 +101,7 @@ This property decides which router serializer should be used. If there is a cust ### RouterState.Minimal -`RouterState.Minimal` will use the `MinimalRouterStateSerializer` serializer to serialize the Angular Router's `RouterState` and `RouterEvent`. +`RouterState.Minimal` uses the `MinimalRouterStateSerializer` serializer to serialize the Angular Router's `RouterState` and `RouterEvent`. The difference between `FullRouterStateSerializer` and the `MinimalRouterStateSerializer` is that this serializer is fully serializable. To make the state and the actions serializable, the properties `paramMap`, `queryParamMap` and `component` are ignored. @@ -113,9 +113,9 @@ StoreRouterConnectingModule.forRoot({ ### RouterState.Full -When this property is set to `RouterState.Full`, `@ngrx/router-store` will use the `FullRouterStateSerializer` serializer to serialize the Angular router event. +When this property is set to `RouterState.Full`, `@ngrx/router-store` uses the `FullRouterStateSerializer` serializer to serialize the Angular router event. -The metadata on the action will contain the Angular router event, e.g. `NavigationStart` and `RoutesRecognized`. +The metadata on the action contains the Angular router event, e.g. `NavigationStart` and `RoutesRecognized`. StoreRouterConnectingModule.forRoot({ @@ -126,6 +126,6 @@ StoreRouterConnectingModule.forRoot({
The `FullRouterStateSerializer` cannot be used when [serializability runtime checks](guide/store/configuration/runtime-checks) are enabled. -With serializability runtime checks enabled, the `MinimalRouterStateSerializer` serializer **must** be used. This also applies to Ivy with immutability runtime checks. +With serializability runtime checks enabled, the `MinimalRouterStateSerializer` serializer **must** be used.
diff --git a/projects/ngrx.io/content/guide/store/configuration/runtime-checks.md b/projects/ngrx.io/content/guide/store/configuration/runtime-checks.md index ce8bd8e131..c827d1d701 100644 --- a/projects/ngrx.io/content/guide/store/configuration/runtime-checks.md +++ b/projects/ngrx.io/content/guide/store/configuration/runtime-checks.md @@ -40,7 +40,6 @@ export class AppModule {}
The serializability runtime checks cannot be enabled if you use `@ngrx/router-store` with the `FullRouterStateSerializer`. The [full serializer](guide/router-store/configuration) has an unserializable router state and actions that are not serializable. To use the serializability runtime checks either use the `MinimalRouterStateSerializer` or implement a custom router state serializer. -This also applies to Ivy with immutability runtime checks.