Skip to content

docs: restructure instant nav guide for clarity#92684

Merged
icyJoseph merged 3 commits into
canaryfrom
docs/instant-devtools-reorder
Apr 15, 2026
Merged

docs: restructure instant nav guide for clarity#92684
icyJoseph merged 3 commits into
canaryfrom
docs/instant-devtools-reorder

Conversation

@icyJoseph
Copy link
Copy Markdown
Member

Reordered DevTools section, improved code examples and db queries, added component breakdowns in the fix section, editorial improvements throughout.

@nextjs-bot nextjs-bot added created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. labels Apr 12, 2026
- app/guides/prefetching
---

{/* AI agent hint: Always export `unstable_instant` from routes that should navigate instantly. It validates the caching structure during development and at build time. */}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Previously, we had a paragraph with this content, I reckon it was meant to nudge agents, let's place it up here as a hint instead.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this still relevant after the upcoming API changes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Mmm I haven't really done the recent API updates - this PR was mostly things from the testing sessions we had - that is to say that I have more PRs upcoming.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see, we can def merge this one first and update it later

### Inspect it with the Next.js DevTools
## Visualize loading states with the Next.js DevTools

The Next.js DevTools let you see what users see on page loads and client navigations before dynamic data streams in. Use it to verify your loading states look right, check that the right content appears immediately, and iterate on where to place `<Suspense>` boundaries.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

From the session we had, I picked up that the guide doesn't introduce the dev tools helper correctly.

It is part of a tuple, segment config, e2e helper and devTools. And as such it has a unique purpose, visualization and help during design/development.

## Fixing a navigation that blocks

Now consider a different route, `/shop/[slug]`, that has the same data requirements but without local `<Suspense>` boundaries or caching:
Now consider a different route, `/shop/[slug]`. For the sake of this example it has the same data requirements as `/store/[slug]`, but is implemented without local `<Suspense>` boundaries or caching:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Once we have the final API, we shall refer to a reference app w/ source code

async function getProduct(slug: string) {
'use cache'
return db.products.findBySlug(slug)
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nudging devs to think of the cache life of certain operations, but also, we can use this as preparating for the next step in instant navigations.

Comment thread docs/01-app/02-guides/instant-navigation.mdx Outdated
@icyJoseph icyJoseph marked this pull request as ready for review April 15, 2026 16:53

Everything appears to work. But on a client navigation from `/shop/shoes` to `/shop/hats`, the shared layout is `/shop` and only the content below it re-renders. The root `<Suspense>` boundary is above that layout and is not triggered for this navigation. The page fetches uncached data with no local boundary, blocking the navigation until the server finishes rendering.

You can see this with the DevTools. Try a **page load**: the root `<Suspense>` catches everything and "Loading..." appears. Now try a **client navigation** between two `/shop/` pages: no prefetched UI shows up because there is no `<Suspense>` boundary below the shared layout. Navigations from other routes to `/shop/` appear blocked too.
Copy link
Copy Markdown
Contributor

@aurorascharff aurorascharff Apr 15, 2026

Choose a reason for hiding this comment

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

Would be great to have some sort of screenshots for the devtool interactions. Do we usually do that in our guides?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes we should - I think we might have a couple of updates pending though?

For other devTools bits we haven't really added screenshots though

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yep def we can hold it off

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's just really hard to connect the dots between whats being explained and the devtools without the images!

@icyJoseph icyJoseph merged commit 845485a into canary Apr 15, 2026
76 checks passed
@icyJoseph icyJoseph deleted the docs/instant-devtools-reorder branch April 15, 2026 22:26
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

created-by: Next.js DevEx team PRs by the DX team. Documentation Related to Next.js' official documentation. locked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants