Unify the definitions of "Markdown" behind editor extension loading
What does this MR do and why?
Resolves Live preview is driven by two competing definit... (#619238 - closed).
Drive loading and unloading of the Markdown editor extensions
from the file name field alone, synced on every input event via isMarkdownFilePath.
A single definition of "Markdown" now covers both the initial load and every file name edit afterwards.
Monaco's language detection now only affects syntax highlighting.
Tip
Counterpart to Sync snippet Markdown live preview with mid-edi... (!252609 - merged), which takes the same approach.
Races between typing and the async load
Syncing on every keystroke means a typing burst can pass through several Markdown file names while an extension load is still in flight. The guards from Fix races between Markdown extension loading an... (!251306 - merged) keep this safe. For example:
---
title: Two Markdown names in one typing burst
config:
fontSize: 14
---
sequenceDiagram
autonumber
actor User
participant EditBlob
participant Import as dynamic import
Note over EditBlob: editing README
User->>EditBlob: types → README.mkd (input event per keystroke)
EditBlob->>+Import: start loading the Markdown extensions (promise cached)
rect
note right of User: race window — the load is still in flight
User->>EditBlob: keeps typing → README.mkdn
Note over EditBlob: still Markdown — install hits the cached promise,<br>no second load
end
Import-->>-EditBlob: import resolves
Note over EditBlob: guard passes → use() onceScreen recordings
Manually verified in GDK-in-a-box:
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.