Skip to content

feat(nextjs): parallel routes support#189

Closed
feugy wants to merge 2 commits intocanaryfrom
damien/nextjs-parallel-routes-support
Closed

feat(nextjs): parallel routes support#189
feugy wants to merge 2 commits intocanaryfrom
damien/nextjs-parallel-routes-support

Conversation

@feugy
Copy link
Member

@feugy feugy commented Feb 23, 2026

🖖 What's in there?

This PR includes Nextjs parallel routes besteffort support.

🤺 How to test?

There are two new routes in the nextjs-15 demo app: /parallel-routes/dashboard and parallel-routes/settings.
Open the dev tools and check in console for the detected route and actual path.

🔬Notes to reviewers

In Next.js App Router, useParams() merges params from all active route segments, including parallel route slots (@folder convention). When a layout has a slot with a catch-all segment (e.g., @sidebar/[...catchAll]/page.tsx), that slot's params appear in useParams() even though they don't correspond to the URL structure.

The bug: on a static route like /parallel-routes/dashboard, useParams() returns { catchAll: ['dashboard'] } (from the sidebar slot). computeRoute('/parallel-routes/dashboard', { catchAll: ['dashboard'] }) then produces /parallel-routes/[...catchAll] instead of the correct static path.

The reproduction is already built at apps/nextjs-15/src/app/parallel-routes/.

How It Handles Each Scenario

Scenario useParams() useSelectedLayoutSegments('children') Filtered params Route
Static route + slot { catchAll: ['dashboard'] } ['parallel-routes', 'dashboard'] (no slash segments) {} /parallel-routes/dashboard ✅
Dynamic + slot { id: '123', catchAll: ['123','d','t'] } ['p-r', '123', 'detail', 'test'] { id: '123' } 5/parallel-routes/[id]/detail/[slug]` (with slug from params) ✅
Catch-all /docs/[...slug] (single-segment) { slug: ['intro'] } ['docs', 'intro'] (no slash) {} /docs/intro ⚠️ (acceptable regression)
Catch-all /docs/[...slug] (multi-segment) { slug: ['api', 'ref'] } ['docs', 'api/ref'] { slug: ['api', 'ref'] } /docs/[...slug] ✅
Pages Router { id: '123' } null unfiltered /path/[id] ✅

@feugy feugy requested review from a team and tobiaslins February 23, 2026 16:23
@vercel
Copy link

vercel bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
analytics-astro Ready Ready Preview, Comment Feb 24, 2026 1:47pm
analytics-next15 Ready Ready Preview, Comment Feb 24, 2026 1:47pm
analytics-nextjs Ready Ready Preview, Comment Feb 24, 2026 1:47pm
analytics-nuxt Ready Ready Preview, Comment Feb 24, 2026 1:47pm
analytics-remix Ready Ready Preview, Comment Feb 24, 2026 1:47pm
analytics-sveltekit Ready Ready Preview, Comment Feb 24, 2026 1:47pm
analytics-vue Ready Ready Preview, Comment Feb 24, 2026 1:47pm

Request Review

Copy link
Collaborator

@tobiaslins tobiaslins left a comment

Choose a reason for hiding this comment

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

thank you! i hope we can finally get the real route from Nextjs

@feugy
Copy link
Member Author

feugy commented Feb 25, 2026

After discussion with @tobiaslins, we're not gonna fix this in the this package, this should be addressed in Next.js instead

@feugy feugy closed this Feb 25, 2026
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