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

virtual DOM and diff ? #239

Closed
yisar opened this issue Sep 20, 2018 · 1 comment
Closed

virtual DOM and diff ? #239

yisar opened this issue Sep 20, 2018 · 1 comment

Comments

@yisar
Copy link

yisar commented Sep 20, 2018

I've seen moonjs trigger data changes with update and recompile view, Although it is accurate enough, but is it virtual DOM and diff not better?

@kbrsh
Copy link
Owner

kbrsh commented Sep 20, 2018

Moon used to use a virtual DOM. Now, it compiles views into direct JavaScript code — it is never "recompiled". Virtual DOM works by creating an abstraction over the normal DOM. When a change is made, Moon used to iterate through the new virtual DOM, compare it with the old virtual DOM, and use normal DOM operations to update the view.

With v1, instead of having to have the abstraction of the virtual DOM, Moon directly generates the normal DOM operations instead.

@kbrsh kbrsh closed this as completed Sep 20, 2018
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