4 ms·
> Maybe this becomes a preference in the compiler config? Maybe, but it could be more complicated for you, the maintainer, than it's worth! > JSX is more succ
by mpalmer 7mo ago
> Maybe this becomes a preference in the compiler config?
Maybe, but it could be more complicated for you, the maintainer, than it's worth!
> JSX is more succinct and efficient than raw DOM API because it's declarative, where the raw API is imperative.
But that's also the difference between (e.g.) Solid's signals vs a plain (proxied) object that's passed around and mutated. I'd go so far as to say that mutable objects are one of the most "imperative" things about JS.
- dashersw 7mo agoI don't want to recurse into philosophy but one could argue an assignment is more declarative than a function call :) Solid is function calls everywhere, and extra code, vs plain objects.
- mpalmer 7mo agoPlain objects whose accessors contain nontrivial logic deferred using function calls - to be fair
- dashersw 7mo agoI am pondering about this, but would love to see an example to make it more concrete. The way I see it is that this reactivity is completely on the compiler's side, and there's no more ambiguity or pitfalls than misrepresenting a dependency array in a react hook.