Repository navigation
perf(ui): load the Mermaid wrapper and typeset styles on first use in comark-ui/vue/lazy - #445
Conversation
… comark-ui/vue/lazy
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Latest result Pull request merged. Final answersSession Pull request merged. PR #445 is ready. Verified the expected HEAD, complete diff, and Pullfrog review; no actionable findings remain and all supplied checks passed. Local prerequisite build and all 23 focused tests passed. Repository lint passed with warnings. Confirmed the built lazy entry statically imports only Vue. No source changes or repair commit were needed. Session Waiting for review checks before the next pass. Session Waiting for review checks before the next pass. Session Waiting for review checks before the next pass. Session Waiting for review checks before the next pass. Session Waiting for review checks before the next pass. |
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes in the lazy Vue entry, extracted renderer modules, eager Vue integration, and bundle regression test.
- Deferred renderer loading: Mermaid’s wrapper and the scoped typeset styles now load through the existing async component helper instead of the lazy entry’s static imports.
- Rendering compatibility: The eager Vue entry retains synchronous access to both components, and server rendering still includes the Mermaid SVG, toolbar, and document-local typeset styles. Verified through the public
comark-ui/vue/lazyexport as well as the existing SSR parity test. - Bundle regression coverage: The static-import test now guards against eagerly loading the wrapper, toolbar runtime, and typeset CSS. The workspace build and all 23 focused UI and lazy-navigation tests passed.
gpt-6.1-sol(xhigh) | 𝕏
…and typeset styles on first use comark-ui 0.12.2's comark-ui/vue/lazy imported the Mermaid wrapper and the typeset CSS statically, so every docs page loaded them. onmax/comark-ui#445 moved both behind defineAsyncComponent; 0.14.3 is the first npm release with it. Raise the markdown-ui catalog and the docs peer minimum to ^0.14.3.
* perf(docs): load comark blocks through comark-ui/vue/lazy * fix(docs): type and test the Comark lazy block map * perf(docs): require comark-ui 0.14.3, whose lazy entry loads Mermaid and typeset styles on first use comark-ui 0.12.2's comark-ui/vue/lazy imported the Mermaid wrapper and the typeset CSS statically, so every docs page loaded them. onmax/comark-ui#445 moved both behind defineAsyncComponent; 0.14.3 is the first npm release with it. Raise the markdown-ui catalog and the docs peer minimum to ^0.14.3. * fix(content): run comark-ui's typeset after the app's Markdown plugins comark-ui 0.14.3 puts the typeset-styles node first in the tree instead of last, so an app plugin such as comark's headings({ remove: true }) no longer found the title. Content now runs typeset after the app's plugins, as comark-ui's own preset runs it last, and the consumer probe and Get started example show the new order. * chore(content): keep index.ts within its comment baseline * fix(docs, content): keep comark-ui's motion layer off, as before 0.14 comark-ui 0.14 turns motion on by default, which adds a motion-runtime node to every document and loads comark-motion on the page. The docs site and Content documents had neither, so their presets turn it off. A docs site opts in with comarkUi: { motion: true }. --------- Co-authored-by: vite-hub[bot] <320448255+vite-hub[bot]@users.noreply.github.com>

comark-ui/vue/lazystill imports the Mermaid wrapper and the typeset styles up front. A page that switches to it from a build-time map of blocks grows: vitehub.dev's DocsMarkdown chunk gained 19,323 bytes when@vite-hub/docstried it.Both came from
vue-blocks.ts, whichvue-lazy.tsimported statically. The wrapper pulls inclient.ts(its bar and styles) and the typeset component pulls intypeset-css.ts, about 12 kB of CSS as a string.This PR splits them into
vue-mermaid.tsandvue-typeset.tsand loads them with the samelazy()helper as every other block.comark-ui/vueimports them as before. A server render is unchanged: Vue's server renderer waits for both, and the existing test that compares the lazy and eager server renders still passes. In the browser, the typeset<style>now arrives with the first document's chunk instead of with the entry.What the entry loads before any document renders (Vite, minified ESM,
vueandcomark-*external, gzip -9):mainThe lazy-entry test in
packages/ui/test/ui.test.tsnow also fails whenclient.ts,typeset-css.ts, or the two new modules end up in the entry's static imports. It fails onmainwithtypeset-css.tsandclient.tsand passes here. The builtdist/vue-lazy.mjsimports onlyvue.I haven't rebuilt vitehub.dev against a preview of this yet; that check goes with vite-hub/vitehub's switch to
comark-ui/vue/lazy.🤖 Generated with Claude Code