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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support finishCallback and rootZoneStable in async test #32896
Comments
If we would handle the first case by introducing something like cc. @mmalerba |
Yeah if we have the first one that's sufficient for our use case in Angular Components. Though as a separate issue, it might be nice to do it automatically in |
I talked to @IgorMinar about this, he was opposed to changing how
Would also like to get @mhevery's input on this |
@mmalerba, thanks for the information.
So I think we should only support such kind of features inside
the @mhevery , @IgorMinar , please review, thanks! |
Yeah, I agree with that.
I'd personally expect no distinction between the root zone and others. Conceptually to me, the root zone is not any different to other zones, except that it just does not have any parent or spec.
Unfortunately this would not be sufficient as these interceptions are not necessarily only needed in pages using Currently we can already intercept individual zones by patching into |
Would there be a chance that ZoneJS adds logic to keep track of the tasks count regardless of whether there is a zone spec? The zone delegates already seem to have the capability to record the active tasks, but just due to the fact that the root zone does not have any spec applied, the delegate task count is not updated. This could be changed without a lot of effort, risk and performance costs I'd assume (even just an exception for the root zone delegate would be sufficient). The only problem I see here is that this is not part of any public API so it seems a little unexpected. Having a larger and public API for retrieving/intercepting the task state is most likely more heavy though and might be out-of-scope for ZoneJS. Note that adding simple APIs for intercepting, or just interposing a custom zone w/ spec is not sufficient. Those interceptors or custom zones are not guaranteed to know about tasks previously scheduled. Hence my proposal that Zone's keep track of the state internally by default. The interceptors could then register at any time without the risk of missing tasks scheduled before the interceptor initialized. |
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends. Find more details about Angular's feature request process in our documentation. |
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage. We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package. You can find more details about the feature request process in our documentation. |
@JiaLiPassion Do we plan to do anything with this? |
@jessicajaniuk , there is PR for this one, #45211, maybe we can discuss with the team whether this is still an issue in the angular component test. |
馃殌 feature request
Relevant Package
This feature request is for zone.jsDescription
A clear and concise description of the problem or missing capability...the cases is from
angular components
, the following test are from @mmalerba.For the
1st and 3rd
cases, we want some mechanism to let user to easily test the async cases.Describe the solution you'd like
If you have a solution in mind, please describe it.For the
1st case
we may need some thing likerootZoneWhenStable().then()
orasyncStable().then()
to monitor not onlyngZone
but also theasync tasks
outside ofngZone
.For the
3rd case
, we need to add an option toasync
zone spec, to let user monitor when all async are done.Describe alternatives you've considered
Have you considered any alternative solutions or workarounds?No very easy workarounds for now.
The text was updated successfully, but these errors were encountered: