Skip to content

Commit 8b0d21f

Browse files
authored
Drop Node 8 support (facebook#8948)
1 parent 9904075 commit 8b0d21f

File tree

18 files changed

+36
-129
lines changed

18 files changed

+36
-129
lines changed

azure-pipelines-test-job.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ parameters:
66
name: ''
77
testScript: ''
88
configurations:
9-
LinuxNode8: { vmImage: 'ubuntu-16.04', nodeVersion: 8.x }
109
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
11-
# WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
12-
# WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
10+
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }
11+
# WindowsNode10: { vmImage: 'windows-latest', nodeVersion: 10.x }
12+
# WindowsNode12: { vmImage: 'windows-latest', nodeVersion: 12.x }
1313

1414
jobs:
1515
- job: ${{ parameters.name }}

azure-pipelines.yml

+9-22
Original file line numberDiff line numberDiff line change
@@ -57,36 +57,23 @@ jobs:
5757
name: Behavior
5858
testScript: tasks/e2e-behavior.sh
5959
configurations:
60-
LinuxNode8: { vmImage: 'ubuntu-18.04', nodeVersion: 8.x }
61-
LinuxNode10: { vmImage: 'ubuntu-18.04', nodeVersion: 10.x }
62-
# WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
63-
# WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
64-
MacNode8: { vmImage: 'macOS-10.15', nodeVersion: 8.x }
65-
MacNode10: { vmImage: 'macOS-10.15', nodeVersion: 10.x }
60+
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
61+
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }
62+
# WindowsNode10: { vmImage: 'windows-latest', nodeVersion: 10.x }
63+
# WindowsNode12: { vmImage: 'windows-latest', nodeVersion: 12.x }
64+
MacNode10: { vmImage: 'macOS-latest', nodeVersion: 10.x }
65+
MacNode12: { vmImage: 'macOS-latest', nodeVersion: 12.x }
6666

6767
# ******************************************************************************
6868
# Old Node test suite
6969
# ******************************************************************************
7070
- job: OldNode
7171
pool:
72-
vmImage: ubuntu-16.04
72+
vmImage: ubuntu-latest
7373
steps:
7474
- task: NodeTool@0
7575
inputs:
76-
versionSpec: 6.x
77-
displayName: 'Install Node.js 6.x'
76+
versionSpec: 8.x
77+
displayName: 'Install Node.js 8.x'
7878
- bash: tasks/e2e-old-node.sh
7979
displayName: 'Run tests'
80-
# ******************************************************************************
81-
# Unsupported Node with TypeScript flag
82-
# ******************************************************************************
83-
- job: UnsupportedNodeWithTypeScript
84-
pool:
85-
vmImage: ubuntu-16.04
86-
steps:
87-
- task: NodeTool@0
88-
inputs:
89-
versionSpec: 8.9.x
90-
displayName: 'Install Node.js 8.9.x'
91-
- bash: tasks/e2e-typescript-unsupported-node.sh
92-
displayName: 'Run unsupported TypeScript test'

docusaurus/docs/getting-started.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Create a project, and you’re good to go.
3434

3535
## Creating an App
3636

37-
**You’ll need to have Node >= 8.10 on your local development machine** (but it’s not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node versions between different projects.
37+
**You’ll need to have Node >= 10 on your local development machine** (but it’s not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to switch Node versions between different projects.
3838

3939
To create a new app, you may choose one of the following methods:
4040

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"meow": "^5.0.0",
3838
"multimatch": "^3.0.0",
3939
"prettier": "1.19.1",
40-
"puppeteer": "^2.0.0",
40+
"puppeteer": "^3.0.2",
4141
"strip-ansi": "^5.1.0",
4242
"svg-term-cli": "^2.1.1",
4343
"tempy": "^0.2.1",

packages/cra-template-typescript/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"license": "MIT",
1717
"engines": {
18-
"node": ">=8.10"
18+
"node": ">=10"
1919
},
2020
"bugs": {
2121
"url": "https://github.com/facebook/create-react-app/issues"

packages/cra-template/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"license": "MIT",
1616
"engines": {
17-
"node": ">=8"
17+
"node": ">=10"
1818
},
1919
"bugs": {
2020
"url": "https://github.com/facebook/create-react-app/issues"

packages/create-react-app/createReactApp.js

+6-14
Original file line numberDiff line numberDiff line change
@@ -203,20 +203,12 @@ function createApp(
203203
usePnp,
204204
useTypeScript
205205
) {
206-
const unsupportedNodeVersion = !semver.satisfies(process.version, '>=8.10.0');
207-
if (unsupportedNodeVersion && useTypeScript) {
208-
console.error(
209-
chalk.red(
210-
`You are using Node ${process.version} with the TypeScript template. Node 8.10 or higher is required to use TypeScript.\n`
211-
)
212-
);
213-
214-
process.exit(1);
215-
} else if (unsupportedNodeVersion) {
206+
const unsupportedNodeVersion = !semver.satisfies(process.version, '>=10');
207+
if (unsupportedNodeVersion) {
216208
console.log(
217209
chalk.yellow(
218210
`You are using Node ${process.version} so the project will be bootstrapped with an old unsupported version of tools.\n\n` +
219-
`Please update to Node 8.10 or higher for a better, fully supported experience.\n`
211+
`Please update to Node 10 or higher for a better, fully supported experience.\n`
220212
)
221213
);
222214
// Fall back to latest supported react-scripts on Node 4
@@ -260,7 +252,7 @@ function createApp(
260252
console.log(
261253
chalk.yellow(
262254
`You are using npm ${npmInfo.npmVersion} so the project will be bootstrapped with an old unsupported version of tools.\n\n` +
263-
`Please update to npm 5 or higher for a better, fully supported experience.\n`
255+
`Please update to npm 6 or higher for a better, fully supported experience.\n`
264256
)
265257
);
266258
}
@@ -516,7 +508,7 @@ function run(
516508
console.log(
517509
chalk.yellow(
518510
`\nNote: the project was bootstrapped with an old unsupported version of tools.\n` +
519-
`Please update to Node >=8.10 and npm >=5 to get supported tools in new projects.\n`
511+
`Please update to Node >=10 and npm >=6 to get supported tools in new projects.\n`
520512
)
521513
);
522514
}
@@ -771,7 +763,7 @@ function checkNpmVersion() {
771763
npmVersion = execSync('npm --version')
772764
.toString()
773765
.trim();
774-
hasMinNpm = semver.gte(npmVersion, '5.0.0');
766+
hasMinNpm = semver.gte(npmVersion, '6.0.0');
775767
} catch (err) {
776768
// ignore
777769
}

packages/create-react-app/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ var currentNodeVersion = process.versions.node;
4040
var semver = currentNodeVersion.split('.');
4141
var major = semver[0];
4242

43-
if (major < 8) {
43+
if (major < 10) {
4444
console.error(
4545
'You are running Node ' +
4646
currentNodeVersion +
4747
'.\n' +
48-
'Create React App requires Node 8 or higher. \n' +
48+
'Create React App requires Node 10 or higher. \n' +
4949
'Please update your version of Node.'
5050
);
5151
process.exit(1);

packages/create-react-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"license": "MIT",
1414
"engines": {
15-
"node": ">=8"
15+
"node": ">=10"
1616
},
1717
"bugs": {
1818
"url": "https://github.com/facebook/create-react-app/issues"

packages/react-app-polyfill/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"url": "https://github.com/facebook/create-react-app/issues"
1313
},
1414
"engines": {
15-
"node": ">=6"
15+
"node": ">=10"
1616
},
1717
"files": [
1818
"ie9.js",

packages/react-dev-utils/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"url": "https://github.com/facebook/create-react-app/issues"
1313
},
1414
"engines": {
15-
"node": ">=8.10"
15+
"node": ">=10"
1616
},
1717
"files": [
1818
"browsersHelper.js",

packages/react-scripts/fixtures/kitchensink/template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"dependencies": {
44
"bootstrap": "4.3.1",
55
"jest": "25.5.4",
6-
"node-sass": "4.12.0",
6+
"node-sass": "4.x",
77
"normalize.css": "7.0.0",
88
"prop-types": "15.7.2",
99
"test-integrity": "2.0.1"

packages/react-scripts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"license": "MIT",
1111
"engines": {
12-
"node": ">=8.10"
12+
"node": ">=10"
1313
},
1414
"bugs": {
1515
"url": "https://github.com/facebook/create-react-app/issues"

tasks/e2e-old-node.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ cd "$root_path"/packages/create-react-app
5252
npm install
5353
cd "$root_path"
5454

55-
# If the node version is < 6, the script should just give an error.
55+
# If the node version is < 10, the script should just give an error.
5656
cd $temp_app_path
5757
err_output=`node "$root_path"/packages/create-react-app/index.js test-node-version 2>&1 > /dev/null || echo ''`
5858
[[ $err_output =~ You\ are\ running\ Node ]] && exit 0 || exit 1

tasks/e2e-typescript-unsupported-node.sh

-61
This file was deleted.

tasks/local-test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ while [ "$1" != "" ]; do
4949
shift
5050
done
5151

52-
test_command="./tasks/e2e-simple.sh && ./tasks/e2e-kitchensink.sh && ./tasks/e2e-kitchensink-eject.sh && ./tasks/e2e-installs.sh"
52+
test_command="./tasks/e2e-simple.sh && ./tasks/e2e-kitchensink.sh && ./tasks/e2e-kitchensink-eject.sh && ./tasks/e2e-installs.sh && ./tasks/e2e-behavior.sh"
5353
case ${test_suite} in
5454
"all")
5555
;;

test/fixtures/webpack-message-formatting/__snapshots__/index.test.js.snap

-15
Original file line numberDiff line numberDiff line change
@@ -156,21 +156,6 @@ Failed to compile.
156156
Attempted import error: 'bar' is not exported from './AppUnknownExport'.
157157
158158
159-
",
160-
"stdout": "",
161-
}
162-
`;
163-
164-
exports[`helps when users tries to use sass 1`] = `
165-
Object {
166-
"stderr": "Creating an optimized production build...
167-
Failed to compile.
168-
169-
./src/AppSass.scss
170-
To import Sass files, you first need to install node-sass.
171-
Run \`npm install node-sass\` or \`yarn add node-sass\` inside your workspace.
172-
173-
174159
",
175160
"stdout": "",
176161
}

test/fixtures/webpack-message-formatting/index.test.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ test('helps when users tries to use sass', async () => {
9797
);
9898

9999
const { stdout, stderr } = await testSetup.scripts.build();
100-
expect({ stdout, stderr }).toMatchSnapshot();
100+
expect(stdout).toBeFalsy();
101+
// TODO: Snapshots differ between Node 10/12 as the call stack log output has changed.
102+
expect(stderr).toContain(
103+
'To import Sass files, you first need to install node-sass.'
104+
);
101105
});
102106

103107
test('formats file not found error', async () => {

0 commit comments

Comments
 (0)