Ariadocs

Migrating from @ariadocs/react

Edit on GitHub

@ariadocs/react is now @ariadocs/mdx.

pnpm remove @ariadocs/react
pnpm add @ariadocs/mdx @ariadocs/components

Renamed

BeforeAfter
@ariadocs/react@ariadocs/mdx
@ariadocs/react/client, /server, /plugins@ariadocs/mdx/client, /server, /plugins
@ariadocs/react/styles/*.css@ariadocs/components/styles/syntax/*.css
mdxComponents optioncomponents
docs.readMdx()docs.read()
docs.getNavItems()docs.getNavigation()
parseMdxRemote({ raw })parseMdx({ source })
serializeMdxRemote({ raw })serializeMdx({ source })
getFrontmatterRemote, getTocRemotegetFrontmatter({ source }), getToc({ source })
result field rawsource
<MdxServer raw options={{ ... }} /><MdxServer source remarkPlugins rehypePlugins />
<MdxClient mdxComponents /><MdxClient components />
ParseResult, SerializeResultParseMdxResult, SerializeMdxResult

Changed behavior

  • index.mdx maps to its folder. getPagePaths() returns "/" and "/guides" instead of "/index" and "/guides/index".
  • Sidebar entries for missing files are skipped. An invalid _meta.json now throws.
  • Files and folders starting with _ are hidden.
  • TOC items are { value, href, depth }.
  • A missing page throws an MdxError. Check it with isMdxNotFound(error).
  • JavaScript frontmatter is refused, and MDX import/export are switched off.
  • Syntax theme rules now only match .token elements, so they no longer restyle other classes in your app.

@ariadocs/openapi

BeforeAfter
openapi.parse(input, options)parseOpenAPI({ source, ...options })
openapi.validate(input)validateOpenAPI(document)
openapi.navigation(api)getNavigation(api)
openapi.search(api, query)search(api, query)
AriadocsOpenAPIAPISpec
api.groupsapi.tags
OpenAPIParseErrorOpenAPIError

@ariadocs/components

BeforeAfter
useOpenAPIContext()useOpenAPI()
useOperationContext().operationuseOperation()
Docs.RootDocs.Layout
styles/openapi.cssstyles.css