What is the current state of more advanced Glimmer VM features?

Thanks a lot Chris for your response! It was very helpful.

If okay for you, I would like to ask one follow-up question to make sure that an assumption about tree shaking is correct.

The Angular team was working hard to make sure that their rendering engine is tree shakeable. As part of Ivy they changed the format to which the templates are compiled. Angular compiles a template to a function, which consists of a list of instructions. Since Ivy each instruction is its own function and called explicitly in the template. It looks like this:

import ng from '@angular/core';

function HelloWorldComponent_Template(rf, ctx) {
  if (rf & 1) {
    ng.ɵɵelementStart(0, "div");                                     // <div>
    ng.ɵɵtext(1);                                                    //   Count: {{count}}
    ng.ɵɵelementEnd();                                               // </div>
    ng.ɵɵelementStart(2, "button", 0);                               // <button
    ng.ɵɵlistener("click", function() { return ctx.increment(); });  //  (click)="increment()">
    ng.ɵɵtext(3, "Increment");                                       //   Increment
    ng.ɵɵelementEnd();                                               // </button>
  }
  if (rf & 2) {
    ng.ɵɵadvance(1);                                                 // <div>
    ng.ɵɵtextInterpolate1("Count: ", ctx.count, "");                 //   Count: {{count}}
  }
};

This allows a bundler like Webpack or Rollup to tree shake all instructions from the rendering engine, which aren’t used by the application.

The Glimmer VM is not tree shakeable due to its architecture. The instructions are represented as opcodes, which are interpreted at run-time. So there isn’t an explicit references to the used instructions of the Glimmer VM. This seems to be more similar to Angular before Ivy than after.

Am I assuming correctly that Glimmer takes the trade-off that the Glimmer VM is not tree shakeable explicitly. I think this trade-off is acceptable cause the list of built-in instructions in Glimmer VM is very small. It’s very likely that all real-world applications use all existing instructions. So there isn’t much room for tree shaking at all. Is this correct?