Skip to content

Async Updating #298

@brainkim

Description

@brainkim

0.7 implemented Async Mounting, which allows for SuspenseList like coordination. For maintainer sanity, async updating was not implemented so currently, this.schedule() with an async callback only works for the initial render of the component. This is because async updating introduces a whole new host of tricky edge-cases. How do we defer the unmounting of removed elements? What should happen to new updates/refresh calls? How do multiple async schedule() calls interact? Would the schedule() callback defer the updating of existing children? How do we prevent a re-rendered div child would still get its props updated before the schedule() callback fulfills, given that we have to pass the DOM node to the schedule() callback?

This might require another architectural change, where we split the process of creating DOM nodes from the process of patching/arranging them. It also might mean we get rid of the graveyard architecture, where we collect unmounting elements in an array. Instead, we would make mark all unmounted nodes as requiring cleanup, and do the cleanup after the scheduling pass.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions