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
ec39aa46
Unverified
Commit
ec39aa46
authored
Feb 04, 2020
by
JJ Kasper
Committed by
GitHub
Feb 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update optimize event with static 404 status (#10420)
Co-authored-by:
Joe Haddad
<
timer150@gmail.com
>
parent
ecd628b7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
index.ts
packages/next/build/index.ts
+1
-0
build.ts
packages/next/telemetry/events/build.ts
+1
-0
index.test.js
test/integration/telemetry/test/index.test.js
+11
-0
No files found.
packages/next/build/index.ts
View file @
ec39aa46
...
@@ -773,6 +773,7 @@ export default async function build(dir: string, conf = null): Promise<void> {
...
@@ -773,6 +773,7 @@ export default async function build(dir: string, conf = null): Promise<void> {
durationInSeconds
:
analysisEnd
[
0
],
durationInSeconds
:
analysisEnd
[
0
],
staticPageCount
:
staticPages
.
size
,
staticPageCount
:
staticPages
.
size
,
ssrPageCount
:
pagePaths
.
length
-
staticPages
.
size
,
ssrPageCount
:
pagePaths
.
length
-
staticPages
.
size
,
hasStatic404
:
useStatic404
,
})
})
)
)
...
...
packages/next/telemetry/events/build.ts
View file @
ec39aa46
...
@@ -40,6 +40,7 @@ type EventBuildOptimized = {
...
@@ -40,6 +40,7 @@ type EventBuildOptimized = {
ssrPageCount
:
number
ssrPageCount
:
number
hasDunderPages
:
boolean
hasDunderPages
:
boolean
hasTestPages
:
boolean
hasTestPages
:
boolean
hasStatic404
:
boolean
}
}
export
function
eventBuildOptimize
(
export
function
eventBuildOptimize
(
...
...
test/integration/telemetry/test/index.test.js
View file @
ec39aa46
...
@@ -8,6 +8,7 @@ import {
...
@@ -8,6 +8,7 @@ import {
findPort
,
findPort
,
killApp
,
killApp
,
waitFor
,
waitFor
,
nextBuild
,
}
from
'next-test-utils'
}
from
'next-test-utils'
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
2
jasmine
.
DEFAULT_TIMEOUT_INTERVAL
=
1000
*
60
*
2
...
@@ -117,6 +118,16 @@ describe('Telemetry CLI', () => {
...
@@ -117,6 +118,16 @@ describe('Telemetry CLI', () => {
expect
(
event2
).
toMatch
(
/hasTestPages.*
?
true/
)
expect
(
event2
).
toMatch
(
/hasTestPages.*
?
true/
)
})
})
it
(
'detect static 404 correctly for `next build`'
,
async
()
=>
{
const
{
stderr
}
=
await
nextBuild
(
appDir
,
[],
{
stderr
:
true
,
env
:
{
NEXT_TELEMETRY_DEBUG
:
1
},
})
const
event1
=
/NEXT_BUILD_OPTIMIZED
[\s\S]
+
?
{
([\s\S]
+
?)
}/
.
exec
(
stderr
).
pop
()
expect
(
event1
).
toMatch
(
/hasStatic404.*
?
true/
)
})
it
(
'detects isSrcDir dir correctly for `next dev`'
,
async
()
=>
{
it
(
'detects isSrcDir dir correctly for `next dev`'
,
async
()
=>
{
let
port
=
await
findPort
()
let
port
=
await
findPort
()
let
stderr
=
''
let
stderr
=
''
...
...
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