Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
dedd4acb
Commit
dedd4acb
authored
Apr 11, 2026
by
Jimmy Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Arm instant navigation lock immediately
parent
eeb0a2b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
app-globals.ts
packages/next/src/client/app-globals.ts
+11
-1
navigation-testing-lock.ts
...lient/components/segment-cache/navigation-testing-lock.ts
+6
-0
instant-navs-panel.tsx
...ev-overlay/components/instant-navs/instant-navs-panel.tsx
+2
-0
No files found.
packages/next/src/client/app-globals.ts
View file @
dedd4acb
// imports polyfill from `@next/polyfill-module` after build.
import
'../build/polyfills/polyfill-module'
declare
global
{
interface
Window
{
__NEXT_ARM_INSTANT_NAVIGATION_LOCK
?:
()
=>
void
}
}
// Only set up devtools for the dev server.
if
(
process
.
env
.
__NEXT_DEV_SERVER
)
{
require
(
'../next-devtools/userspace/app/app-dev-overlay-setup'
)
as
typeof
import
(
'../next-devtools/userspace/app/app-dev-overlay-setup'
)
...
...
@@ -10,7 +16,11 @@ if (process.env.__NEXT_DEV_SERVER) {
// (e.g. Playwright) sets/clears this cookie to control the navigation lock.
// Browser-only.
if
(
process
.
env
.
__NEXT_EXPOSE_TESTING_API
&&
typeof
window
!==
'undefined'
)
{
const
{
startListeningForInstantNavigationCookie
}
=
const
{
startListeningForInstantNavigationCookie
,
armNavigationLockForTesting
,
}
=
require
(
'./components/segment-cache/navigation-testing-lock'
)
as
typeof
import
(
'./components/segment-cache/navigation-testing-lock'
)
startListeningForInstantNavigationCookie
()
window
.
__NEXT_ARM_INSTANT_NAVIGATION_LOCK
=
armNavigationLockForTesting
}
packages/next/src/client/components/segment-cache/navigation-testing-lock.ts
View file @
dedd4acb
...
...
@@ -81,6 +81,12 @@ function acquireLock(): void {
lockState
=
{
promise
,
resolve
:
resolve
!
}
}
export
function
armNavigationLockForTesting
():
void
{
if
(
process
.
env
.
__NEXT_EXPOSE_TESTING_API
)
{
acquireLock
()
}
}
function
releaseLock
():
void
{
if
(
lockState
!==
null
)
{
lockState
.
resolve
()
...
...
packages/next/src/next-devtools/dev-overlay/components/instant-navs/instant-navs-panel.tsx
View file @
dedd4acb
...
...
@@ -52,6 +52,8 @@ export function InstantNavsPanel() {
}
function
handleStartClientNav
()
{
window
.
__NEXT_ARM_INSTANT_NAVIGATION_LOCK
?.()
if
(
typeof
cookieStore
!==
'undefined'
)
{
cookieStore
.
set
({
name
:
COOKIE_NAME
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment