Closed mbostock closed 3 years ago
Would love some help testing this.
Add’l ref. a601aba88046a626@227...6c9da6fb50c966f0@349
I think we should try deploying this tomorrow.
Putting in a couple of notes on this, for future us:
The fundamental problem we’re trying to solve with this branch is an under-specified total ordering of our runtime computation graph, specifically with the interaction between the evaluation order of generators that are yielding new values continuously, and downstream cells that depend on their values.
The downstream cell may compute "synchronously" (albeit, through a promise), or asynchronously, and when it computes synchronously, we want the evaluation order to be coordinated with the yielding of its input generator, so, given:
a = {
let i = 0;
while (true) yield ++i;
}
b = a
We want our notebook to be able to observe this ordering:
Sadly, after further testing this does not appear to be doing what we want: the postcompute promise is still resolving too soon, before the transitive subtree of the generator’s outputs.
Also, our effort focused on deferring the first recompute the generator, but I suspect there’s a similar issue with subsequent recomputes.
And I’m also not entirely certain that it’s appropriate a generator to resume immediately, or if the generator should wait until the next animation frame before resuming. But changing that behavior would introduce some flickering for notebooks that currently assume yield will resume immediately (for the first yield).
Revisiting #108.
Ref. https://talk.observablehq.com/t/error-importing-d3-radial-tidy-tree/2626