Why Incremental DOM is Tree Shakable?

Technology CommunityCategory: AngularWhy Incremental DOM is Tree Shakable?
VietMX Staff asked 3 years ago

When using incremental DOM, the framework does not interpret the component. Instead, the component references instructions. If it doesn’t reference a particular instruction, it will never be used. And since we know this at compile time, we can omit the unused instruction from the bundle.

Virtual DOM requires an interpreter. What part of that interpreter is needed and what part is not isn’t known at compile time, so we have to ship the whole thing to the browser.