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
4d13d671
Unverified
Commit
4d13d671
authored
Jun 21, 2021
by
Tim Neutkens
Committed by
GitHub
Jun 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add check for startLatency in fast refresh (#26417)
parent
075139a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
hot-dev-client.js
packages/next/client/dev/error-overlay/hot-dev-client.js
+8
-6
No files found.
packages/next/client/dev/error-overlay/hot-dev-client.js
View file @
4d13d671
...
@@ -173,16 +173,20 @@ function handleErrors(errors) {
...
@@ -173,16 +173,20 @@ function handleErrors(errors) {
}
}
}
}
let
startLatency
=
undefined
function
onFastRefresh
(
hasUpdates
)
{
function
onFastRefresh
(
hasUpdates
)
{
DevOverlay
.
onBuildOk
()
DevOverlay
.
onBuildOk
()
if
(
hasUpdates
)
{
if
(
hasUpdates
)
{
DevOverlay
.
onRefresh
()
DevOverlay
.
onRefresh
()
}
}
const
latency
=
Date
.
now
()
-
startLatency
if
(
startLatency
)
{
console
.
log
(
`[Fast Refresh] done in
${
latency
}
ms`
)
const
latency
=
Date
.
now
()
-
startLatency
if
(
self
.
__NEXT_HMR_LATENCY_CB
)
{
console
.
log
(
`[Fast Refresh] done in
${
latency
}
ms`
)
self
.
__NEXT_HMR_LATENCY_CB
(
latency
)
if
(
self
.
__NEXT_HMR_LATENCY_CB
)
{
self
.
__NEXT_HMR_LATENCY_CB
(
latency
)
}
}
}
}
}
...
@@ -192,8 +196,6 @@ function handleAvailableHash(hash) {
...
@@ -192,8 +196,6 @@ function handleAvailableHash(hash) {
mostRecentCompilationHash
=
hash
mostRecentCompilationHash
=
hash
}
}
let
startLatency
=
undefined
// Handle messages from the server.
// Handle messages from the server.
function
processMessage
(
e
)
{
function
processMessage
(
e
)
{
const
obj
=
JSON
.
parse
(
e
.
data
)
const
obj
=
JSON
.
parse
(
e
.
data
)
...
...
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