Skip to content

docs: recommend named routes over path strings for <NuxtLinkLocale>#4020

Merged
BobbieGoede merged 1 commit into
mainfrom
docs/nuxt-link-locale-named-routes
Jul 8, 2026
Merged

docs: recommend named routes over path strings for <NuxtLinkLocale>#4020
BobbieGoede merged 1 commit into
mainfrom
docs/nuxt-link-locale-named-routes

Conversation

@BobbieGoede

@BobbieGoede BobbieGoede commented Jul 8, 2026

Copy link
Copy Markdown
Member

📚 Description

Updates the <NuxtLinkLocale> examples to use named routes (name strings and route objects) and documents why path strings are discouraged: they still work at runtime and are kept for backwards compatibility, but paths depend on the configured strategy and custom paths, so the to prop deliberately only accepts named routes on the type level when typedPages is enabled. The string examples predate typed routes, which is why the docs contradicted the types.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This PR updates the NuxtLinkLocale component documentation to promote named routes over path strings. The "Basic usage" section now shows to accepting a route name or object with a name property. The "Forcing locale resolution" section uses localePath('index') and to="index" instead of path-based examples. The "Path strings" section adds a named-route localePath example and reiterates guidance about typed-pages constraints on the to prop.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The docs now prefer named routes and remove the stale path-string examples, matching the requested alignment for #4005 and #4006.
Out of Scope Changes check ✅ Passed The changes stay within the documented NuxtLinkLocale guidance and examples, with no unrelated code or feature changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the documentation update and main change: recommending named routes over path strings for NuxtLinkLocale.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/nuxt-link-locale-named-routes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@BobbieGoede BobbieGoede merged commit 0bc4280 into main Jul 8, 2026
5 checks passed
@BobbieGoede BobbieGoede deleted the docs/nuxt-link-locale-named-routes branch July 8, 2026 18:44
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.

NuxtLinkLocale to prop rejects plain string paths, contradicting documentation

1 participant