Well, it’s not really efficient.
A more efficient solution might be if we wouldn’t even need DOM diffing, but instead every module would be based on a reactive model, and we wouldn’t have to deal with the diffing anymore.
Well, it’s not really efficient.
A more efficient solution might be if we wouldn’t even need DOM diffing, but instead every module would be based on a reactive model, and we wouldn’t have to deal with the diffing anymore.
edit: s/nature/definition
Indeed it can't. But you can get close. The key is that the side-effect has to be much more granular. Instead of re-rendering a virtual dom for an entire component as a side-effect, the side-effect is changing a single attribute on an element, or updating its list of children.
This means using a template language where one can make these associations between variables and DOM. JSX doesn't work here because its output could be anything.
I am toying with an experimental framework that implements these ideas. I am convinced we can do better than diffing vdoms.