-
Notifications
You must be signed in to change notification settings - Fork 5.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
Implements Tracker.Computation#flush and #run (fixes #4514) #4710
Conversation
Is it necessary to |
Tests will fail if you take it out, yes. If you trace execution through |
Oh I see. |
See alternative implementation at #4715. |
b1d893b
to
5d1e86d
Compare
Looks great! |
Thanks for the feature request! We welcome discussions about how to make Meteor better. If you haven't yet, check out our wiki page about feature requests on GitHub. I understand that this would be a useful feature, but I'm loathe to just quickly merge it without careful analysis, since it fundamentally changes the invariants about how tracker uses a queue to handle recomputations. |
So the concern is that it could no longer be taken as a given that recomputations are done in the order they were invalidated in. Well the model of understanding doesn't really change- it's still a queue, but manual line-jumping would be allowed. Perhaps if the computation were taken out of the recompute queue as well ? |
@deanius: Before we can merge your pull request, you'll need to sign the Meteor Contributor Agreement: https://contribute.meteor.com/ |
5d1e86d
to
e50b46c
Compare
Can this get merged in? |
@stubailo, could also this be merged in? ;-) |
I'd like to add a small 2c here pointing out that in general relying on Tracker re-computations to happen in an order you'd expect can lead to surprising results anyway (e.g. iron-meteor/iron-router#576 (comment)) |
Yes, but we have been using this for few months now and it does help make computations a bit more predictable. |
Oh, no I was supporting your argument and providing a counter to @glasser's point, is all. Just an anecdote of course. |
;-) |
This sounds like a good idea to me, otherwise using |
But you have to keep it in the queue because maybe the recomputation again invalidated the queue itself. There is already a check in Or are you saying that we should remove it from the queue and if it gets invalidated again it should be put at the end of the queue? That would be pretty tricky to implement? Mingling with the queue? |
No, I think you're right - I didn't look at it in enough depth. |
So it will not be rerun twice, but it will be tried to be run the second time. So the only thing I see is that if it does got invalidated in meantime again, then it will be in the original order, not in the new order. But I also even think that this is OK. From outside it will just look like the computation was run wherever was meant to be run initially. That extra "flush" somebody called on it was out of band anyway. |
I'd like to get one more pair of eyes on this to confirm that it's not going to explode some internals - perhaps @avital? |
@@ -353,6 +353,36 @@ Tracker.Computation.prototype._recompute = function () { | |||
} | |||
}; | |||
|
|||
// http://docs.meteor.com/#computation_flush |
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.
Please remove this comment as docs have been refactored.
Hey guys, We had another look at this old PR and are happy to merge it. As we have a new docs system, I've commented on the code to remove references to the old docs.meteor.com (referenced via two code comments). Please rebase this PR against the latest |
Great news. @deanius, do you have time to look into this? |
Wow, yeah @mitar, I'll make some time for it this evening. |
e50b46c
to
7c2051a
Compare
Hey @zol- you want just those 2 comments removed, right? Let me know if you want this squashed or anything. -Dean |
Yes, just those two comments removed would be great. We've had a lot of PR activity since yesterday's issue triage session so our CircleCI server is really busy. You can run |
Somebody is not paying for more parallel builds at CircleCI. ;-) |
Our tests are just like.... reallly slow. We have a lot of parallelism :/ |
Do you use my runner from Blaze? It runs all the packages in parallel. |
It's not the package tests, but the self tests which are the problem. |
Ok, one more thing to do @deanius - Can you please rebase this to be off of current
|
fcd24a3
to
aa2fedc
Compare
@zol - rebase and squash complete. |
Thanks @deanius - merged! |
Can we get a PR to vNEXT of meteor/docs for the docs part? Appreciated
|
For, #4514, this is my first pass at a core package PR, so feedback welcome!