You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
The only way to schedule a macrotask is by using setTimeout, and even that isn't a guaranteed to be executed immediately (ready: before frame) on iOS.
Here's an example (for some reason playground is not saving the new version, so comment the last setTimeout of home.component.ts` or you'll freeze for a few seconds at the home page): https://play.nativescript.org/?template=play-ng&id=B4UY5b&v=2
What is the new behavior?
Defines a proper scheduler for macroTasks by queuing a task on the main thread) that will run after all microTasks have ran. requestAnimationFrame is now in a macroTask to mimic web behavior (this is necessary because angular will use requestAnimationFrame to schedule it's change detection).
Looking for input in error handling and if we should schedule multiple tasks instead of scheduling one and iterating through the callbacks.
Updated to latest master. As soon as we settle on error handling this is good to go.
Might be worth mentioning that setTimeout(fn,0) will run afterqueueMacrotask on iOS as it uses timers. On android setTimeout(fn,0) has the same priority as queueMacrotask (whichever gets scheduled first runs first).
@edusperoni@NathanWalker I know this PR was approved, but it causes 2 errors.
Inside animation-frame and macro-task modules, a bad import of trace module is used.
Should change from this: import { Trace } from 'trace';
to this: import { Trace } from '../trace';
@dimitrisrk@NathanWalker created a PR #9027.
I think it should be a good thing for you to always run the automated app when approving a PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cla: yesready for testTSC needs to test this and confirm against live production apps and automated test suites
5 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
What is the current behavior?
The only way to schedule a macrotask is by using
setTimeout, and even that isn't a guaranteed to be executed immediately (ready: before frame) on iOS.Here's an example (for some reason playground is not saving the new version, so comment the last
setTimeoutof home.component.ts` or you'll freeze for a few seconds at the home page): https://play.nativescript.org/?template=play-ng&id=B4UY5b&v=2What is the new behavior?
Defines a proper scheduler for macroTasks by queuing a task on the main thread) that will run after all microTasks have ran. requestAnimationFrame is now in a macroTask to mimic web behavior (this is necessary because angular will use
requestAnimationFrameto schedule it's change detection).Looking for input in error handling and if we should schedule multiple tasks instead of scheduling one and iterating through the callbacks.