Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> innovation of the Virtual DOM

Virtual DOM is rather a desperate move - to support components life time constructor/destructor events componentWill/DidMount / Unmount.

What if you will be able to define in standard HTML/CSS something like this (as it is supported natively in Sciter)

   // css
   div.mycomponent {
     behavior: MyComponent url(components.js);
   } 
   // script in components.js
   class MyComponent : Element {
     function attached() { /*constructor*/ }
     function detached() { /*destructor*/ }
     … other custom component specific methods … 
   }
 
With that simple mechanism you don't need virtual DOM and its overhead at all. Component binding requires only inclusion of that CSS.


So let's say that that's a component that displays a user's username - how do you make sure that its view is always up-to-date, whether the user is logged in, logged out, or another user's logged in?

Virtual DOM is not just about componentWill/DidMount/UnMount. It's when updating the view when a component's inputs (props) change that Virtual DOM shines.


If I am not mistaken, Houdini will allow similar features.

But it is still far away from standardization.


> still far away from standardization.

Sciter uses this feature almost 10 years.

All these 10 years we have libraries of reusable components and so no need for React.

Same is about flexbox and grid: https://terrainformatica.com/2018/12/11/10-years-of-flexboxi...


Well, native has it even longer (WPF behaviors and grid), but I have to put up with Web for most of my projects.


Sciter was used in production 1 year before WPF appearance: https://sciter.com/sciter/sciter-vs-wpf/


looks pretty close to the web components api. specifically "customized built-in elements" which use the `is` attribute on a regular element to add custom beavior.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: