|
|
|
|
|
by josephg
1128 days ago
|
|
> If HTML6 included virtual DOMs or reactive primitives, that might reduce the inclination towards framework bloat. Please no virtual DOM. A virtual Dom is pure overhead compared to how svelte or solid renders. But I’d be very curious about what proper browser integration would look like for reactive frameworks if you have an instinct for what better apis could look like? |
|
It would not be as efficient as Svelte and Solid since those can use the compiler to further optimize code, but having the framework-less version of JS be "as good as" a framework like Vue or React would be a big plus for moving away from frameworks generally.
Apart from that, the general problem of reactivity boils down to "map this DOM element to this variable, and if the variable changes, update the DOM element". You could imagine an API sort of like this:
Where `bind-var` specifies a variable that, if updated, signals that the span should be replaced with the return value of the function specified by `bind-gen`