Last 12 weeks · 4 commits
3 of 6 standards met
Description Documents how to provide the key tuple type as the third generic when and are specified explicitly. Adds the tuple-key example across all TypeScript docs language files. Refs vercel/swr#3005. [ ] Adding new page [x] Updating existing documentation [ ] Other updates Validation Verified the documented example with against the built SWR package. currently fails in an unrelated existing TypeScript error: references in the object without an in-scope value.
Description Clarifies the optimistic update example by showing that the current data is read with . Applies the same code example update across all mutation docs language files. Fixes vercel/swr#2944. [ ] Adding new page [x] Updating existing documentation [ ] Other updates Validation currently fails in an unrelated existing TypeScript error: references in the object without an in-scope value.
Preview: https://swr-site-git-geistdocs-package-migration.vercel.sh/docs/getting-started Summary Migrates this site from the vendored/copy-based Geistdocs scaffold to the package-based architecture (). All shared runtime code now comes from the package; the app keeps only thin adapters, content, and site-specific components. 107 files changed, +1,819 / −9,368. What changed Package-based runtime: deleted all vendored geistdocs code (28 components, ai-elements, hooks, chat internals, shadcn ui files). Only three user-owned adapters remain: Dependencies: Next.js 16.0.10 → 16.2.6 (package peer pin); package.json reduced from 38 deps to 14 (AI SDK, streamdown, dexie, shiki, mermaid, etc. are now package-internal) Config layer: uses /; new () with docs/blog/examples content sections; uses per section Routes as thin adapters: , , , , , plus new agent surfaces: , , Proxy: rewritten with (markdown negotiation, agent rewrites, i18n, md tracking) Styles: imports the exported (no local theme copy, no dist ) Homepage removed: the marketing page moves to vercel.com/oss/swr; now redirects to (locale-aware) Edit links: per-section page actions point "Edit on GitHub" at ; the footer GitHub button still points at Examples section: TOC page action links removed (rendered slightly off screen and not needed) Fixes picked up along the way Registered the locale — 30 existing Spanish MDX files were on disk but never served and redirects now point at (previously redirected to a nonexistent locale) Search: locale → Orama stemmer mapping fixed in (the package derives the stemmer from , which breaks for native display names — worth an upstream override in ) Known limitations / search uses the English stemmer (package only special-cases and tokenizers; locale key here is ). CJK queries for Japanese return empty — same as before the migration. returns 404 by design (no configured). Verification (prod build + ) ✅ clean (Next 16.2.6, TypeScript pass) ✅ Docs/blog/examples pages across all 8 locales (en, es, fr, ja, ko, pt, ru, cn) ✅ → 307 → ; → ✅ , , , , OG images ✅ / page URLs and negotiation (docs, blog, examples) ✅ returns results; → 308 ✅ Examples pages render no TOC action links; docs/blog keep theirs
The root now 307s to the vercel.com/oss/swr lander (#652), so the SWR wordmark in the nav () was bouncing readers off the docs they were already on. It now deep-links to , locale-aware. Preview Details Context: Jiachi's thread — on previews the old link even landed on the SSO page. Swept the repo for other links: this was the only one. Footer and menus point at real sections, no links the root, the language selector keeps the current path, and the old landing page's own CTAs already target the docs. Left intentionally: non-default locale roots (, , …) still serve the old landing page — #652 scoped the redirect to the bare root. Happy to extend it to locale roots if that's the direction for the Geistdocs port; your call @huozhi @molebox.
HOLD — merge only after the flag is flipped on vercel.com (until then this would bounce the root into a 404). Part of the SWR lander launch: redirects to the new marketing page at vercel.com/oss/swr; everything else on this site (docs, blog, examples, all locales) is untouched. The lander's "Get started" CTAs point back at , so the loop closes. → 307** on purpose for the launch soak; a follow-up flips it to (308) once the lander has settled. Locale roots (, , …) keep their local landing pages for now — scope is the bare root only.
Repository: vercel/swr-site. Description: The official website for SWR. Stars: 510, Forks: 361. Primary language: MDX. Languages: MDX (85.9%), TypeScript (13.9%), CSS (0.1%), JavaScript (0%). License: Apache-2.0. Homepage: https://swr.vercel.app Open PRs: 40, open issues: 81. Last activity: 13h ago. Community health: 75%. Top contributors: shuding, huozhi, koba04, huzhengen, pacocoursey, vassbence, dependabot[bot], valentinpolitov, leodr, guilherssousa and others.