Skip to content

Remove custom router state serializer#1129

Merged
brandonroberts merged 3 commits into
ngrx:masterfrom
timdeschryver:pr/example-app-router-state
Jun 23, 2018
Merged

Remove custom router state serializer#1129
brandonroberts merged 3 commits into
ngrx:masterfrom
timdeschryver:pr/example-app-router-state

Conversation

@timdeschryver

Copy link
Copy Markdown
Member

Closes #1125

@coveralls

coveralls commented Jun 13, 2018

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 87.971% when pulling 73ef601 on tdeschryver:pr/example-app-router-state into fb9b172 on ngrx:master.

Comment thread docs/router-store/api.md
During each navigation cycle, a `RouterNavigationAction` is dispatched with a snapshot of the state in its payload, the `RouterStateSnapshot`. The `RouterStateSnapshot` is a large complex structure, containing many pieces of information about the current state and what's rendered by the router. This can cause performance
issues when used with the Store Devtools. In most cases, you may only need a piece of information from the `RouterStateSnapshot`. In order to pare down the `RouterStateSnapshot` provided during navigation, you provide a custom serializer for the snapshot to only return what you need to be added to the payload and store.

Additionally, the router state snapshot is a mutable object, which can cause issues when developing with [store freeze](https://github.com/brandonroberts/ngrx-store-freeze) to prevent direct state mutations. This can be avoided by using a custom serializer.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is still true. We just provide a serializable-safe option out of the box.

@brandonroberts brandonroberts merged commit 389cd78 into ngrx:master Jun 23, 2018
@timdeschryver timdeschryver deleted the pr/example-app-router-state branch June 23, 2018 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants