-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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-devtools): provide the ability to connect extension outside of Angular zone #3970
Conversation
✅ Deploy Preview for ngrx-io ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like with this change importing an existing state throws an error.
This should be resolved first, or this should be added to the docs.
reducer.ts:75 ERROR Error: Action '[Auth/API] Login Redirect' running outside NgZone. https://ngrx.io/guide/store/configuration/runtime-checks#strictactionwithinngzone
at inNgZoneAssert_reducer.ts:11:13
at serialization_reducer.ts:24:23
at immutability_reducer.ts:11:23
at utils.ts:139:14
at computeNextEntry (reducer.ts:72:17)
at recomputeStates (reducer.ts:122:9)
at reducer.ts:533:24
at StoreDevtools.liftedStateSubscription.liftedAction$.pipe.state (devtools.ts:96:38)
at scanInternals.js:14:21
at OperatorSubscriber._this._next (OperatorSubscribe
[state.txt](https://github.com/ngrx/platform/files/12147326/state.txt)
r.js:33:21)
handleError @ core.mjs:10072
computeNextEntry @ reducer.ts:75
recomputeStates @ reducer.ts:122
(anonymous) @ reducer.ts:533
StoreDev
[state.txt](https://github.com/ngrx/platform/files/12147295/state.txt)
tools.liftedStateSubscription.liftedAction$.pipe.state @ devtools.ts:96
You can reproduce this by running the example app and importing my export.
npx nx serve example-app
@timdeschryver thanks for checking, I haven't imported the state and haven't checked that case, I'll have a look. It actually should keep functioning seamlessly w/o breaking changes, so I'd fix it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@arturovt could this change an existing's app behavior (does this have any caveats to it)?
@timdeschryver I'll post my thoughts aloud so we can discuss the concerns which I think about:
Wdyt? |
@arturovt thanks for the elaborate answer.
The question was more about if this change could break existing application because the result of this change is that it won't trigger the CD as much as before. The other thing I was thinking about are applications that don't rely on NgZone. |
Apps which have the NgZone noopped won’t be affected since NgZone class is substituted with NoopNgZone which does nothing (just invokes callbacks directly). |
I do think that there is a possibility of this being an unexpected change in behavior from those who are including the Devtools in production, which I know there are cases of this out there. That being said, we always recommend not doing this, so we could be covered in that case. |
@brandonroberts following what you said, can we also have a |
I don't think that's necessary, but we could add that to the docs to be more clear. The other option would be to have this behind a flag, such as: provideStoreDevtools({
ngZone: 'enabled' | 'noop'
}); And have it default to |
I like that suggestion @brandonroberts 👍 |
Alright, so I should re-work the changes and add a new config property? |
@arturovt yes |
4dfbae7
to
6e181f8
Compare
e0ac856
to
e738780
Compare
…of Angular This commit updates the extension connection setup and wraps it with `runOutsideAngular` to prevent running change detection too frequently. This ensures that change detection is only triggered when all asynchronous actions have been processed. Closes ngrx#3839
message
outside of AngularThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Thanks @arturovt!
Thanks @arturovt ! |
Thanks for the fix @arturovt ! @brandonroberts @markostanimirovic @timdeschryver I think it would make sense to have |
Agreed. We can possibly land this change as part of the 17.x release and do a migration for existing apps also to keep the current behavior. |
Sounds good to me 👍 |
This commit updates the extension connection setup and wraps it with
runOutsideAngular
to prevent running change detection too frequently. This ensures that change detection is only triggered when all asynchronous actions have been processed.Closes #3839