[Feature] Full client side navigation #83184
lucasbasquerotto
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
No response
Background
I use Next.js primarily for SEO and media link presentation. With the App Router, the first load of a route works well since server-rendered data from the database is delivered and crawlers receive the full HTML.
The issue arises after the initial page load. Once the static assets are already fetched, I only want client-side navigation. Today, Next.js still forces round trips to the server on every navigation, even when the data has already been loaded.
This creates two problems:
Proposal
Introduce a new convention:
client.js
/client.tsx
files that live alongsidepage.js
/page.tsx
.page.tsx
, ensuring proper server rendering for SEO and media previews.client.tsx
file exists for the route, it is used instead of re-fetching the server component tree.client.tsx
file is found, Next.js falls back to the defaultpage.tsx
behavior.client.tsx
can also replacepage.tsx
entirely for routes that do not require server rendering.This gives developers explicit control:
page.tsx
handles SEO and first-load SSR.client.tsx
handles fast, client-only navigations.The result is faster development workflow, reduced server load, and smoother navigation in production without giving up the benefits of SSR for SEO and link previews.
Beta Was this translation helpful? Give feedback.
All reactions