Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render diffs #53

Open
mattstyles opened this issue Jul 6, 2016 · 4 comments
Open

Render diffs #53

mattstyles opened this issue Jul 6, 2016 · 4 comments

Comments

@mattstyles
Copy link

Howdy,

At the moment the react-blessed renderer is recreating the tree with each render call, this differs from react-dom which attempts reconciliation with the dom rather than stamping over it (too much). This means that you can't use top-down data-flow with react-blessed as each render call effectively recreates the entire tree, and, actually, I've noticed a hefty slow down after repeatedly calling render, is there also a clear-up issue?

Am I right with this thinking? And is there a quick-win using one of the component update lifecycles to stop react-blessed from recreating everything each render?

I've stuck a side-by-side with react-dom in this repo, the blessed and browser files are near identical and they just render a list of items, the react-blessed one remounts (which I'm assuming means its recreating) the list each render whereas react-dom reconciles and should just be performing 2 dom ops (unhighlight old selected node, highlight selected node). I think.

Are there any plans to support working out the minimum amount of mutations required for blessed? I had a quick look and I'm guessing it is not an easy task as the blessed components have a richer public api than the dom generally does. Any ideas how to get unidirectional data shizzle working without having to totally recreate the diff-application algorithm?

@revolunet
Copy link
Contributor

can we prevent renders with componentShouldUpdate with react-blessed ?

@Yomguithereal
Copy link
Owner

I guess so. Never tried it though. @revolunet maybe your issue with the list comes from this. @mattstyles there is probably a bug somewhere in my code that implies remounts (or maybe I was lazy and did not properly diffed somethings).

@philraj
Copy link

philraj commented Oct 18, 2018

any news on this? i'm getting a ton of complete redraws with distracting blanking when a list of items is being updated

@Yomguithereal
Copy link
Owner

Hum... I don’t remember the specifics of the problem very clearly right now. As I recall the upgrade to latest reconciler logic did something bad but I cant be sure. Unfortunately I don’t have much time right now to investigate. Will definitely review any related PR though. Else you can try to ping me in two weeks when I can find more time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants