Closed ahti closed 1 year ago
I don't recall specifically, but the parent
may be be optional because the root of the hierarchy has no parent and could hypothetically be removed.
Tested on a small project and didn't notice any regressions.
I finally found some time and started refactoring ReconcilePass.reconcile
(not quite done with that), and also fixed the empty screen when going through all the states of the reproducer and then from .a
to .b
again (nothing was inserted when a fiber that should have an element had an alternate, but the alternate didn't have an element).
There is still an issue with label content not being updated tho, which I'm going to look into next.
Fixed the stale label content as well.
The only issue left that I am aware of is the .remove
mutation with wrong parent. I've extended the test to reproduce that one, too. Oh and the reconcile
method could still be dryed a bit further.
I also changed the test renderer so that multiple changed fibers get batched like they do in real renderers. Without that, the test was kind of flaky and would randomly succeed or fail (before adding the part to reproduce the remove bug, that is).
superseeded by #542
This is what I have done so far to make the example (with a little modification) from #523 work.
Currently, things work until returning to the initial state, after which pressing the button will leave an empty screen.
Some comments in no particular order:
ReconcilePass.reconcile(_: , in:, caches:)
obviously still needs to be refactored.remove
mutation is emitted with the wrongparent
. TheDOMRenderer
doesn't use the parent, so it's not an issue there, but it does materialize with the test renderer.