Warm typediagram renderer during VS Code activation for markdown preview#23
Merged
MelbourneDeveloper merged 3 commits intoMay 2, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Warm the VS Code typeDiagram sync renderer during extension activation so the first Markdown preview render produces SVG instead of leaving a pending raw-code placeholder. Fixes #21.
Details
What Was Added:
packages/vscode/test/extension.test.tsthat mocks a not-yet-warmtypediagram-core, activates the extension, renders atypeDiagramMarkdown fence, and asserts the first render contains SVG and nottypediagram-pending.What Was Changed/Deleted:
packages/vscode/src/extension.tsnow makesactivateasync and awaitswarmupSyncRender()before returning theextendMarkdownItcontribution when the sync renderer is still cold.packages/vscode/test/extension.test.tsnow awaitsactivate(...)throughout the extension-host tests to match the async activation contract.Spec/Doc Changes:
Breaking Changes:
How Do The Automated Tests Prove It Works?
make cipassed.packages/vscode/test/extension.test.tsincludes[VSCODE-MD-COLD-FIRST-RENDER] waits for warmup before exposing markdown preview so the first render is SVG, which directly covers the reported failure mode.packages/vscode/test/extension.test.tsalso still verifies[VSCODE-MD-EXTEND] extendMarkdownIt schedules a preview refresh after warmup, proving the cold-path refresh behavior remains wired.packages/vscodesuite passed with132 passed, 1 skipped, and the full workspace CI run completed successfully.