Re:Fast, Bump-Allocated Virtual Doms with Rust and Wasm
by KuhlMensch on Thursday March 14, 2019 @04:26PM
(#19393303)
As I understand it - please correct me if I'm wrong!
> HTML itself is definitely declarative
HTML is the markup (not programming) language (which is Javascript). The API to actually change the DOM is imperative. See https://developer.mozilla.org/en-US/docs/Web/API/Node (I don't quite grasp why they felt the need to specify that)
> Why are DOM-diffs something that is done by userland libraries?
I guess if the browser provided primitives to build trees and diff them that would be cool. But I presume using WASM *is getting the native-browser code to do the diffing.
> HTML itself is definitely declarative
HTML is the markup (not programming) language (which is Javascript). The API to actually change the DOM is imperative. See https://developer.mozilla.org/en-US/docs/Web/API/Node (I don't quite grasp why they felt the need to specify that)
> Why are DOM-diffs something that is done by userland libraries?
I guess if the browser provided primitives to build trees and diff them that would be cool. But I presume using WASM *is getting the native-browser code to do the diffing.