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

PureRenderMixin equivalent for virtual-dom #113

Closed
staltz opened this issue Nov 8, 2014 · 2 comments
Closed

PureRenderMixin equivalent for virtual-dom #113

staltz opened this issue Nov 8, 2014 · 2 comments

Comments

@staltz
Copy link
Contributor

staltz commented Nov 8, 2014

PureRenderMixin in React can really help for boosting performance. It avoids diffing some parts of the virtual tree, saving computations. See this demo.

Also see this issue.

Because this is more related to mechanisms in React's components and not so much in the inner workings of their virtual DOM algorithms, it might not be easy to find an equivalent solution in virtual-dom. But maybe? Has this been tried?

One idea:

I have one back-of-the-envelope idea: to attach the parent data (React's "property") to the VTree, and inside virtual-dom's diff algorithm, it could use that data instead of the whole VTree structure, as a quick diff check prior to the real diff. Maybe we could even use a hash of the data instead of the data itself.

@staltz
Copy link
Contributor Author

staltz commented Nov 8, 2014

I saw Big list and modify sub tree and this advice:

use key on each element in this list, this will put virtual-dom in re ordering mode instead of diffing mode, this allows for very efficients moves of elements in the list.

Seems to be the same suggestion I gave above.

@Raynos
Copy link
Collaborator

Raynos commented Nov 9, 2014

This is already support first class as Thunks.

See https://github.com/Raynos/vdom-thunk

See https://github.com/Raynos/mercury/blob/master/docs/thunks.md

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

2 participants