The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
apps/docs gotchas
Specific traps to watch for. One-liner per item.
Markdown pipeline
- JSX with no schema handler is unwrapped, not dropped. Children pass
through as plain markdown. If a component should disappear entirely from
.mdoutput, its handler must return''. - Handlers run bottom-up. Children are already-serialized markdown
strings by the time the parent handler sees them. Don't try to inspect
child JSX from a parent handler — use
node.childrenonly for structure decisions. mdxFlowExpression/mdxTextExpression/mdxjsEsmare skipped. Anything wrapped in{...}won't appear in markdown output.<AiPrompt id="…" />carries only an ID. Prompt text lives indata/ai-prompts.data.ts; don't inline prompt strings in MDX. Markdown export handles thePromptPanelparts viainternals/markdown-schema/PromptPanel.ts(dropsPromptCopy).<$Partial>recursion is silent. A missing or unreadable partial is dropped without error. Checkpartials/paths when content seems missing from generated.md.$Partialvariablesare runtime-only unless wired in markdown export.partialsRemarksubstitutes{{ .key }}placeholders;inlinePartialsingenerate-guides-markdown.tsmust do the same or nested partials likepath="{{ .prompt }}"fail silently (file not found).GlassPanel/IconPanelmarkdown handlers must include children. A handler that returns onlyprops.titledrops nested content. Seeinternals/markdown-schema/Panel.ts.
Markdown handler authoring
- Handler files in
internals/markdown-schema/must be named after the component (ContentListings.ts, notListings.ts). The registry key ingenerate-guides-markdown.tsis the JSX element name. - Use the existing
withDocsBasePath/addBaseUrlPrefixfrominternal-links.tsfor URL prefixing — don't roll your own. - If a handler needs data, the JSX prop carries an
idand the handler looks the data up from the same registry the runtime component uses. Don't serialize data into JSX props. - Push a blank line right after each exported block (heading, description, list). Keeps handler logic linear and avoids redundant trailing-empty-line branches.
React / MDX components
not-proseis the canonical opt-out from the surrounding.prosetypography. Wrap structural layout innot-prose; keep headings outside so they inherit prose styles.<Heading>fromMdxBase.shared.tsxis the canonical heading. Don't roll your own<h2>/<h3>markup in MDX components — typography drifts.<Link>fromnext/linkworks withtarget="_blank"for external destinations. Don't construct<a>directly.- A
useSendTelemetryEvent()call inside a render path returns a function; don't invoke it directly inside the JSX, build a callback first.
Data modules
- Shared zod schemas for MDX components should use HTML heading levels
(
'h2'|'h3'|'h4'), not markdown marker strings ('##'). Markdown markers belong only ininternals/markdown-schema/handlers (via aRecord/Maplookup). getXById(id)lookups belong in*.utils.ts, not in the data file or the schema file. Schema files hold schemas; data files hold data; utils hold functions.- Each
.data.tsexports named groups; the topicindex.tsaggregates them into aRecord<id, group>map. The aggregation file is the single source of truth for "all valid IDs."
URL handling
- External-link detection is not just
/^https?:\/\//. Protocol-relative (//host),mailto:,tel:, custom schemes — all external. Prefernew URL(href, base)or a broader regex. withDocsBasePath('/guides/foo')→/docs/guides/foo. Already-prefixed URLs are passed through. Use it consistently in markdown output to avoid broken links.
Build / CI
pnpm build --filter=docsruns markdown generation. A failure ingenerate-guides-markdown.tsblocks the build — read its console output rather than the cryptic CI error.pnpm formatfrom the repo root catches most prettier drift. Run it before opening a PR; CI is unforgiving.- Auto-import sorting can silently shuffle imports across files you didn't
touch. Reset those files (
git checkout master -- <path>) before pushing.
Federated docs
See federated-docs.md for the full surface — the
short version:
- No GitHub App credentials in dev =
$CodeSampleshows a warning, not real content. Don't assume the page is broken. pageMapis manual. Upstream renames break links until a maintainer updates the route file.- Wrappers pin to release tags (
docs_v*.*.*). If tagging breaks upstream, build fails. - Search and federated content interact poorly — search infrastructure
is currently decoupled from the markdown generation. See
docs-app-direction.md.
Reference pages
- SDK and CLI reference pages don't go through the standard MDX path —
they're too long for the AST parser in preview environments. Generated
from
spec/instead, output tofeatures/docs/generated/**. - Reference page length is a known UX/LLM problem. Long-term plan: split
into smaller modular pages. Management API is already one endpoint per
page (DOCS-1268); see
management-api-reference.md. - Management API Redocly bundle omits
--dereferencedbecause of a circular$ref. Don't "fix" that by adding--dereferencedwithout checking codegen's cycle-saferesolveRefs. - Don't propose Scalar/Redoc/Elements as the Management API page UI
without covering markdown export, search, and
x-*extension fields.
PR hygiene
- No incidental import reorders or whitespace edits in a feature PR. Reset files that are conceptually unchanged.
- When resetting unrelated files (
git checkout master -- <path>), verify the result matches currentmaster— rebases can resurrect stale file versions. - File names must match the primary export. Rename rather than aliasing on import.
- Single-use helpers stay in the consuming file. Don't add new files in unrelated folders for one-shot utilities.
- Two components with the same JSX shape and different classes → collapse with a discriminator prop. Don't ship near-duplicates.