3 ms·
If you could AOT compile the templates into bytecode, which has to be parsed, why not just AOT compile the templates straight to JavaScript(like Angular 2/4)?
by steveadoo 9y ago
If you could AOT compile the templates into bytecode, which has to be parsed, why not just AOT compile the templates straight to JavaScript(like Angular 2/4)?
- killercup 9y agoI would assume because their VM/bytecode version is very fast at rendering updates and smaller in size than a "represent the bytecode as JS" version.
- rubiquity 9y agoThis is what I was going to ask as well. The only benefit I can see to this is that they are trying future proof for when WebAssembly or some other back end is more prevalent? Maybe they want to do Glimmer-Native? Handlebars -> JS/TypeScript compiler -> Bytecode -> JS probably anyway -> HTML seems like a lot of work.
- zimbatm 9y agoThe bytecode representation is more compact than the compiled JavaScript. And this has an impact on execution speed. See past discussion: https://news.ycombinator.com/item?id=14050625 https://news.ycombinator.com/item?id=14050625