-
-
Notifications
You must be signed in to change notification settings - Fork 2k
fix(component): use setTimeout instead of requestAnimationFrame for server and zoneless #4912
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for ngrx-io ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project 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.
Thanks for the PR @JelleBruisten! See the requested changes below.
It's also necessary to add a unit test and verify the fix.
497c3d1
to
e9223ec
Compare
@JelleBruisten target branch has to be |
✅ Deploy Preview for ngrx-site-v19 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
f64349d
to
ec58077
Compare
…erver and zoneless requestAnimationFrame is not available in server-side contexts and will cause errors. Using setTimeout ensures compatibility across all environments.
@markostanimirovic I rebased the branch from the main branch. |
…stead of requestAnimationFrame
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
When using either ngrxLet or ngrxPush in ssr and zoneless, the server calls
requestAnimationFrame
which does not exist in a node environment.Closes #4902
What is the new behavior?
Within a node environment ( ssr ) and zoneless we use setTimeout instead of requestAnimationFrame.
Does this PR introduce a breaking change?
Other information
I did some more testing on angular v20, when using ssr + zoneless and using a
NoopTickScheduler
it does trigger changes. I opted for not removing theNoopTickScheduler
and making big changes since@ngrx/component
is in maintenance mode.