mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
* fix(router-generator): type route-group layouts with full path `'/'` A pathless layout inside a route group (`/(group)/_layout`) strips down to `/`, and dropping the trailing slash left `''` in `FileRoutesByPath`. The router gives that layout the full path `/` at runtime, as it does for a pathless layout outside a group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(router-generator): a childless route-group layout next to the index route still generates With route-group layouts now typed with the full path `/`, a layout without child routes yet (`(group)/_layout.tsx` or `(group)/route.tsx`) next to `index.tsx` failed generation with "Conflicting configuration paths", where it used to generate. Pathless and route-group layouts match no URL of their own, so the full-path uniqueness check skips them, as #8817 does. This also lets a childless `_auth.tsx` next to the index route generate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(router-generator): a pathless layout that carries a path still conflicts `foo/_layout.tsx` without `foo.tsx` is given `path: '/foo'`, so it matches `/foo` like `(group)/foo.tsx` or `foo_.tsx` does. Main rejected that pair as conflicting; the previous commit skipped every pathless layout in the full-path uniqueness check and let both through. Skip only the layouts the route tree gives no `path`, using the same condition the tree printer uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(router-generator): keep main's full-path conflicts, change only the types The route tree lists the index route before a pathless layout, and the router then matches `/` to a childless `_auth.tsx` instead of the index route. Main refused that pair; skipping pathless layouts in the uniqueness check let it through. Keep the check on main's key instead: the stripped full path, which is `''` for a route group's layout, so a childless group layout still generates next to the index route as on main. Only the types use `'/'`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
History
|
|
|---|---|---|
| .. | ||
| .devcontainer | ||
| src | ||
| tests | ||
| .gitignore | ||
| index.html | ||
| package.json | ||
| playwright.config.ts | ||
| tsconfig.json | ||
| vite.config.js | ||