I believe Angular has a similar mechanism of compiling templates to code that corresponds directly to the template much like this, and they're now backing away from it. The reason is that you end up with a lot of code per template. Some indirection, like stuffing the template parameters via a key-value map, lets you generate more generic code that is overall smaller.
To prevent large bundles, Moon uses a lightweight runtime that is about the same size as the equivalent compiled virtual DOM render function (using React.createElement for example).
Comments
I believe Angular has a similar mechanism of compiling templates to code that corresponds directly to the template much like this, and they're now backing away from it. The reason is that you end up with a lot of code per template. Some indirection, like stuffing the template parameters via a key-value map, lets you generate more generic code that is overall smaller.
To prevent large bundles, Moon uses a lightweight runtime that is about the same size as the equivalent compiled virtual DOM render function (using React.createElement for example).