v132 · javascript
Explicit Compile Hints with Magic Comments
Allow attaching information about which functions should be eager parsed & compiled in JavaScript files.
concepts
-
Compile Hints
Magic-comment hints tell V8 to eagerly compile a file or function.
-
first-click latency
The interaction case: load two libraries side-by-side, click both, compare the first-call cost.
-
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.
-
bundler walkthrough
Per-bundler recipes: esbuild banner, Rollup banner, webpack BannerPlugin, Vite, SWC, Terser
commentsregex. 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.