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
771c0b45
Unverified
Commit
771c0b45
authored
Aug 15, 2019
by
Joe Haddad
Committed by
GitHub
Aug 15, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `data-next-page` instead of `id=__NEXT_PAGE__` (#8380)
parent
0b15540a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
page-loader.js
packages/next/client/page-loader.js
+2
-2
_document.tsx
packages/next/pages/_document.tsx
+4
-4
No files found.
packages/next/client/page-loader.js
View file @
771c0b45
...
@@ -120,7 +120,7 @@ export default class PageLoader {
...
@@ -120,7 +120,7 @@ export default class PageLoader {
// If the page is loading via SSR, we need to wait for it
// If the page is loading via SSR, we need to wait for it
// rather downloading it again.
// rather downloading it again.
if
(
document
.
getElementById
(
`__NEXT_PAGE__
${
route
}
`
))
{
if
(
document
.
querySelector
(
`script[data-next-page="
${
route
}
"]
`
))
{
return
return
}
}
...
@@ -234,7 +234,7 @@ export default class PageLoader {
...
@@ -234,7 +234,7 @@ export default class PageLoader {
// its own deduping mechanism.
// its own deduping mechanism.
if
(
if
(
document
.
querySelector
(
`link[rel="preload"][href^="
${
url
}
"]`
)
||
document
.
querySelector
(
`link[rel="preload"][href^="
${
url
}
"]`
)
||
document
.
getElementById
(
`__NEXT_PAGE__
${
route
}
`
)
document
.
querySelector
(
`script[data-next-page="
${
route
}
"]
`
)
)
{
)
{
return
return
}
}
...
...
packages/next/pages/_document.tsx
View file @
771c0b45
...
@@ -614,7 +614,7 @@ export class NextScript extends Component<OriginProps> {
...
@@ -614,7 +614,7 @@ export class NextScript extends Component<OriginProps> {
const
pageScript
=
[
const
pageScript
=
[
<
script
<
script
async
async
id=
{
`__NEXT_PAGE__${page}`
}
data
-
next
-
page=
{
page
}
key=
{
page
}
key=
{
page
}
src=
{
src=
{
assetPrefix
+
assetPrefix
+
...
@@ -630,7 +630,7 @@ export class NextScript extends Component<OriginProps> {
...
@@ -630,7 +630,7 @@ export class NextScript extends Component<OriginProps> {
process
.
env
.
__NEXT_MODERN_BUILD
&&
(
process
.
env
.
__NEXT_MODERN_BUILD
&&
(
<
script
<
script
async
async
id=
{
`__NEXT_PAGE__${page}`
}
data
-
next
-
page=
{
page
}
key=
{
`${page}-modern`
}
key=
{
`${page}-modern`
}
src=
{
src=
{
assetPrefix
+
assetPrefix
+
...
@@ -651,7 +651,7 @@ export class NextScript extends Component<OriginProps> {
...
@@ -651,7 +651,7 @@ export class NextScript extends Component<OriginProps> {
const
appScript
=
[
const
appScript
=
[
<
script
<
script
async
async
id=
{
`__NEXT_PAGE__/_app`
}
data
-
next
-
page=
"/_app"
src=
{
src=
{
assetPrefix
+
assetPrefix
+
(
dynamicBuildId
(
dynamicBuildId
...
@@ -667,7 +667,7 @@ export class NextScript extends Component<OriginProps> {
...
@@ -667,7 +667,7 @@ export class NextScript extends Component<OriginProps> {
process
.
env
.
__NEXT_MODERN_BUILD
&&
(
process
.
env
.
__NEXT_MODERN_BUILD
&&
(
<
script
<
script
async
async
id=
{
`__NEXT_PAGE__/_app`
}
data
-
next
-
page=
"/_app"
src=
{
src=
{
assetPrefix
+
assetPrefix
+
(
dynamicBuildId
(
dynamicBuildId
...
...
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