Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(store): enable immutability checks by default #2266

Merged

Conversation

evgenyfedorenko
Copy link
Contributor

@evgenyfedorenko evgenyfedorenko commented Nov 15, 2019

Closes #2217

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?
Store runtime immutability checks are being enabled by default with this change

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Currently immutability checks are opt in.

Closes #2217

What is the new behavior?

If state or action is mutated then there will be a run time exception thrown by default now. In order to opt out user will need to pass immutability checks set to false.

Does this PR introduce a breaking change?

[x] Yes
[] No

BREAKING CHANGE

Before
Immutability checks are opt-in.

After
Immutability checks are enabled by default. If state or action is mutated then there will be a run time exception thrown.

@evgenyfedorenko
Copy link
Contributor Author

Please let me know if there is anything else I need to add/correct.

@ngrxbot
Copy link
Collaborator

ngrxbot commented Nov 15, 2019

Preview docs changes for b78c59a at https://previews.ngrx.io/pr2266-b78c59a/

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

LGTM 👍
We should also remove the runtime checks from the schematics (https://github.com/ngrx/platform/blob/master/modules/schematics/src/store/index.ts#L75) in a separate PR.

@timdeschryver
Copy link
Member

@evgenyfedorenko could you also add a breaking change note to the PR please, you can find a template in CONTRIBUTING.MD

@evgenyfedorenko
Copy link
Contributor Author

@evgenyfedorenko could you also add a breaking change note to the PR please, you can find a template in CONTRIBUTING.MD

Done

@brandonroberts brandonroberts merged commit 1758d34 into ngrx:master Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store: enable immutability checks by default
4 participants