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
d6ad201f
Unverified
Commit
d6ad201f
authored
May 23, 2020
by
Joe Haddad
Committed by
GitHub
May 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fast Refresh] Upgrade `react-refresh` (#13285)
Closes #13254
parent
12e0db04
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
6 deletions
+47
-6
package.json
packages/next/package.json
+1
-1
package.json
packages/react-refresh-utils/package.json
+2
-2
refresh.js
test/integration/getserversideprops/pages/refresh.js
+23
-0
index.test.js
test/integration/getserversideprops/test/index.test.js
+17
-0
yarn.lock
yarn.lock
+4
-3
No files found.
packages/next/package.json
View file @
d6ad201f
...
@@ -98,7 +98,7 @@
...
@@ -98,7 +98,7 @@
"prop-types"
:
"15.7.2"
,
"prop-types"
:
"15.7.2"
,
"prop-types-exact"
:
"1.2.0"
,
"prop-types-exact"
:
"1.2.0"
,
"react-is"
:
"16.13.1"
,
"react-is"
:
"16.13.1"
,
"react-refresh"
:
"0.8.
2
"
,
"react-refresh"
:
"0.8.
3
"
,
"resolve-url-loader"
:
"3.1.1"
,
"resolve-url-loader"
:
"3.1.1"
,
"sass-loader"
:
"8.0.2"
,
"sass-loader"
:
"8.0.2"
,
"schema-utils"
:
"2.6.6"
,
"schema-utils"
:
"2.6.6"
,
...
...
packages/react-refresh-utils/package.json
View file @
d6ad201f
...
@@ -19,11 +19,11 @@
...
@@ -19,11 +19,11 @@
"build"
:
"tsc -d -w -p tsconfig.json"
"build"
:
"tsc -d -w -p tsconfig.json"
},
},
"peerDependencies"
:
{
"peerDependencies"
:
{
"react-refresh"
:
"0.8.
2
"
,
"react-refresh"
:
"0.8.
3
"
,
"webpack"
:
"^4"
"webpack"
:
"^4"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"react-refresh"
:
"0.8.
2
"
,
"react-refresh"
:
"0.8.
3
"
,
"webpack"
:
"^4.42.1"
"webpack"
:
"^4.42.1"
}
}
}
}
test/integration/getserversideprops/pages/refresh.js
0 → 100644
View file @
d6ad201f
import
{
useEffect
,
useState
}
from
'react'
const
foo
=
(
query
)
=>
query
export
const
FOO
=
foo
(
'query'
)
const
MyPage
=
()
=>
{
const
[
isMounted
,
setMounted
]
=
useState
(
false
)
useEffect
(()
=>
{
setMounted
(
true
)
},
[])
if
(
isMounted
)
{
return
<
p
>
client
loaded
<
/p
>
}
return
<
p
>
server
<
/p
>
}
const
getServerSideProps
=
async
()
=>
{
return
{
props
:
{}
}
}
export
default
MyPage
export
{
getServerSideProps
}
test/integration/getserversideprops/test/index.test.js
View file @
d6ad201f
...
@@ -109,6 +109,12 @@ const expectedManifestRoutes = () => [
...
@@ -109,6 +109,12 @@ const expectedManifestRoutes = () => [
),
),
page
:
'/non-json'
,
page
:
'/non-json'
,
},
},
{
dataRouteRegex
:
normalizeRegEx
(
`^\\/_next\\/data\\/
${
escapeRegex
(
buildId
)}
\\/refresh.json$`
),
page
:
'/refresh'
,
},
{
{
dataRouteRegex
:
normalizeRegEx
(
dataRouteRegex
:
normalizeRegEx
(
`^\\/_next\\/data\\/
${
escapeRegex
(
buildId
)}
\\/something.json$`
`^\\/_next\\/data\\/
${
escapeRegex
(
buildId
)}
\\/something.json$`
...
@@ -352,6 +358,17 @@ const runTests = (dev = false) => {
...
@@ -352,6 +358,17 @@ const runTests = (dev = false) => {
expect
(
text
).
toMatch
(
/a normal page/
)
expect
(
text
).
toMatch
(
/a normal page/
)
})
})
it
(
'should load a fast refresh page'
,
async
()
=>
{
const
browser
=
await
webdriver
(
appPort
,
'/refresh'
)
expect
(
await
check
(
()
=>
browser
.
elementByCss
(
'p'
).
text
(),
/client loaded/
,
false
)
).
toBe
(
true
)
})
it
(
'should provide correct query value for dynamic page'
,
async
()
=>
{
it
(
'should provide correct query value for dynamic page'
,
async
()
=>
{
const
html
=
await
renderViaHTTP
(
const
html
=
await
renderViaHTTP
(
appPort
,
appPort
,
...
...
yarn.lock
View file @
d6ad201f
...
@@ -13129,9 +13129,10 @@ react-is@^16.8.1, react-is@^16.8.4:
...
@@ -13129,9 +13129,10 @@ react-is@^16.8.1, react-is@^16.8.4:
version "16.12.0"
version "16.12.0"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.12.0.tgz#2cc0fe0fba742d97fd527c42a13bec4eeb06241c"
react-refresh@0.8.2:
react-refresh@0.8.3:
version "0.8.2"
version "0.8.3"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.2.tgz#24bb0858eac92b0d7b0dd561747f0c9fd6c60327"
resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.3.tgz#721d4657672d400c5e3c75d063c4a85fb2d5d68f"
integrity sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg==
react-ssr-prepass@1.0.8:
react-ssr-prepass@1.0.8:
version "1.0.8"
version "1.0.8"
...
...
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