Closed barneycarroll closed 8 years ago
It's pretty grim:
OK, progress: the saved snapshots are not static, meaning that during what should be a reversal to a historical computed view's virtual DOM output snapshot, we are in fact invoking dynamic components.
Need to ensure the view output is totally computed before saving.
Gonna try proxying m.render
and split the history logic between that and the root view trap.
I think the only reason trapped views are consuming trapped views is because of re-execution on historical patch, which would explain the infinite recursion on patch when the component is deemed missing again, and another trap consumes the previous recursive trap, ad infinitum.
Better idea: config
exposes the computed virtual DOM at render time. Use that — if root superConfig
is already an essential hook for binding live DOM then it should also be used to capture snapshots.
Patch works, but Mithril's key
implementation still seems screwy.
Fixed in c7c9b94, released in v1.1.2
As seen in this fiddle (which goes into a crazy tailspin as soon as any redraw is triggered — which looks like a Mithril
key
bug),superConfig
can end up calling asuperConfig
. I would have thought this was impossible without processing views multiple times by saving the virtual DOM tree and reprocessing it in a subsequent view.Things to test:
superConfig
s but not, one would think, a multiply recursive one this deep…config
already bound?