Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch had an error being deployed
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.
Warning
Draft for tracking what blocks Docus from moving to Nuxt Content v4. It's not meant to be merged. v4 is installed from a local tarball in
.content-v4/(git-excluded), so git-triggered builds fail. Previews are deployed from a local build withvercel build && vercel deploy --prebuilt.Preview: https://docus-dg15la34v-nuxtlabs.vercel.app
This PR replaces
@nuxt/contentv3 with the Nuxt Content v4 POC (@nuxt/content4, nuxt/content-v4-temp#7) through a pnpm override, without upgrading any other dependency. The checklists below are everything still missing upstream for Docus to run on v4 without any change on its side. Build-time workarounds live inlayer/modules/content-v4.ts, which does nothing on v3.Nuxt Content v4
Worked around in this PR:
@sqlite.org/sqlite-wasmisn't a dependency, but the default hybrid mode needs it (v3 shipped it) →layer/package.jsonshikian optional peer that it only looks for in the app's own dependencies, so a layer setup crashes. The fix makes it a regular dependency resolved from the module. nuxt/content-v4-temp#6 breaks production builds, because its whole-objectimport.meta.contentreplace never applies →pnpm-workspace.yaml(locally patched tarball)/__nuxt_content/snapshot/<name>.json), which on Vercel only exists on the CDN, so the request reaches v4's/__nuxt_content/**handler and waits on itself until the 300 s timeout.mode: 'server-only'doesn't help: with a v3content.config.tsthe server instance is hard-coded tomode: 'hybrid', andserver-onlyalso stops the public snapshot from being generated →content-snapshot.ts,content-v4.tsbodyis a bare node array instead of v3's{ type: 'minimark', value, toc }, so the page TOC is empty. The workaround rebuilds the TOC from the nodes the way@nuxtjs/mdcdid →toc.ts,DocsAsideRight.vue.navigation.ymlfiles are ignored, because the YAML plugin isn't registered in v3 mode, so folder titles and icons are lost. The workaround reads them at build time and merges them back into the navigation →content-v4.ts,navigation.tscomponents/content/aren't resolved, because v3 registered that folder globally without a prefix and v4 doesn't.:assistant-demorendered as a raw<assistant-demo>tag →content-v4.tsContentRendererhardcodesa: NuxtLink, which bypasses Nuxt UI'sProseA. External links also lose v3'srel="nofollow"→DocsContentLink.vue,[...slug].vue,landing.vue#build/content/components.mjsstatically re-exports every component in the app, so the initial JS of a docs page grows from 277 KB to 868 KB gzipped. Partially fixed: loading the components on demand brings it down to 428 KB →content-v4.tsstemis now relative to the collection folder andextensionis.mdinstead ofmd→content-v4.ts,[...slug].vuemeta, sositemap: falseandmodifiedAtwere ignored →urls.tsqueryCollection(event, 'missing')throws immediately instead of returning a rejected promise, so/api/__sitemap__/urlsreturned 500 at runtime when a collection doesn't exist →urls.ts@nuxt/content/preview(field/group), sonuxt.schema.tsfailed to load. The workaround is a local copy of v3's helpers →preview.ts,nuxt.schema.tsNo workaround:
@nuxt/contentpackage exports none of the v3 types (ContentNavigationItem,Collections,PageCollections,DefinedCollection,TocLink…), and type generation fails silently in the layer, so collection names resolve tonever. That gives 22 errors innuxt typecheck layer..yml/.jsonfiles are skipped without a warning, because theyaml()/json()plugins aren't registered, and.csvhas no plugin at all. So v3datacollections in those formats come back empty. Docus doesn't define any, but users extending it can, and the.navigation.ymlworkaround above only patches the navigation./Users/…/docs/content) as a fallback source. It's unused while the snapshot loads, but if the snapshot ever fails to load, collections would likely come back empty instead of throwing an error. The local path also ships in the deployed function.comark / comark-content
comark-content@0.4.1doesn't coordinate index builds: concurrent first queries of a collection each rebuild its table, and one can drop it while another reads, so pages, navigation or prev/next links come back missing. v4 fixes it with a pnpm patch that only applies insidenuxt/content-v4-temp, so a publishedcomark-contentrelease with the fix is needed →patches/comark-content@0.4.1.patchmarkdown/comarkoutput, which fixes themarkdown/htmlissues (escaped attributes likeclass="[&>div]:*:my-0", MDC slots inside HTML tags) and the nesting problems that motivated #1449. It's blocked by a serializer bug: a code sample that itself contains indented```fences is written with a three-backtick fence instead of four, so it closes early and the rest of the page is parsed as code (Steps example incomponents.md).#basic-inline-codeinstead of#inline-code), which changes 45 of the 77 anchors in the playground. v3 mode needs an option for flat ids.nuxt-agent-discovery
moduleDependenciespins@nuxt/contentto^3.0.0, so Nuxt refuses v4 →patches/nuxt-agent-discovery@0.7.0.patch#content/manifest(not generated by v4),minimark/stringify(borrowed from@nuxt/content's dependencies) and v3'sbody.value. On v4 it should switch to the comark adapter wired to v4's servercontentby itself →layer/server/agent-source.ts,layer/nuxt.config.ts/sitemap.mdand/raw/index.mdaren't prerendered (they're served at runtime), sopnpm check:vercel-outputfails.Nuxt Studio
#content/preview(the v3 preview API),@nuxt/content/runtime(compressTree/decompressTree) and@nuxt/content/server, none of which v4 provides, so it can't build → disabled indocs/nuxt.config.tsNuxt UI
runtimeConfig.public.mdc.headings.anchorLinks, which@nuxtjs/mdcsets and v4 no longer installs. Heading anchors disappeared and inline code in headings lost its size →content-v4.ts@nuxtjs/mdcdefaults, so v4 used the GitHub themes instead of Nuxt UI'smaterial-theme-*→content-v4.ts🤖 Generated with Claude Code, reviewed by @larbish before opening.