Repository navigation
Omit undeclared children slots from app routes - #97184
Merged
Merged
Conversation
Contributor
Stats from current PR🔴 1 regression
📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
Build Cache
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (1 file)Files with changes:
View diffsserver.runtime.prod.jsDiff too large to display 📎 Tarball URLCommit: e122d5e |
Contributor
Tests PassedCommit: 581a78c |
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 11, 2026 16:31
1641364 to
1d045ae
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 11, 2026 18:02
6a76677 to
414295e
Compare
gnoff
changed the base branch from
canary
to
jstory/loader-tree-children-ordering
August 11, 2026 18:04
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 11, 2026 18:27
414295e to
37ce26b
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 11, 2026 18:31
37ce26b to
6fd8271
Compare
Base automatically changed from
jstory/loader-tree-children-ordering
to
canary
August 11, 2026 21:30
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
3 times, most recently
from
August 11, 2026 22:07
b7f3d66 to
2cce1a8
Compare
gnoff
changed the base branch from
canary
to
jstory/invalidate-deferred-entry-cache
August 11, 2026 22:09
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 11, 2026 22:30
2cce1a8 to
d759412
Compare
Base automatically changed from
jstory/invalidate-deferred-entry-cache
to
canary
August 12, 2026 15:01
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
2 times, most recently
from
August 12, 2026 15:10
da19ae6 to
7d7ce78
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 12, 2026 22:40
7d7ce78 to
a4ed570
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 13, 2026 00:52
a4ed570 to
b7a9d36
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
2 times, most recently
from
August 13, 2026 15:20
c628e68 to
c9ff857
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 14, 2026 20:19
27e5d25 to
582a569
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 15, 2026 15:45
582a569 to
3956600
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 15, 2026 16:37
3956600 to
98db4ac
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
2 times, most recently
from
August 16, 2026 17:06
3956600 to
d1e8ed6
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
2 times, most recently
from
August 20, 2026 23:26
1db45fe to
1d55754
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 21, 2026 19:35
1d55754 to
a106bbf
Compare
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
2 times, most recently
from
August 26, 2026 22:52
2e0a490 to
e122d5e
Compare
Parallel route layouts can be composed entirely from named slots, but loader tree construction currently synthesizes a children fallback whenever any named slot exists. This makes children semantically required even when no page, default, or ordinary route branch declares it.
This changes strict route matching to omit children from a layout slot set unless the filesystem declares an ordinary route that can render at that level. A layout by itself is only structure and does not declare a route target. Ordinary descendants are traced until they reach a page or default, including through deeper named slots, before they cause children to be included.
For example, this layout declares only named slots:
app/dashboard/layout.tsx
app/dashboard/@left/page.tsx
app/dashboard/@right/page.tsx
With strictRouteMatching disabled, Next.js adds a synthetic children branch whose built-in default calls notFound(), even though the layout never declared or rendered it. With strictRouteMatching enabled, the loader tree contains only left and right, so /dashboard is matched from the route targets that actually exist.
This is different from an ordinary branch whose route targets are deeper in the tree:
app/nested/layout.tsx
app/nested/@sidebar/[...slug]/page.tsx
app/nested/content/layout.tsx
app/nested/content/@left/[...slug]/page.tsx
app/nested/content/@right/[...slug]/page.tsx
Here content really is the children branch of nested. The scan follows content through its layout and deeper named slots, so children remains required. /nested/content/anything can construct every declared slot, while /nested/incomplete only matches sidebar and is still incomplete.
Named slots keep their existing default and soft navigation semantics. Interception routes no longer need a null component for an undeclared child, while a real children branch still uses the default marker needed to preserve its active state. An explicit experimental.strictRouteMatching: false keeps the legacy synthetic child during rollout.
Add coverage for named-only loader trees that do not have a children branch. The tests verify that pages, CSS, metadata, and regular error boundaries still work, and intentionally assert the current broken behavior for HTTP access fallbacks and metadata or viewport failures so those expectations can be flipped when renderer ownership no longer depends on children.
This renames the flag controlling implicit children detection to experimental.explicitParallelRouteChildren and enables the corrected behavior by default. A named-only layout like @left and @right no longer synthesizes an unrelated children slot, while an ordinary descendant page or default still declares children. Set the flag to false to temporarily restore legacy matching. This keeps experimental.strictRouteMatching available for the separate matcher-pruning change. This change only decides whether children exists; it does not remove incomplete route matchers.
gnoff
force-pushed
the
jstory/omit-implicit-children-slots
branch
from
August 27, 2026 16:27
e122d5e to
581a78c
Compare
acdlite
approved these changes
Aug 27, 2026
Open
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Parallel route layouts can be composed entirely from named slots, but loader tree construction currently synthesizes a
childrenfallback whenever any named slot exists. This makeschildrensemantically required even when no page, default, or ordinary route branch declares it.This adds
experimental.explicitParallelRouteChildrenand enables it by default. When enabled,childrenis included in a layout slot set only when the filesystem declares an ordinary route that can render at that level. A layout by itself is only structure and does not declare a route target. Ordinary descendants are traced until they reach a page or default, including through deeper named slots, before they causechildrento be included. Setting the flag tofalsetemporarily restores the legacy implicitchildrenfallback.This flag only controls whether
childrenexists in the loader tree. It does not prune incomplete matchers; that is the separateexperimental.strictRouteMatchingbehavior in the next PR.Named slots keep their existing default and soft navigation semantics. The preceding PR retains the slots owned by an interception host without treating
childrenspecially, so an undeclared child is no longer needed for that behavior. A realchildrenbranch still uses the retention marker when it is one of the host layout slots.Semantics
For example, this layout declares only named slots:
With
explicitParallelRouteChildrendisabled, Next.js adds a syntheticchildrenbranch whose built-in default callsnotFound(), even though the layout never declared or rendered it. With the default behavior enabled, the loader tree contains onlyleftandright, so/dashboardis matched from the route targets that actually exist.This is different from an ordinary branch whose route targets are deeper in the tree:
Here
contentreally is thechildrenbranch ofnested. The scan followscontentthrough its layout and deeper named slots, sochildrenremains required./nested/content/anythingcan construct every declared slot, while/nested/incompleteonly matchessidebarand is still incomplete. The distinction is whether the ordinary descendant eventually reaches a page or default, not whether a layout happens to exist along the way.The focused children detection coverage proves that a layout-only descendant does not synthesize
children, while an ordinary branch whose route targets live inside deeper named slots still does. The limitation coverage also proves that named-only trees render pages, CSS, metadata, and regular error boundaries. It intentionally asserts the current broken behavior for HTTP access fallbacks and metadata or viewport failures so those expectations can be flipped when renderer ownership no longer depends onchildren.Verification
pnpm build-allexplicit-parallel-route-children-detectioninterception-dynamic-segment,parallel-routes-layouts, andexplicit-parallel-route-children-legacy