anthonyshort / deku

Render interfaces using pure functions and virtual DOM
https://github.com/anthonyshort/deku/tree/master/docs
3.41k stars 130 forks source link

Rendering from a specific node #356

Open Yomguithereal opened 8 years ago

Yomguithereal commented 8 years ago

Just opening the discussion here: could it be possible to implement a way to re-render the tree but from one specific node?

I know that diffing the whole tree is not that costly but on large nested apps and combined to redux' O(n) nature when solving actions, toggling a simble combo box might have a disproportionate cost.

I tend to use cursors and a single atom as my store and know precisely which part of the state has been updated when an action is triggered. So I am wondering whether there could be a way to re-render the tree from a given node when it is known.

anthonyshort commented 8 years ago

There was some discussion about this in #346 and #337. It should be solvable, and should be a renderer-specific optimization. It'll still need to walk down the tree from the top, but we'll make sure they're skipping as many sub-trees, diffs, and patches as possible.