reactive-python / reactpy

It's React, but in Python
https://reactpy.dev
MIT License
7.89k stars 317 forks source link

De-duplicate async renders #1201

Open Archmonger opened 9 months ago

Archmonger commented 9 months ago

Current Situation

This change now allow renders to take place concurrently. To keep things simple, no effort is made to deduplicate renders. For example, if parent and child components are scheduled to render at the same time, both scheduled renders will take place even though a single render of the parent component would be sufficient to update the view.

Proposed Actions

Attempt to de-duplicate renders. This can either occur in one of two ways

  1. Checking if a parent element is already in the render queue.
  2. Removing child elements from the render queue after a successful render.

The direction we go in will depend on which one can be written in a more performant manner.