ESM build evaluates in one ~250 ms long task; the AMD build splits it up
Maintainers usually reply within 1 day
@hediet is already working on this.
Since Oct 11, 2026.
Assessment
This issue has not been assessed yet.
Description
Moving from the deprecated AMD build to the ESM build (0.57.0, webpack 5) made our docs site's desktop Total Blocking Time worse. The total JS work is about the same in both builds. The difference is how it's scheduled. min/vs is built as about 10 chunks, and they evaluate in several smaller tasks. A bundled import('monaco-editor') evaluates everything in a single ~220–270 ms task.
Measurements are Lighthouse desktop with observed timing, median of 7, on a page with one editor:
| Build | TBT |
|---|---|
| AMD from CDN | 221 ms |
ESM, import('monaco-editor') |
~380 ms |
| ESM, staged (below) | 293 ms |
Staging the 0.56 entry points, with a setTimeout yield between each, recovers most of the gap:
await import('monaco-editor/editor');
await yieldToMain();
await import('monaco-editor/features/register.all');
await yieldToMain();
const monaco = await import('monaco-editor');
The largest task left is monaco-editor/editor itself, at about 140 ms. There is no smaller supported entry point that would let us split it further.
Ask:
- Could the editor core expose finer-grained supported entry points, or register its contributions lazily?
- Alternatively, could Monaco document (or ship) a staged entry like the one above as the recommended way to load the ESM build without a long task?
Either would let sites drop the AMD build without a main-thread regression.
- Dominant language
- JavaScript
- Stars
- 47k
- Forks
- 4.2k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 13
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/monaco-editor
-
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
microsoft/monaco-editor#5626 ·
Maintainers usually reply within 1 day
-
[Bug] package.json `"typings"` points to a file which does not exist in the npm packagePossibly taken @whoalin1 claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/monaco-editor#5615 ·
Maintainers usually reply within 1 day
-
[Bug] C# scientific-notation literals without a decimal point are split into identifiersPossibly taken @Janani-bn claimed this 15 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/monaco-editor#5583 ·
Maintainers usually reply within 1 day
-
[Bug] Rust scientific-notation literals without an exponent sign are split into identifiersPossibly taken @Janani-bn claimed this 14 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
microsoft/monaco-editor#5582 ·
Maintainers usually reply within 1 day
-
[Bug] Go numeric literals with underscore separators are split into identifiersMay be free again @aaronanish-t claimed this 25 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
microsoft/monaco-editor#5577 · 1 comment ·
Maintainers usually reply within 1 day
All issues in microsoft/monaco-editor
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
quasarframework/quasar#18614 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug/1-unconfirmed kind/bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
521xueweihan/HelloGitHub#4714 ·
-
01 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day