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
7a61fb7f
Unverified
Commit
7a61fb7f
authored
Apr 06, 2020
by
Aaron Reisman
Committed by
GitHub
Apr 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup Build Output Types (#11076)
parent
bddd1ce5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
71 deletions
+76
-71
index.ts
packages/next/build/output/index.ts
+71
-68
store.ts
packages/next/build/output/store.ts
+5
-3
No files found.
packages/next/build/output/index.ts
View file @
7a61fb7f
...
@@ -13,8 +13,8 @@ export function startedDevelopmentServer(appUrl: string) {
...
@@ -13,8 +13,8 @@ export function startedDevelopmentServer(appUrl: string) {
consoleStore
.
setState
({
appUrl
})
consoleStore
.
setState
({
appUrl
})
}
}
let
previousClient
:
any
=
null
let
previousClient
:
import
(
'webpack'
).
Compiler
|
null
=
null
let
previousServer
:
any
=
null
let
previousServer
:
import
(
'webpack'
).
Compiler
|
null
=
null
type
CompilerDiagnosticsWithFile
=
{
type
CompilerDiagnosticsWithFile
=
{
errors
:
{
file
:
string
|
undefined
;
message
:
string
}[]
|
null
errors
:
{
file
:
string
|
undefined
;
message
:
string
}[]
|
null
...
@@ -203,7 +203,7 @@ export function ampValidation(
...
@@ -203,7 +203,7 @@ export function ampValidation(
.
filter
(
k
=>
k
!==
page
)
.
filter
(
k
=>
k
!==
page
)
.
sort
()
.
sort
()
// eslint-disable-next-line no-sequences
// eslint-disable-next-line no-sequences
.
reduce
((
a
,
c
)
=>
((
a
[
c
]
=
amp
[
c
]),
a
),
{}
as
any
),
.
reduce
((
a
,
c
)
=>
((
a
[
c
]
=
amp
[
c
]),
a
),
{}
as
AmpPageStatus
),
})
})
return
return
}
}
...
@@ -213,13 +213,13 @@ export function ampValidation(
...
@@ -213,13 +213,13 @@ export function ampValidation(
amp
:
Object
.
keys
(
newAmp
)
amp
:
Object
.
keys
(
newAmp
)
.
sort
()
.
sort
()
// eslint-disable-next-line no-sequences
// eslint-disable-next-line no-sequences
.
reduce
((
a
,
c
)
=>
((
a
[
c
]
=
newAmp
[
c
]),
a
),
{}
as
any
),
.
reduce
((
a
,
c
)
=>
((
a
[
c
]
=
newAmp
[
c
]),
a
),
{}
as
AmpPageStatus
),
})
})
}
}
export
function
watchCompilers
(
export
function
watchCompilers
(
client
:
any
,
client
:
import
(
'webpack'
).
Compiler
,
server
:
any
,
server
:
import
(
'webpack'
).
Compiler
,
enableTypeCheckingOnClient
:
boolean
,
enableTypeCheckingOnClient
:
boolean
,
onTypeChecked
:
(
diagnostics
:
CompilerDiagnostics
)
=>
void
onTypeChecked
:
(
diagnostics
:
CompilerDiagnostics
)
=>
void
)
{
)
{
...
@@ -285,7 +285,9 @@ export function watchCompilers(
...
@@ -285,7 +285,9 @@ export function watchCompilers(
)
)
}
}
compiler
.
hooks
.
done
.
tap
(
`NextJsDone-
${
key
}
`
,
(
stats
:
any
)
=>
{
compiler
.
hooks
.
done
.
tap
(
`NextJsDone-
${
key
}
`
,
(
stats
:
import
(
'webpack'
).
Stats
)
=>
{
buildStore
.
setState
({
amp
:
{}
})
buildStore
.
setState
({
amp
:
{}
})
const
{
errors
,
warnings
}
=
formatWebpackMessages
(
const
{
errors
,
warnings
}
=
formatWebpackMessages
(
...
@@ -312,7 +314,7 @@ export function watchCompilers(
...
@@ -312,7 +314,7 @@ export function watchCompilers(
}
}
const
reportFiles
=
stats
.
compilation
.
modules
const
reportFiles
=
stats
.
compilation
.
modules
.
map
((
m
:
any
)
=>
(
m
.
resource
||
''
).
replace
(
/
\\
/g
,
'/'
))
.
map
(
m
=>
(
m
.
resource
||
''
).
replace
(
/
\\
/g
,
'/'
))
.
filter
(
Boolean
)
.
filter
(
Boolean
)
let
filteredErrors
=
typeMessages
.
errors
let
filteredErrors
=
typeMessages
.
errors
...
@@ -353,7 +355,8 @@ export function watchCompilers(
...
@@ -353,7 +355,8 @@ export function watchCompilers(
})
})
})
})
}
}
})
}
)
}
}
tapCompiler
(
'client'
,
client
,
enableTypeCheckingOnClient
,
status
=>
tapCompiler
(
'client'
,
client
,
enableTypeCheckingOnClient
,
status
=>
...
...
packages/next/build/output/store.ts
View file @
7a61fb7f
...
@@ -17,12 +17,14 @@ export type OutputState =
...
@@ -17,12 +17,14 @@ export type OutputState =
export
const
store
=
createStore
<
OutputState
>
({
appUrl
:
null
,
bootstrap
:
true
})
export
const
store
=
createStore
<
OutputState
>
({
appUrl
:
null
,
bootstrap
:
true
})
let
lastStore
:
OutputState
=
{
}
as
any
let
lastStore
:
OutputState
=
{
appUrl
:
null
,
bootstrap
:
true
}
function
hasStoreChanged
(
nextStore
:
OutputState
)
{
function
hasStoreChanged
(
nextStore
:
OutputState
)
{
if
(
if
(
[
(
[
...
new
Set
([...
Object
.
keys
(
lastStore
),
...
Object
.
keys
(
nextStore
)]),
...
new
Set
([...
Object
.
keys
(
lastStore
),
...
Object
.
keys
(
nextStore
)]),
].
every
(
key
=>
Object
.
is
((
lastStore
as
any
)[
key
],
(
nextStore
as
any
)[
key
]))
]
as
Array
<
keyof
OutputState
>
).
every
(
key
=>
Object
.
is
(
lastStore
[
key
],
nextStore
[
key
])
)
)
{
)
{
return
false
return
false
}
}
...
...
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