Skip to content

docs(tanstack): fix errors in the TanStack Start guide - #534

Merged
aymericzip merged 5 commits into
aymericzip:mainfrom
kyziq:docs/tanstack-guide-fixes
Nov 1, 2026
Merged

aymericzip merged 5 commits into
aymericzip:mainfrom
kyziq:docs/tanstack-guide-fixes

Conversation

@kyziq

@kyziq kyziq commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Fixes five errors in the TanStack Start guide (docs/docs/*/intlayer_with_tanstack.md), one commit each, applied to all 18 locales. Three of them stop the guide's code from compiling.

Changes

  1. Step numbers: every locale had two steps with the same number, so later steps were off by one. Steps now run 1 to 18, and the FAQ's "Step N" references were updated to match.
  2. useLocalizedNavigate used LOCALE_ROUTE without importing it, and spread navigate options such as search and replace into params, where they were lost. Both now match the template's hook. The file is renamed to .ts, as in the architecture tree.
  3. The home page imported LocaleSwitcher as a default export, but the component only has a named export.
  4. The home page and the metadata examples read content.title, but the dictionary declares it as meta.title.
  5. The contentDir default is ['.'], not ./app (see packages/@intlayer/config/src/defaultValues/content.ts).

The changed code blocks are the same in every locale, so I didn't use the translate script. The only translated text that changes is the ./app value. updatedAt is bumped in each file.

Testing

  • Copied the affected snippets into intlayer-tanstack-start-template (intlayer 9.7.0) and ran intlayer build and tsc --noEmit: 7 errors with the guide on main, 0 with this branch. The params fix in item 2 sits behind an as any cast, so I checked it against the template's hook instead.
  • docs tests pass except markdownFormatting.test.ts, which fails on main too, with the same 9 files. None of them is a TanStack guide.

Not included

  • Step 14 imports getRequestHeaders without using it, and a comment there mentions getIntlayerAsync while the code calls getIntlayer.
  • Other guides, such as intlayer_with_vite+react.md, still give the old ./src default for contentDir.

I can send these in a separate PR.

kyziq added 5 commits November 2, 2026 03:20
Every locale had two steps sharing a number (7 in en, de, es, fr and
zh; 9 or 12 in the others), so the later steps were off by one. Steps
now run 1 to 18 in all 18 locales, and the FAQ references to step
numbers point at the same steps as before.
The hook used LOCALE_ROUTE without importing it, so the snippet did
not compile. It also spread the remaining navigate options (search,
hash, replace...) into params, where TanStack Router ignores them.
Options are now passed through, and caller params are merged with the
locale, as in the TanStack Start template.

The file is renamed to useLocalizedNavigate.ts to match the
architecture tree, since it contains no JSX.
The home page imported LocaleSwitcher as a default export, but the
locale switcher step only defines a named export.
The app dictionary declares title under meta, but the home page and
the three metadata examples read content.title, which does not exist.
They now read meta.title, as the TanStack Start template does.
The content declaration note said contentDir defaults to ./app. The
default is ['.'] (CONTENT_DIR in
packages/@intlayer/config/src/defaultValues/content.ts), as the
configuration reference also states.

> يمكن تعريف إعلانات المحتوى الخاصة بك في أي مكان في تطبيقك بمجرد تضمينها في دليل `contentDir` (افتراضيًا، `./app`). وتطابق امتداد ملف إعلان المحتوى (افتراضيًا، `.content.{json,ts,tsx,js,jsx,mjs,cjs,md,mdx,yaml,yml}`).
> يمكن تعريف إعلانات المحتوى الخاصة بك في أي مكان في تطبيقك بمجرد تضمينها في دليل `contentDir` (افتراضيًا، `['.']`). وتطابق امتداد ملف إعلان المحتوى (افتراضيًا، `.content.{json,ts,tsx,js,jsx,mjs,cjs,md,mdx,yaml,yml}`).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @kyziq

Let's merge

@aymericzip
aymericzip merged commit 2fe847e into aymericzip:main Nov 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants