docs: update documentation for the odysseus major release#340
docs: update documentation for the odysseus major release#340ErnestM1234 wants to merge 3 commits into
Conversation
Updates docs and templates to match the odysseus release across gt-next, gt-react, gt-react-native, gt-tanstack-start, gt-node, gt-i18n, and generaltranslation. All changes verified against the odysseus branch source. - gt-next: remove gt-next/client, trim gt-next/server to server-only exports, GTProvider props reduced to children, env-var-only credentials, renderSettings timeout-only, headers/cookies config, new <Link> page, Cache Components requirements, SSG cleanup - gt-react: initializeGT()/initializeGTSPA() setup, GTProvider requires locale + translations snapshot, no loading states, Vite env credentials - gt-react-native: named plugin export, initializeGT in app entry, GTProvider fallback prop, quickstart fixes - gt-tanstack-start: getTranslationsSnapshot(locale) + parseLocale loader flow, re-exported gt-react surface - Types: InlineTranslationOptions -> GTTranslationOptions, DictionaryTranslationOptions -> TranslationVariables (slugs kept), $context/$locale sugar options - Dictionary miss now throws for missing default-locale entries; missing target-locale translations fall back to source - id no longer affects the translation hash - CLI/compiler: legacyGtReactImportSource parsing flag Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Setup now differs fundamentally between the two rendering models, so each
gets its own quickstart. Also cross-references all quickstarts against the
official gt-test-apps (odysseus) and fixes drift found there.
- react: new tutorials/quickstart-spa (initializeGTSPA entry-split pattern,
compiler plugin step, no provider) and tutorials/quickstart-ssr
(initializeGT + getTranslationsSnapshot loader + GTProvider); index.mdx
is now a chooser page; nav updated (removes dangling quickstart entry)
- tanstack-start: install/import from gt-tanstack-start only, root route
uses component + Outlet, explicit initializeGT params, selective SSR
section, correct dev port
- next: html lang={await getLocale()} in quickstart layout,
cache-components auto-detected getLocale/getRegion pattern and fence
fixes, ssg anchor that the shipped gt-next warning deep-links to
- node: middleware examples use getRequestLocale(req)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Follow-up pushed (5f491e2): split the React quickstart into separate SPA and server-rendered guides (SPA needs no
Flagged for test-apps maintainers: |
The odysseus branch removed getGTClass/useGTClass and the legacy initGT alias, replacing the locale-alias use case with a standalone resolveCanonicalLocale() helper. - locale-aliases: use resolveCanonicalLocale from gt-next instead of getGTClass().resolveCanonicalLocale() - with-gt-config: drop the initGT legacy callout and frontmatter mention Verified no docs reference the other removals (useVersionId, gt-next/types, generaltranslation/core, gt-i18n/fallbacks, useShouldTranslate). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Updated for the latest odysseus push (a9d321a..1f53e42, the API-surface cleanup PRs #1815–#1824):
Audited the rest of the cleanup against the docs — no other pages referenced the removals ( Links, CI greps, and the content build (500 pages) all pass. |
Summary
Updates all documentation to match the odysseus major release (gt-next/gt-react/gt-react-native/gt-tanstack-start v11, generaltranslation v9, gt-i18n/gt-node v1). Every documented claim was verified against the
odysseusbranch source in the gt monorepo — including several places where the internal breaking-changes notes turned out to be inaccurate.gt-next
gt-next/clientremoved;gt-next/servernow documents only server-only exports (getLocale,getRegion,getLocaleDirection,registerLocale,tx,Tx,getTranslations,getMessages,getGT); everything else moved to thegt-nextindexGTProviderprops reduced tochildren(removediddictionary subsetting,locale,region)withGTConfig: credentials are env-var only (GT_API_KEY,GT_PROJECT_ID,NEXT_PUBLIC_GT_PROJECT_IDfor client exposure); removedcustomMappingprop and all experimental SSG/locale-resolution props;renderSettingsis timeout-only; documentedheadersAndCookies(incl. newenableI18nCookieName)<Link>component page (gt-next/link)loadTranslations+getLocale/getRegionnow required; caching delegated to Next.jsgt-react
initializeGT()(server-rendered) /initializeGTSPA()(SPA); config is read-once/immutable; custom cookie names configured thereGTProvidernow requireslocale+translationssnapshot (viagetTranslationsSnapshot(locale)); no loading states; SPAs don't need a providerVITE_GT_PROJECT_ID,VITE_GT_DEV_API_KEY) documentedgt-react-native
{ plugin }) — quickstarts fixedinitializeGT()in the app entry;GTProviderkeeps async loading with thefallbackprop (unique among the packages)LocaleSelectoris not exported bygt-react-native; Expo Go doesn't work with the native modulegt-tanstack-start
getTranslations()replaced bygetTranslationsSnapshot(locale)+parseLocale()in the route loader; quickstart rewrittenCross-cutting
InlineTranslationOptions→GTTranslationOptions,DictionaryTranslationOptions→TranslationVariables(+DictionaryEntryOptionsfor entry metadata). Page slugs kept (no redirect infra) with "formerly named" notesDictionary entry ... cannot be found) for missing default-locale entries in dev and prod; missing target-locale translations fall back to the source entryidno longer affects the translation hash (descriptive platform metadata only)$context/$localesugar options (barecontextand$_localesremoved)legacyGtReactImportSourceparsing flag documented;GTRuntimesection added to core docsCorrections to the internal notes (intentionally NOT applied)
GTclass is not target-locale agnostic (targetLocaleremains) and keeps its formatting methodsgt-i18n/fallbackswas not removeduseGT()works in RSC (unwrapsgetGT()viause())getGTClass()/useGTClass()return aGTRuntime(full runtime surface), not a translate-only classFollow-ups (out of scope here)
withGTServerSideProps,parseLocale,getTranslationsSnapshot) have no docs home yet — no existing Pages Router surface to extendVerification
scriptslink validator passes (438 files)pnpm build:contentpasses (498 pages, including the new Link page)🤖 Generated with Claude Code