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
29ae3727
Unverified
Commit
29ae3727
authored
Aug 18, 2020
by
James Mosier
Committed by
GitHub
Aug 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow React experimental version without warning (#16140)
Co-authored-by:
Joe Haddad
<
joe.haddad@zeit.co
>
parent
512782ee
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
78 additions
and
2 deletions
+78
-2
next-dev.ts
packages/next/cli/next-dev.ts
+10
-2
.gitignore
test/integration/cli/experimental-react-dom/.gitignore
+1
-0
index.js
...li/experimental-react-dom/node_modules/react-dom/index.js
+1
-0
package.json
...xperimental-react-dom/node_modules/react-dom/package.json
+4
-0
package.json
test/integration/cli/experimental-react-dom/package.json
+6
-0
index.js
test/integration/cli/experimental-react-dom/pages/index.js
+3
-0
.gitignore
test/integration/cli/experimental-react/.gitignore
+1
-0
index.js
...ration/cli/experimental-react/node_modules/react/index.js
+1
-0
package.json
...on/cli/experimental-react/node_modules/react/package.json
+4
-0
package.json
test/integration/cli/experimental-react/package.json
+6
-0
index.js
test/integration/cli/experimental-react/pages/index.js
+3
-0
index.test.js
test/integration/cli/test/index.test.js
+38
-0
No files found.
packages/next/cli/next-dev.ts
View file @
29ae3727
...
...
@@ -66,7 +66,11 @@ const nextDev: cliCommand = (argv) => {
cwd
:
dir
,
name
:
'react'
,
})
if
(
reactVersion
&&
semver
.
lt
(
reactVersion
,
'16.10.0'
))
{
if
(
reactVersion
&&
semver
.
lt
(
reactVersion
,
'16.10.0'
)
&&
semver
.
coerce
(
reactVersion
)?.
version
!==
'0.0.0'
)
{
Log
.
warn
(
'Fast Refresh is disabled in your application due to an outdated `react` version. Please upgrade 16.10 or newer!'
+
' Read more: https://err.sh/next.js/react-version'
...
...
@@ -76,7 +80,11 @@ const nextDev: cliCommand = (argv) => {
cwd
:
dir
,
name
:
'react-dom'
,
})
if
(
reactDomVersion
&&
semver
.
lt
(
reactDomVersion
,
'16.10.0'
))
{
if
(
reactDomVersion
&&
semver
.
lt
(
reactDomVersion
,
'16.10.0'
)
&&
semver
.
coerce
(
reactDomVersion
)?.
version
!==
'0.0.0'
)
{
Log
.
warn
(
'Fast Refresh is disabled in your application due to an outdated `react-dom` version. Please upgrade 16.10 or newer!'
+
' Read more: https://err.sh/next.js/react-version'
...
...
test/integration/cli/experimental-react-dom/.gitignore
0 → 100644
View file @
29ae3727
!node_modules
test/integration/cli/experimental-react-dom/node_modules/react-dom/index.js
0 → 100644
View file @
29ae3727
module
.
exports
=
{
Suspense
:
true
}
test/integration/cli/experimental-react-dom/node_modules/react-dom/package.json
0 → 100644
View file @
29ae3727
{
"name"
:
"react-dom"
,
"version"
:
"0.0.0-experimental-94c0244ba"
}
test/integration/cli/experimental-react-dom/package.json
0 → 100644
View file @
29ae3727
{
"dependencies"
:
{
"react"
:
"*"
,
"react-dom"
:
"*"
}
}
test/integration/cli/experimental-react-dom/pages/index.js
0 → 100644
View file @
29ae3727
export
default
function
Home
()
{
return
<
p
>
Hello
<
/p
>
}
test/integration/cli/experimental-react/.gitignore
0 → 100644
View file @
29ae3727
!node_modules
test/integration/cli/experimental-react/node_modules/react/index.js
0 → 100644
View file @
29ae3727
module
.
exports
=
{
Suspense
:
true
}
test/integration/cli/experimental-react/node_modules/react/package.json
0 → 100644
View file @
29ae3727
{
"name"
:
"react"
,
"version"
:
"0.0.0-experimental-94c0244ba"
}
test/integration/cli/experimental-react/package.json
0 → 100644
View file @
29ae3727
{
"dependencies"
:
{
"react"
:
"*"
,
"react-dom"
:
"*"
}
}
test/integration/cli/experimental-react/pages/index.js
0 → 100644
View file @
29ae3727
export
default
function
Home
()
{
return
<
p
>
Hello
<
/p
>
}
test/integration/cli/test/index.test.js
View file @
29ae3727
...
...
@@ -16,6 +16,8 @@ jest.setTimeout(1000 * 60 * 5)
const
dir
=
join
(
__dirname
,
'..'
)
const
dirOldReact
=
join
(
__dirname
,
'../old-react'
)
const
dirOldReactDom
=
join
(
__dirname
,
'../old-react-dom'
)
const
dirExperimentalReact
=
join
(
__dirname
,
'../experimental-react'
)
const
dirExperimentalReactDom
=
join
(
__dirname
,
'../experimental-react-dom'
)
describe
(
'CLI Usage'
,
()
=>
{
describe
(
'no command'
,
()
=>
{
...
...
@@ -257,6 +259,42 @@ describe('CLI Usage', () => {
await
killApp
(
instance
)
})
test
(
'experimental react version'
,
async
()
=>
{
const
port
=
await
findPort
()
let
stderr
=
''
let
instance
=
await
launchApp
(
dirExperimentalReact
,
port
,
{
stderr
:
true
,
onStderr
(
msg
)
{
stderr
+=
msg
},
})
expect
(
stderr
).
not
.
toMatch
(
'disabled'
)
expect
(
stderr
).
not
.
toMatch
(
'outdated'
)
expect
(
stderr
).
not
.
toMatch
(
`react-dom`
)
await
killApp
(
instance
)
})
test
(
'experimental react-dom version'
,
async
()
=>
{
const
port
=
await
findPort
()
let
stderr
=
''
let
instance
=
await
launchApp
(
dirExperimentalReactDom
,
port
,
{
stderr
:
true
,
onStderr
(
msg
)
{
stderr
+=
msg
},
})
expect
(
stderr
).
not
.
toMatch
(
'disabled'
)
expect
(
stderr
).
not
.
toMatch
(
'outdated'
)
expect
(
stderr
).
not
.
toMatch
(
'`react`'
)
await
killApp
(
instance
)
})
})
describe
(
'export'
,
()
=>
{
...
...
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