Skip to content

feat: migrate content layer to comark-content - #2400

Draft
larbish wants to merge 31 commits into
mainfrom
docs/comark-content-migration
Draft

feat: migrate content layer to comark-content#2400
larbish wants to merge 31 commits into
mainfrom
docs/comark-content-migration

Conversation

@larbish

@larbish larbish commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Replaces @nuxt/content with comark-content

https://content.comark.dev

Moving content off a build-time SQLite database onto per-commit instances read from GitHub with ISR + push webhook for freshness.

What changes

  • 8 content instances, one repo each, one commit SHA each: site, examples, docs:{3,4,5}.x, cli:{3,4,5}.x
    A push on any repo invalidates only the cache impacted.
Instance Repo Branch Content dir Mounted at Dev override
site nuxt/nuxt.com main content/ / (local dir in dev)
examples nuxt/examples main .docs/ /docs/examples NUXT_EXAMPLES_PATH
docs:3.x nuxt/nuxt 3.x docs/ /docs/3.x NUXT_V3_PATH
docs:4.x nuxt/nuxt 4.x docs/ /docs/4.x NUXT_V4_PATH
docs:5.x nuxt/nuxt main docs/ /docs/5.x NUXT_V5_PATH
cli:3.x nuxt/cli 3.x docs/ /docs/3.x/api/commands NUXT_CLI_PATH
cli:4.x nuxt/cli 3.x docs/ /docs/4.x/api/commands NUXT_CLI_PATH
cli:5.x nuxt/cli main docs/ /docs/5.x/api/commands NUXT_CLI_PATH
  • Search is client-side WASM FTS5, hydrated from immutable per-commit artifacts.

  • ISR instead of prerendering: POST /api/revalidate purges exactly the URLs a commit changed (300s TTL as backstop)

  • Highlighter moves on rangi (https://github.com/comarkdown/rangi) instead of shiki

  • Examples canonicalized to /docs/examples/** (was served under three versioned URLs), with redirects.

  • Dependencies removed: @nuxt/content, @nuxtjs/mdc, nuxt-content-twoslash, shiki, twoslash, better-sqlite3.

Known regression

CLI reference pages (~18) and examples are out of search until the search DB merges multiple instances (waiting for https://github.com/comarkdown/comark-content/pull/120)

Metrics

Build

main this PR
Build wall clock 8m 07s 2m 37s
Content parsing at build 31.7s (17 collections, 1051 files) none — parsed on demand
Prerendered routes 2492 in 312s 1 in 27s
Nitro output 91.5 MB (33.2 MB gzip) 56.1 MB (18.9 MB gzip)
SQLite dump in server bundle 3.06 MB (2.3 MB gzip)
Build cache 417 MB 291 MB

A one-word docs typo currently rebuilds all 2492 routes. Now it purges the one URL that changed.

Time to publish

main this PR
Docs commit → live 8m build webhook purge (~ instant)

Runtime (TTFB, /docs/4.x/getting-started/introduction)

main this PR
Warm (HIT) 76–87 ms 94–318 ms
Cold (MISS) n/a (prerendered) 509–760 ms warm lambda, ~6.4 s cold

Cold-boot breakdown (comark-content tracing): TBD

Cold MISS is the one regression. comarkdown/comark-content#120's withSnapshot() removes
the source walk from cold boot by hydrating from the per-commit snapshot artifact.

Before merge

Needs VERCEL_BYPASS_TOKEN (build + runtime), WEBHOOK_SECRET, NUXT_OG_IMAGE_SECRET and webhooks on nuxt/nuxt.com, nuxt/nuxt, nuxt/examples, nuxt/cli.

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nuxt Ready Ready Preview Sep 9, 2026 2:17pm UTC

Request Review

@larbish larbish changed the title docs: migrate to comark-content- #2381 feat: migrate content layer to comark-content Aug 31, 2026
# Conflicts:
#	app/pages/docs/[...slug].vue
#	package.json
#	pnpm-lock.yaml
#	pnpm-workspace.yaml
@socket-security

socket-security Bot commented Aug 31, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedrangi@​2.2.07010010090100
Addednuxt-workers@​0.1.0711009778100
Updated@​iconify-json/​lucide@​1.2.129 ⏵ 1.2.130100 +110079 +196 +1100
Updated@​takumi-rs/​core@​2.13.6 ⏵ 2.13.780 -91009296100
Updatedeve@​0.52.1 ⏵ 0.52.299 +1100100 +19880
Updatedshaders@​3.2.466 ⏵ 3.2.46710010087 +19680
Added@​octokit/​webhooks-methods@​6.0.010010010083100

View full report

@nuxt-com-bundle-report

nuxt-com-bundle-report Bot commented Aug 31, 2026

Copy link
Copy Markdown

Production bundle

Comparing e75bfab3 with b63b237e. Compressed sizes are calculated from the emitted production assets.

Metric Base (Brotli) PR (Brotli) Δ Brotli Δ gzip
Client JavaScript 2.51 MiB 2.09 MiB -427.9 KiB (-16.6%) -547.7 KiB (-17.0%)
Client CSS 30.9 KiB 29.2 KiB -1.7 KiB (-5.5%) -2.0 KiB (-5.1%)
Other client assets 339.3 KiB 339.3 KiB -9 B (-0.0%) +1 B (+0.0%)
Total client assets 2.87 MiB 2.45 MiB -429.6 KiB (-14.6%) -549.8 KiB (-15.0%)

Largest module increases

Module Base (Brotli) PR (Brotli) Δ Brotli
node_modules/rangi/dist/_chunks/languages.mjs 0 B 10.7 KiB +10.7 KiB
node_modules/unhead/dist/shared/unhead.DNKiVLV7.mjs 0 B 3.6 KiB +3.6 KiB
virtual:nuxt:node_modules%2F.cache%2Fnuxt%2F.nuxt%2Fnuxt-icon-client-bundle.mjs 38.7 KiB 41.8 KiB +3.2 KiB (+8.2%)
node_modules/vue-router/dist/devtools-Bpr7ZAVB.js 0 B 3.2 KiB +3.2 KiB
node_modules/unhead/dist/shared/unhead.C3b2Ipoj.mjs 0 B 2.2 KiB +2.2 KiB
node_modules/comark/dist/plugins/rangi.js 0 B 1.6 KiB +1.6 KiB
node_modules/comark/dist/utils/comark.rangiLanguage.js 0 B 1.1 KiB +1.1 KiB
/app/composables/useSearch.ts 0 B 735 B +735 B
node_modules/rangi/dist/_chunks/detect.mjs 0 B 680 B +680 B
node_modules/@vue/shared/dist/shared.esm-bundler.js 2.5 KiB 3.2 KiB +662 B (+25.4%)

Module values come from Nuxt’s analyzer and are attribution estimates. This workflow is currently report-only.

Workflow run

larbish and others added 4 commits September 1, 2026 15:24
# Conflicts:
#	app/pages/changelog.vue
#	app/pages/docs/[...slug].vue
#	nuxt.config.ts
#	package.json
#	pnpm-lock.yaml
#	pnpm-workspace.yaml
#	server/mcp/prompts/deploy/deployment-guide.ts
#	server/mcp/tools/blog/get-blog-post.ts
#	server/mcp/tools/deploy/get-deploy-provider.ts
#	server/mcp/tools/docs/get-documentation-page.ts
#	server/mcp/tools/docs/get-getting-started-guide.ts
#	server/mcp/tools/docs/list-documentation-pages.ts
#	server/routes/design.md.get.ts
#	server/routes/raw/index.md.get.ts
#	server/routes/sitemap.md.get.ts
#	server/routes/sitemap.xml.get.ts
#	server/utils/mcp.ts
#	shared/utils/docs.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants