Can you branch on state or use loops over data in Solid.js? The reason _why_ React has a virtual DOM is to enable more interesting relationships between your data and your presentation. Anyone can make a framework that makes the source code for an incrementing number look pretty!
As an example of this point, check out the "Simple Todos" example for Solid.js[1].
In React, we render lists by using regular JavaScript idioms like loops, arrays, and array methods like map. However in Solid.js, much like traditional templating languages, we get a construct like <For> that reinvents a concept that's already in the language.
I've been writing React and React-alike code for a long time. I think that fine-grained updates avoiding reconciliation are a good idea, especially for performance. At one point, I built a React-like library for Roblox and Lua whose most novel feature ended up being "Bindings"[2], which look sorta like Solid.js state containers. They create little hot-path data dependencies, but the bulk of your components still use normal React-like rendering.
[1]: https://www.solidjs.com/examples/todos
[2]: https://roblox.github.io/roact/advanced/bindings-and-refs/I had/have your bias, but from playing with it I found a couple things:
1) Like React, you can swap out the template feature for a function call (or subcomponent). e.g. instead of
return (
<button...>
...
</button>
<For each={state.todos}>
...
);
you can use functions and loops: function displayTODOs<T>(todos: T[]): any {
let arr: any[] = [];
for(let [i, todo] of todos.entries()) {
const { done, title } = todo;
let elem = (/\* JSX \*/);
arr.push(elem);
}
return arr;
}
...
return (
<button ...>
</button>
{displayTODOs(state.todos)}
);
2) Even with my bias, I must admit I found the `<For...` syntax to be surprisingly easy to read and fast to eye-parse; much more so than other 'templating' (using your term) languages/macros/syntax I've used over the years.
But yeah that's the game you have to play now if you want the top $$$ at one of the SMEGMA companies.
I wrote (for example) my 2D game engine from scratch (3rd party libs excluded)
https://github.com/ensisoft/detonator
but would not be able to pass a LC type interview that requires multiple LC hard solutions and a couple of backflips on top. But that's fine, I've accepted that.