You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The simplest that I hit: A page has multiple side panels with info. Which panel is open depends on the query string (/page?panel=X), so the view can be shared and other pages can link to it.
The server ignores the param: it's left out of revalidateQueryAllowlist, so every variant shares one ISR entry, and the panel opens on the client.
When the user opens, switches or closes a panel, ?panel= should change in place: no new history entry, no request, no re-render.
which is a full GET navigation. For state the server doesn't render, that means:
The page data is fetched again on every change, in our case that's about 122 KB except the exact entry was cached already.
Deferred props go back to loading, which would include our panel.
So instead of using it we fall back to the raw history.replaceState. That works, but the router no longer matches the address bar: useRouter().url / .query keep reporting the old query until the next navigation.
API Proposal
Something like
router.replaceUrl(url);// or router.visit(url, { replace: true, shallow: true })
This would:
write history (replace, or push as an option),
update the router's route state
keep scroll-restoration bookkeeping in step,
does not fetch, re-render, or touch deferred props.
This is similar to what other meta frameworks do, e.g. SvelteKit's replaceState or Next.js's shallow routing.
Activity