3 ms·
> What React nailed is an efficient way to rerender the view. Well, it’s not really efficient. A more efficient solution might be if we wouldn’t even need DOM
by kuschku 11y ago
> What React nailed is an efficient way to rerender the view.
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.
- aikah 11y agoI'm not sure how it would work since the DOM is not reactive. At the end of the day, any "view" library for the browser is a DOM builder. It cannot be reactive, by nature. edit: s/nature/definition
- teleclimber 11y ago> It cannot be reactive, by nature. 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.
- mtzaldo 11y agommm... Instead of a dom it will be called dam (domain actor model)... look ma' I can also write cool stuffs...