Per-Function Explicit Compile Hints via Magic Comments
- Category
- JavaScript
- Type
- New or changed feature
- Status
- Proposed (Chrome Proposed)
- Intent stage
- None
Summary
Allow attaching information about which functions should be eager parsed & compiled in JavaScript files. The information will be encoded as magic comments. This is an extension of the Per-File Explicit Compile Hints feature ( https://chromestatus.com/feature/5100466238652416 ), where we now allow marking individual functions for eager parsing & compilation.
Standards & signals
- Firefox: Defer — This is a position request for the previous iteration of compile hints; the per-file version. We expect their views about this extension to be similar.
- Safari: N/A — This is a position request for the previous iteration of compile hints; the per-file version. We expect their views about this extension to be similar.
- Web developers: Positive — - Microsoft is interested in prototyping; needs the Origin Trial for evaluating performance in the wild - General positive sentiment, e.g., TC39 tooling meeting
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=per-function-explicit-compile-hints-via-magic-comments
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Per-Function%20Explicit%20Compile%20Hints%20via%20Magic%20Comments
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Per-Function%20Explicit%20Compile%20Hints%20via%20Magic%20Comments
- Baseline status: https://webstatus.dev/?q=Per-Function%20Explicit%20Compile%20Hints%20via%20Magic%20Comments
Explainers: https://github.com/WICG/explicit-javascript-compile-hints-file-based