Repository navigation
build(deps): upgrade Fumadocs to 16.19.0 for fumadocs-openapi - #370
Conversation
Move fumadocs-core and fumadocs-ui to 16.17.9 and fumadocs-mdx to 15.4.10. 16.17.10 is newer but under the three-day release age gate, so it cannot be installed yet. The upgrade changes four things the engine relied on: - remarkStructure and remarkLLMs now slice their Markdown from the authored source and drop the stringify and mdast-util-to-markdown options. The Experimental exclusion from search moves to a plugin that drops source positions inside the block, the base path for twin links moves to a plugin that edits each URL in the source, gate markers are rewritten to their tags in the twin, and a callout's alert marker is left out of its search record. The replaceSource each plugin edits through can be passed in, because the app and this package can resolve different copies of fumadocs-core. - The search dialog already carries the combobox, listbox and option roles, so the local combobox wiring goes. The result count, focus return and text-only rendering stay, and results move to the new search hook with table rows rendered as cells. - Results are no longer wrapped in mark elements; matches are highlighted with the CSS Custom Highlight API, so the axe pass no longer looks for a highlighted match. - A table row is now one search record holding a Markdown table, so sanitizing keeps its line breaks. Assisted-by: AI
… Fumadocs upgrade Fumadocs 16.17.9 marks the collapsed sidebar and its hidden open pill inert, which removes them from the focus order and the accessibility tree. The two visibility rules that did the same are dead, so remove them. Point the notes on the forked sidebar folder, the scrolling table and the search provider test at the pinned version instead of old ones. Assisted-by: AI
The search listbox findings it held, a listbox wrapping a second listbox and a scrollable results region that was not keyboard focusable, are gone with the Fumadocs 16.17.9 search dialog. The axe pass reports no WCAG violations with the dialog open, in light, dark, more-contrast and mobile modes. Assisted-by: AI
Search records are sliced from the authored source, so a parent indexed as one record, such as a plain blockquote, still carried the text of a hidden Experimental block inside it, and the twin tag edits, which applied to every stringifier, put the Experimental and Premium tags and the default callout text into search. Edit the gate's opener, closer and body nodes in the search stringifier only: a runtime Experimental block is removed, and the tags of the other gates are dropped with their body kept. The block's own search records are still emptied through structuredData, which needs the body positions the plugin used to strip. Put the safe Markdown renderer after the spread in SearchResultItem so a caller cannot replace it. Assisted-by: AI
Resolve the threat-model.md conflict by keeping its deletion from #308. Assisted-by: AI
Keep the Fumadocs bumps beside next 16.4.5 from main in the catalog, and regenerate the lockfile with pnpm install so both land together. Assisted-by: AI
…ed gates Fumadocs keeps only the last replaceSource edit of a node. The hidden body of a runtime Experimental block was blanked before transformList ran, so a gate nested inside it, such as a Premium block in a blockquote, pushed its own search edit on the same node afterwards and its text came back into the search record. Blanking after the nested gates are built makes the empty edit the last one. Assisted-by: AI
…-core copies An edit made through one fumadocs-core copy's replaceSource is ignored by another copy's remarkStructure and twin stringifier, so defaulting to this package's own copy failed open: when the consumer's fumadocs-mdx resolved a different copy, the Experimental search exclusion, the twin gate tags and the callout marker edits were all dropped without an error. pnpm already installs several peer variants of fumadocs-core in this workspace. Making fumadocs-core a peer dependency would not help here, because a workspace package keeps its own linked copy, so the pipeline now throws when no replaceSource is passed and fumadocs-mdx's default remarkHeading is not this package's. Both READMEs, which ship in the release tarballs, now show replaceSource and basePath in the recipe, and the docs-next README describes a twin as the authored Markdown with the source edits applied. Assisted-by: AI
The twin base path was passed raw, unlike the release schedule URL above it and next.config.mjs, so "/docs/" gave twin links like /docs//admin/. It now goes through normalizeBasePath, which strips the trailing slash and refuses a value such as "/" that would have produced a protocol-relative link. Assisted-by: AI
…tched DocsSearchDialog dropped the error from experimental_useSearch, so a failed index fetch left an empty dialog and Fumadocs' Search failed status never appeared. SearchDialogView now takes the error and hands it to Fumadocs' SearchDialog, as the hybrid dialog already does. Fumadocs' status is itself a live region, so the result-count region does not repeat it. Assisted-by: AI
parseTableRecord filtered out every all-dash line, so a data row whose cells were all dashes was dropped and the header rendered in its place. Fumadocs always writes the header (when there is one), the delimiter and then the row, so the second line is the delimiter. Also pin that raw HTML in a table row's cells and header renders as text, as the text records' safety tests already do. Assisted-by: AI
The sidebar landmark note and the Tabs styling note still named 16.15. Both still hold for 16.17.9: its sidebar slot has no landmark or aria-current option, and its styled Tabs keeps the same container classes. Assisted-by: AI
…list SOURCE_MARKER and MARKER each spelled out the five GitHub alert kinds, so adding a kind to one but not the other would have left its marker in the search records. Both patterns, and the GithubAlert type, now come from one list; the compiled patterns are unchanged. Assisted-by: AI
The docs-next and docs-build e2e tests compiled through coderMdxOptions, whose fumadocs-core copy differs from the one their fumadocs-mdx runs against, so their source edits had been dropped silently. The pipeline now throws in that case, so each test builds it with replaceSource from its own package's fumadocs-core, which is what an app does. Assisted-by: AI
… replaceSource is passed The guard recognised another fumadocs-core copy by remarkHeading's name, so a build that minified or renamed that export would slip past it and drop the search edits silently again. Without a passed replaceSource, the default plugins must now include this package's own remarkHeading by identity, so an unrecognised list fails closed too. Assisted-by: AI
…-17-upgrade # Conflicts: # pnpm-lock.yaml
…0 and fumadocs-mdx 15.6.0 fumadocs-openapi 12.6 needs fumadocs-core 16.17.11 or later. These are the newest releases at least a week old. fumadocs-ui 16.18.0 changed its TabsContent: an `id` is now only a hash alias and never reaches the panel, which gets Radix's label-derived id instead. That broke every classic anchor that names a tab panel, and the tab and panel labelling. TabSet now renders each panel with Radix's own TabsContent, the primitive fumadocs-ui wraps, so the id we pass is on the server-rendered panel again, and opens the tab a hash names or holds itself, as fumadocs-ui did. escapeTabValue follows fumadocs-ui's escaping, which now replaces every whitespace run, not just the first. The provenance notes on the copied tab, table and search-hit code now name 16.19.0, which they were checked against. Assisted-by: AI
fumadocs-ui 16.18.0 renders its own "Skip to Content" link in the docs layout, with no option to turn it off, and only `sr-only`, so it stays invisible when focused. It sat second in the tab order, right after ours, which is visible on focus and moves focus into the article. The theme now removes fumadocs-ui's. Assisted-by: AI
…ing it in the browser fumadocs-ui 16.19.0's SidebarItem and SidebarFolderLink set aria-current on the active link themselves, so the current page is marked in the server-rendered HTML. Our split folder row's own link now does the same, and SidebarLandmarks keeps only the navigation landmark, which fumadocs-ui still has no slot for, and stops watching data-active. Assisted-by: AI
…-19-upgrade # Conflicts: # packages/docs-next/src/search-markdown.tsx # packages/docs-next/src/sidebar-folder.tsx # packages/docs-next/src/sidebar-landmarks.tsx # packages/docs-ui/src/scroll-table.tsx # packages/docs-ui/src/tabs.tsx # pnpm-lock.yaml # pnpm-workspace.yaml
Jesswinters
left a comment
There was a problem hiding this comment.
I found no P0 or P1 issues, so I'm approving. I'd fix the P2 inline about the @radix-ui/react-tabs pin before 1.2.2 ships; it's in RC now.
I checked the tab change against fumadocs-ui 16.19.0's components/ui/tabs.js. Upstream's TabsContent only registers an id in valueToIdMap, which the root's openFromHash reads, and it never puts that id on the panel. Rendering Radix's TabsContent directly puts our id back on the panel. That leaves upstream's map and panel set empty, so its hash handler does nothing and doesn't fight ours. TabSet's openFromHash mirrors upstream's logic, and limiting it to rootRef.current.contains(panel) means nested or sibling tab sets each open only their own panel. The lockfile resolves a single @radix-ui/react-tabs@1.2.1, so the panels share the root's Radix context. Our skip link is a.docs-skip-link, so the new a.sr-only[href="#nd-page"] rule hides only fumadocs-ui's link.
In stringifier.js in fumadocs-core 16.19.0, an edit with no namespace still applies to every stringifier, and a search edit applies only to search, so the gate and twin edits from #298 keep their meaning. The conditional-content e2e cases, including the nested-gate blockquote, pass.
I also merged #371 into this branch locally. The merge is clean, docs-next passes 369/369 and typechecks, and the fumadocs-ui/utils/use-copy-button and components/ui/button exports that #371's fork imports are still there in 16.19.0.
Locally at 7b564e2: docs-ui 193/193, docs-next 369/369, docs-transforms 421/421, docs-theme 30/30, apps/docs 341/341, pnpm typecheck 19/19 tasks, pnpm lint 12/12 tasks. I didn't run the axe or layout-shift passes, or try the preview in a browser.
This review was generated by Coder Agents on behalf of @Jesswinters.
| "@coder/docs-config": "workspace:*", | ||
| "@coder/docs-manifest": "workspace:*", | ||
| "@phosphor-icons/react": "2.1.10", | ||
| "@radix-ui/react-tabs": "1.2.1", |
There was a problem hiding this comment.
P2: TabSet now relies on this package and fumadocs-ui resolving the same @radix-ui/react-tabs instance, because the panel reads the root's Radix context. fumadocs-ui 16.19.0 asks for ^1.2.1, and this pins exactly 1.2.1. Today both resolve to 1.2.1. 1.2.2 is already in RC, though. Once it's out, a lockfile regeneration here, or any consumer that installs the docs-ui tarball fresh, resolves fumadocs-ui to 1.2.2 and us to 1.2.1. That gives two copies, and Radix throws "TabsContent must be used within Tabs" on every page with a tab set. In this repo the tests would catch it, but an in-product consumer wouldn't find out until it rendered.
Using fumadocs-ui's own range (^1.2.1, here and in docs-next's devDependencies), or a catalog entry both use, lets pnpm and npm dedupe to one copy. Declaring it as a peer dependency next to fumadocs-ui would be stricter. Either way, a test that imports Radix's TabsContent from both paths and checks they're the same module would turn this into a clear CI failure.
There was a problem hiding this comment.
Done in 3a3c82c. The version is now a catalog entry (^1.2.1, fumadocs-ui's own range) that docs-ui and docs-next both use, and the lockfile still resolves the single 1.2.1. I added a test in tabs.test.tsx that resolves @radix-ui/react-tabs from this package and from fumadocs-ui and fails if they are different copies. I did not run it against a split install, so I have only seen it pass on the single copy. I did not make it a peer dependency.
| const panel = document.getElementById(ids(v).panel); | ||
| if (!panel || !rootRef.current?.contains(panel)) continue; | ||
| if (panel === target) { | ||
| onValueChange(v); |
There was a problem hiding this comment.
P3: opening a tab from the hash calls onValueChange directly, as upstream's setValue does. With a groupId, though, the other tab sets in the group don't follow, and sessionStorage isn't updated, so the next reload or soft navigation restores the old tab. That matches upstream's behaviour, so I'm noting it rather than asking for a change. If you want deep links to stick, route the change through the root's group listeners.
There was a problem hiding this comment.
No change, as you said: it matches upstream. Deep links not sticking across a tab group or a reload is left as is.
TabSet reads the root's Radix context, so docs-ui and fumadocs-ui must resolve the same @radix-ui/react-tabs. An exact pin would split them the day fumadocs-ui's range resolves to a newer patch, and every tab set would throw. A catalog range lets pnpm and npm dedupe, and a test fails if the two packages ever resolve different copies. Assisted-by: AI
The copy button landed on 16.17.9. MarkdownCopyButton in 16.19.0 differs only by its BASE_URL prefix, which the fork already drops. Assisted-by: AI
Merge order
#298 (Fumadocs 16.17.9) is merged, so this targets
main. Merge this before #273 (the REST API reference): fumadocs-openapi 12.6 needs fumadocs-core 16.17.11 or later and fumadocs-ui 16.17.8 or later, which this provides. The commit list shows #298's commits because it landed as a squash; the diff againstmainis only this PR's change.Summary
Upgrades fumadocs-core and fumadocs-ui from 16.17.9 to 16.19.0 and fumadocs-mdx from 15.4.10 to 15.6.0, the newest releases at least a week old (all published 2026-11-11). 16.19.1 to 16.19.4 came out in the last week; their fixes (an MDX comment containing
<, a heading with a component expression, custom-id collisions,llms()sections) don't touch our corpus: a search of coder/codermain'sdocs/and both fixture corpora found no such comments, no JSX in headings and no member tags. Three changes were needed to keep behaviour the same, and one workaround is now mostly upstream.Fix
Tab panels keep their ids. fumadocs-ui 16.18.0 changed
TabsContent: anidis now only an alias the URL hash can name, and never reaches the panel, which gets Radix's label-derived id (radix-…-content-install-coder via docker run, with spaces). That broke every classic anchor that names a tab panel and the tab and panelaria-controls/aria-labelledbypairing (21 docs-ui and docs-next tests failed).TabSetnow renders each panel with Radix's ownTabsContent, the primitive fumadocs-ui wraps, from the same single@radix-ui/react-tabs1.2.1 install, so our id is on the server-rendered panel again.TabSetnow opens the tab a hash names, or the tab holding the element it names, itself, as fumadocs-ui's root did through its own panels.escapeTabValuefollows fumadocs-ui's escaping, which now replaces every whitespace run, not just the first.One skip link. fumadocs-ui 16.18.0 renders its own "Skip to Content" link in the docs layout, with no option to turn it off. It has only
sr-only, so it stays invisible when focused, and it sat second in the tab order, after ours. The theme now sets it todisplay: none; ours stays first, visible on focus, and still moves focus into the article.aria-currentis server-rendered. fumadocs-ui 16.19.0'sSidebarItemandSidebarFolderLinksetaria-current="page"on the active link. Our split folder row's own link now does the same, andSidebarLandmarksdrops its browser-sidearia-currentpass and itsdata-activeobserver, keeping only the navigation landmark, which fumadocs-ui still has no slot for.Back-out audit of code we carry for things 16.17.10 to 16.19.0 changed:
sidebar-landmarks.tsxaria-current: removed, replaced by fumadocs-ui's and our folder link's server-rendered attribute. The navigation landmark half is kept.sidebar-folder.tsx(the split folder row): kept. 16.19.0's sidebar slot only reordered imports; the row is still ours. It gainsaria-current.shell.tsx,skip-link-focus.tsx): kept. fumadocs-ui's is invisible on focus; ours replaces it.drawer-keyboard.tsx: kept. 16.18.0'sSidebarProvidernow closes the drawer on Escape, but it returns focus only onanimationend, which never fires with animations off (our reduced-motion setting), and it doesn't hand focus to the header toggle. The two don't double-close: ours prevents default, and fumadocs-ui's skips prevented events.idSafe, hash decoding): kept, now insideTabSet, since fumadocs-ui no longer puts our ids on the panels.edit-on-github.ts: kept. 16.18.0 defaultsshatomain, but we repoint release tags tomainand keep refs with slashes (release/2.36) whole.scroll-table.tsx: kept. 16.19.0'sTableis still a tab stop whether or not it overflows.search-markdown.tsx: kept. 16.19.0's search dialog changed only the close button's name.Provenance notes on the copied tab, table, sidebar and search-hit code now name 16.19.0, which they were checked against.
Security notes. 16.18.3 to 16.19.0 change how search records and processed Markdown are built: search records keep the elements of every component by default (
filterElementofremarkStructure), processed Markdown and search resolve JSX elements like the page,replaceSourcegains amarkdownnamespace, and removed content no longer leaves blank lines. I built the fixture site on both 16.17.9 and 16.19.0 and compared the outputs. The search index is identical: 124 records, none added or removed, none with an HTML tag. Heading ids are identical across every page. The.mdtwins andllms.txt/llms-full.txtdiffer only by removed blank lines. NofilterElementsetting was needed. The search XSS suites (search-xss,search-dialog,hybrid-search,search-markdown,search.e2e) and the conditional-content cases in docs-transforms, including the nested-gate blockquote case, pass unchanged. Raw HTML rendering is untouched: the sanitizer and the search-hit renderer are ours and unchanged.QA
The preview needs a
docs-previewreviewer to approve the deploy before its URL appears in the bot comment and thedocs previewstatus on this PR. It serves from the site root, needs a Vercel login, and always shows this PR's latest deploy. Check in Firefox and Chrome.<preview>/get-started/. Click each tab in a tab set. Expected: each tab shows its own panel and nothing else moves on the page.<preview>/admin/users/. Press Tab once. Expected: a "Skip to content" box appears top left. Press Enter, then Tab again. Expected: focus moves into the article, not to an invisible link.workspace. Expected: results show as before, with the match highlighted and no raw markup.Pages to compare
<preview>/get-started/<preview>/admin/users/<preview>/<preview>is the URL in the docs preview comment on this PR.Testing
pnpm typecheck19/19 tasks,pnpm lintclean.aria-currenttest, and the server-rendered sidebararia-currenttest.pnpm --filter @coder/docs-site a11y:axeon the fixture build: 70 scans, 0 WCAG violations, 0 allowlisted; 6 best-practice findings, allempty-table-headeron/authoring/tables./,/admin/and/authoring/tables/through load, sidebar hover and tab clicks: identical to the 16.17.9 build on every page, and interactions add none.llms*.txtdiffer only by blank lines.Upstream
Yes, one: fumadocs-ui's new
SkipToContentuses onlysr-only, so it is invisible when focused (WCAG 2.4.7), and layouts render it with no way to turn it off. Likely to be accepted as an accessibility bug fix (focus:not-sr-onlyor similar). It needs Nick's go-ahead before filing, under DOCS-1026. TheTabsContentid change is a deliberate upstream design choice, so no.Linear: https://linear.app/codercom/issue/DOCS-1532
🤖 Built with AI assistance.