v132 · javascript

Explicit Compile Hints with Magic Comments

Allow attaching information about which functions should be eager parsed & compiled in JavaScript files.

concepts

  1. Compile Hints

    Magic-comment hints tell V8 to eagerly compile a file or function.

  2. first-click latency

    The interaction case: load two libraries side-by-side, click both, compare the first-call cost.

  3. parse comparator

    Stacked bars compare lazy vs eager parse + compile + execute across a synthetic bundle. Drag total function count, called-on-load percentage, and parse cost to see the trade-off.

  4. bundler walkthrough

    Per-bundler recipes: esbuild banner, Rollup banner, webpack BannerPlugin, Vite, SWC, Terser comments regex. Plus a matrix of which chunks to annotate.

why it shipped

Allow attaching information about which functions should be eager parsed & compiled in JavaScript files.

references