Re:TodoMVC App Written in Vanilla JavaScript
by bobbylarrybobby on Saturday May 07, 2022 @10:32AM
(#31294804)
Yes, but there are ways to accomplish this automation without diffing. Svelte does this by statically wiring up the data dependencies in your app when it builds, and then at runtime making exactly the changes to the DOM that it needs to based on the information it had at build time. No need to diff.
[ Parent
| on HN ]
Re:TodoMVC App Written in Vanilla JavaScript
by Philip-J-Fry on Saturday May 07, 2022 @11:01AM
(#31295053)
The point is that A) that's a framework and B) that requires you to compile Svelte files.
If you want to write declarative UI in pure JS then you need the browser to do these DOM optimisations for you, and diffing the changes is the way to do that.