3 ms·
This is really just a DSL to make dom: https://github.com/vanjs-org/van/blob/3f98060971a8ff141179ef0fcd9f1b13b536a6f2/src/van.js#L51 https://github.com/vanjs-o
by esprehn 3y ago
This is really just a DSL to make dom:
https://github.com/vanjs-org/van/blob/3f98060971a8ff141179ef0fcd9f1b13b536a6f2/src/van.js#L51 https://github.com/vanjs-org/van/blob/3f98060971a8ff141179ef...
And a very simple system that replaces the dom from scratch each time any data changes:
https://github.com/vanjs-org/van/blob/3f98060971a8ff141179ef0fcd9f1b13b536a6f2/src/van.js#L71 https://github.com/vanjs-org/van/blob/3f98060971a8ff141179ef...
That's bad for performance (recomputing the style/layout and repainting even for minor changes), bad for accessibility, breaks focus, etc.
It's unlikely the smaller bundle size compared to preact and friends wins anything once you've abandoned all reuse of the rendering engine computations.
- ssdspoimdsjvv 3y agoWhile that's true, I wonder how many websites really benefit from smart diffing algorithms instead of just directly updating the dom.
- mathgladiator 3y agoIn my world, I just directly update the DOM which I described recently in https://news.ycombinator.com/item?id=36067280 https://news.ycombinator.com/item?id=36067280
- 5Qn8mNbc2FNCiVV 3y agoThe diffing algorithm for preact is super simple, I think it's along the lines of a dozen lines of code. I'd wager the code to directly updating the DOM will be larger than preact + usage code
- rictic 3y agoUsing tagged template literals with Lit or Preact + htm is more readable than Van.js, is much faster on update, and is also completely vanilla JS (no JSX and so no build step needed)