Repository navigation
perf(ui): add comark-ui/vue/lazy, which loads each block's package on first use - #434
Conversation
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. |
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.
Important
The lazy map introduces a client-side regression: restoring a saved tab can select one tab while displaying another tab's content.
Reviewed changes — Reviewed the new lazy Vue entry, its shared components, package exports, and regression tests.
- Lazy renderer map: Adds
comark-ui/vue/lazywith per-tag async wrappers and package-level dynamic imports. - Shared Vue blocks: Moves Mermaid and typeset components into a shared module without changing the eager entry's rendering.
- Documentation and verification: Documents the entry and tests tag parity, SSR output, and deferred imports; also checked the published build's import graph and client-side first-use behavior.
Validation: pnpm build, workspace TypeScript checking, and all 18 existing UI test files passed (413 tests passed, one skipped). A targeted client regression probe failed only with the lazy map, and the same mismatch was confirmed in Chromium.
gpt-6.1-sol(xhigh) | 𝕏
Latest result Pull request merged. Final answersSession Pull request merged. Session Fixed the recursive AST typing defect in b8875ce using shallowRef and resolved the review thread. Workspace typechecking and 22 focused tests pass; lint passes with four unchanged warnings. One build test timed out during revalidation, then passed with a 20-second budget. Repair pushed; awaiting hosted checks and review. Session Fixed the recursive AST typing defect in b8875ce using shallowRef and resolved the review thread. Workspace typechecking and 22 focused tests pass; lint passes with four unchanged warnings. One build test timed out during revalidation, then passed with a 20-second budget. Repair pushed; awaiting hosted checks and review. Session Fixed the recursive AST typing defect in b8875ce using shallowRef and resolved the review thread. Workspace typechecking and 22 focused tests pass; lint passes with four unchanged warnings. One build test timed out during revalidation, then passed with a 20-second budget. Repair pushed; awaiting hosted checks and review. Fixed the recursive AST typing defect in b8875ce using shallowRef and resolved the review thread. Workspace typechecking and 22 focused tests pass; lint passes with four unchanged warnings. One build test timed out during revalidation, then passed with a 20-second budget. Repair pushed; awaiting hosted checks and review. Fixed the P1 lazy-tabs restoration bug in b8ab96f and resolved the review thread. Added a client navigation regression that failed before the fix and passes afterward. All 70 focused tests and repository lint passed, with four unrelated lint warnings. Repair pushed; awaiting hosted checks and review. |
There was a problem hiding this comment.
Important
The saved-tab behavior is fixed, but the new regression test introduces TypeScript errors that fail the required check job.
Reviewed changes — Reviewed b8ab96f, the follow-up commit since the previous Pullfrog review.
- Restored saved tab selections when lazy panels mount after their parent runtime initializes.
- Added client navigation coverage that checks both the selected header and visible panel after replacing a plain document with lazy tabs.
Validation: the workspace build and all 70 focused tests passed. Workspace typechecking failed with two errors in the new test; lint completed with four warnings in unchanged files.
gpt-6.1-sol(xhigh) | 𝕏
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes — Reviewed b8875ce, the test-typing correction since the previous review.
- Replaced deep document reactivity with
shallowRefin the lazy-navigation regression test, preserving recursive AST types while keeping document replacement reactive.
Validation: pnpm build, workspace TypeScript checking (tsrs --noEmit), and all 70 focused UI/tabs tests passed, including the first-use lazy-navigation regression.
gpt-6.1-sol(xhigh) | 𝕏

A Vue page that renders a parsed document with
componentsfromcomark-ui/vuedownloads every block package, even when the page has no block. On vitehub.dev that is about 600 kB of JS (about 196 kB gzip) on each docs page.comark-ui/vueimports all 34comark-*/vueentries at the top, so the bundler can't split them out.This adds
comark-ui/vue/lazy, which exports the samecomponentsmap. Each tag is adefineAsyncComponentthat imports its package's Vue entry the first time a document renders it. Vue's server renderer waits for them, so a server render still arrives drawn. The Mermaid wrapper and the typeset styles moved intosrc/vue-blocks.ts, so both entries share them without the lazy one importingvue.ts.comark-ui/vuedoesn't change.The new test in
ui.test.tschecks three things: the lazy map has the same tags ascomark-ui/vue, the test document renders the same server HTML with both maps, and a build of the lazy entry loads no block package until a page asks for one. Vue numbersuseIdids with one more segment under an async component, the same on the server and the client, so the HTML check ignores tab ids. When I added an eagerimport "comark-carousel/vue"to the lazy entry, the test failed.The tags are listed by hand, so a package that adds a component needs a line in
vue-lazy.ts; the tag test fails until it has one. The 600 kB number comes from vite-hub/vitehub#4366, which builds the same map at build time in@vite-hub/docs. Once a release has this, that PR can importcomark-ui/vue/lazyinstead. I haven't measured this entry in a real app yet.