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
cb786ebd
Unverified
Commit
cb786ebd
authored
Aug 13, 2020
by
Joe Haddad
Committed by
GitHub
Aug 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Share NEXT_DATA type instead of recreating it (#16174)
parent
33176806
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
16 deletions
+3
-16
index.tsx
packages/next/client/index.tsx
+2
-15
utils.ts
packages/next/next-server/lib/utils.ts
+1
-1
No files found.
packages/next/client/index.tsx
View file @
cb786ebd
/* global location */
/* global location */
import
type
{
ParsedUrlQuery
}
from
'querystring'
import
React
from
'react'
import
React
from
'react'
import
ReactDOM
from
'react-dom'
import
ReactDOM
from
'react-dom'
import
{
HeadManagerContext
}
from
'../next-server/lib/head-manager-context'
import
{
HeadManagerContext
}
from
'../next-server/lib/head-manager-context'
...
@@ -16,6 +15,7 @@ import { isDynamicRoute } from '../next-server/lib/router/utils/is-dynamic'
...
@@ -16,6 +15,7 @@ import { isDynamicRoute } from '../next-server/lib/router/utils/is-dynamic'
import
*
as
querystring
from
'../next-server/lib/router/utils/querystring'
import
*
as
querystring
from
'../next-server/lib/router/utils/querystring'
import
*
as
envConfig
from
'../next-server/lib/runtime-config'
import
*
as
envConfig
from
'../next-server/lib/runtime-config'
import
{
getURL
,
loadGetInitialProps
,
ST
}
from
'../next-server/lib/utils'
import
{
getURL
,
loadGetInitialProps
,
ST
}
from
'../next-server/lib/utils'
import
type
{
NEXT_DATA
}
from
'../next-server/lib/utils'
import
initHeadManager
from
'./head-manager'
import
initHeadManager
from
'./head-manager'
import
PageLoader
from
'./page-loader'
import
PageLoader
from
'./page-loader'
import
measureWebVitals
from
'./performance-relayer'
import
measureWebVitals
from
'./performance-relayer'
...
@@ -33,20 +33,7 @@ declare global {
...
@@ -33,20 +33,7 @@ declare global {
/* prod */
/* prod */
__NEXT_PRELOADREADY
?:
(
ids
?:
string
[])
=>
void
__NEXT_PRELOADREADY
?:
(
ids
?:
string
[])
=>
void
__NEXT_DATA__
:
NEXT_DATA
__NEXT_DATA__
:
{
props
:
Record
<
string
,
any
>
err
?:
Error
page
:
string
query
:
ParsedUrlQuery
buildId
:
string
assetPrefix
?:
string
runtimeConfig
?:
object
dynamicIds
?:
string
[]
isFallback
?:
boolean
nextExport
?:
boolean
}
__NEXT_P
:
any
[]
__NEXT_P
:
any
[]
}
}
}
}
...
...
packages/next/next-server/lib/utils.ts
View file @
cb786ebd
...
@@ -82,7 +82,7 @@ export type BaseContext = {
...
@@ -82,7 +82,7 @@ export type BaseContext = {
}
}
export
type
NEXT_DATA
=
{
export
type
NEXT_DATA
=
{
props
:
any
props
:
Record
<
string
,
any
>
page
:
string
page
:
string
query
:
ParsedUrlQuery
query
:
ParsedUrlQuery
buildId
:
string
buildId
:
string
...
...
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