Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Node 8 support #8948

Merged
merged 8 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions azure-pipelines-test-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ parameters:
name: ''
testScript: ''
configurations:
LinuxNode8: { vmImage: 'ubuntu-16.04', nodeVersion: 8.x }
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
# WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
# WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }
# WindowsNode10: { vmImage: 'windows-latest', nodeVersion: 10.x }
# WindowsNode12: { vmImage: 'windows-latest', nodeVersion: 12.x }

jobs:
- job: ${{ parameters.name }}
Expand Down
31 changes: 9 additions & 22 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,36 +57,23 @@ jobs:
name: Behavior
testScript: tasks/e2e-behavior.sh
configurations:
LinuxNode8: { vmImage: 'ubuntu-18.04', nodeVersion: 8.x }
LinuxNode10: { vmImage: 'ubuntu-18.04', nodeVersion: 10.x }
# WindowsNode8: { vmImage: 'vs2017-win2016', nodeVersion: 8.x }
# WindowsNode10: { vmImage: 'vs2017-win2016', nodeVersion: 10.x }
MacNode8: { vmImage: 'macOS-10.15', nodeVersion: 8.x }
MacNode10: { vmImage: 'macOS-10.15', nodeVersion: 10.x }
LinuxNode10: { vmImage: 'ubuntu-16.04', nodeVersion: 10.x }
LinuxNode12: { vmImage: 'ubuntu-16.04', nodeVersion: 12.x }
# WindowsNode10: { vmImage: 'windows-latest', nodeVersion: 10.x }
# WindowsNode12: { vmImage: 'windows-latest', nodeVersion: 12.x }
MacNode10: { vmImage: 'macOS-latest', nodeVersion: 10.x }
MacNode12: { vmImage: 'macOS-latest', nodeVersion: 12.x }

# ******************************************************************************
# Old Node test suite
# ******************************************************************************
- job: OldNode
pool:
vmImage: ubuntu-16.04
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: 6.x
displayName: 'Install Node.js 6.x'
versionSpec: 8.x
displayName: 'Install Node.js 8.x'
- bash: tasks/e2e-old-node.sh
displayName: 'Run tests'
# ******************************************************************************
# Unsupported Node with TypeScript flag
# ******************************************************************************
- job: UnsupportedNodeWithTypeScript
pool:
vmImage: ubuntu-16.04
steps:
- task: NodeTool@0
inputs:
versionSpec: 8.9.x
displayName: 'Install Node.js 8.9.x'
- bash: tasks/e2e-typescript-unsupported-node.sh
displayName: 'Run unsupported TypeScript test'
2 changes: 1 addition & 1 deletion docusaurus/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Create a project, and you’re good to go.

## Creating an App

**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.
**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.

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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"meow": "^5.0.0",
"multimatch": "^3.0.0",
"prettier": "1.19.1",
"puppeteer": "^2.0.0",
"puppeteer": "^3.0.2",
"strip-ansi": "^5.1.0",
"svg-term-cli": "^2.1.1",
"tempy": "^0.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/cra-template-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"license": "MIT",
"engines": {
"node": ">=8.10"
"node": ">=10"
},
"bugs": {
"url": "https://github.com/facebook/create-react-app/issues"
Expand Down
2 changes: 1 addition & 1 deletion packages/cra-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=10"
},
"bugs": {
"url": "https://github.com/facebook/create-react-app/issues"
Expand Down
20 changes: 6 additions & 14 deletions packages/create-react-app/createReactApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,12 @@ function createApp(
usePnp,
useTypeScript
) {
const unsupportedNodeVersion = !semver.satisfies(process.version, '>=8.10.0');
if (unsupportedNodeVersion && useTypeScript) {
console.error(
chalk.red(
`You are using Node ${process.version} with the TypeScript template. Node 8.10 or higher is required to use TypeScript.\n`
)
);

process.exit(1);
} else if (unsupportedNodeVersion) {
const unsupportedNodeVersion = !semver.satisfies(process.version, '>=10');
if (unsupportedNodeVersion) {
console.log(
chalk.yellow(
`You are using Node ${process.version} so the project will be bootstrapped with an old unsupported version of tools.\n\n` +
`Please update to Node 8.10 or higher for a better, fully supported experience.\n`
`Please update to Node 10 or higher for a better, fully supported experience.\n`
)
);
// Fall back to latest supported react-scripts on Node 4
Expand Down Expand Up @@ -260,7 +252,7 @@ function createApp(
console.log(
chalk.yellow(
`You are using npm ${npmInfo.npmVersion} so the project will be bootstrapped with an old unsupported version of tools.\n\n` +
`Please update to npm 5 or higher for a better, fully supported experience.\n`
`Please update to npm 6 or higher for a better, fully supported experience.\n`
)
);
}
Expand Down Expand Up @@ -516,7 +508,7 @@ function run(
console.log(
chalk.yellow(
`\nNote: the project was bootstrapped with an old unsupported version of tools.\n` +
`Please update to Node >=8.10 and npm >=5 to get supported tools in new projects.\n`
`Please update to Node >=10 and npm >=6 to get supported tools in new projects.\n`
)
);
}
Expand Down Expand Up @@ -771,7 +763,7 @@ function checkNpmVersion() {
npmVersion = execSync('npm --version')
.toString()
.trim();
hasMinNpm = semver.gte(npmVersion, '5.0.0');
hasMinNpm = semver.gte(npmVersion, '6.0.0');
} catch (err) {
// ignore
}
Expand Down
4 changes: 2 additions & 2 deletions packages/create-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ var currentNodeVersion = process.versions.node;
var semver = currentNodeVersion.split('.');
var major = semver[0];

if (major < 8) {
if (major < 10) {
console.error(
'You are running Node ' +
currentNodeVersion +
'.\n' +
'Create React App requires Node 8 or higher. \n' +
'Create React App requires Node 10 or higher. \n' +
'Please update your version of Node.'
);
process.exit(1);
Expand Down
2 changes: 1 addition & 1 deletion packages/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"license": "MIT",
"engines": {
"node": ">=8"
"node": ">=10"
},
"bugs": {
"url": "https://github.com/facebook/create-react-app/issues"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-app-polyfill/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"url": "https://github.com/facebook/create-react-app/issues"
},
"engines": {
"node": ">=6"
"node": ">=10"
},
"files": [
"ie9.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"url": "https://github.com/facebook/create-react-app/issues"
},
"engines": {
"node": ">=8.10"
"node": ">=10"
},
"files": [
"browsersHelper.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/fixtures/kitchensink/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"dependencies": {
"bootstrap": "4.3.1",
"jest": "25.5.4",
"node-sass": "4.12.0",
"node-sass": "4.x",
"normalize.css": "7.0.0",
"prop-types": "15.7.2",
"test-integrity": "2.0.1"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"license": "MIT",
"engines": {
"node": ">=8.10"
"node": ">=10"
},
"bugs": {
"url": "https://github.com/facebook/create-react-app/issues"
Expand Down
2 changes: 1 addition & 1 deletion tasks/e2e-old-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ cd "$root_path"/packages/create-react-app
npm install
cd "$root_path"

# If the node version is < 6, the script should just give an error.
# If the node version is < 10, the script should just give an error.
cd $temp_app_path
err_output=`node "$root_path"/packages/create-react-app/index.js test-node-version 2>&1 > /dev/null || echo ''`
[[ $err_output =~ You\ are\ running\ Node ]] && exit 0 || exit 1
Expand Down
61 changes: 0 additions & 61 deletions tasks/e2e-typescript-unsupported-node.sh

This file was deleted.

2 changes: 1 addition & 1 deletion tasks/local-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ while [ "$1" != "" ]; do
shift
done

test_command="./tasks/e2e-simple.sh && ./tasks/e2e-kitchensink.sh && ./tasks/e2e-kitchensink-eject.sh && ./tasks/e2e-installs.sh"
test_command="./tasks/e2e-simple.sh && ./tasks/e2e-kitchensink.sh && ./tasks/e2e-kitchensink-eject.sh && ./tasks/e2e-installs.sh && ./tasks/e2e-behavior.sh"
case ${test_suite} in
"all")
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,6 @@ Failed to compile.
Attempted import error: 'bar' is not exported from './AppUnknownExport'.


",
"stdout": "",
}
`;

exports[`helps when users tries to use sass 1`] = `
Object {
"stderr": "Creating an optimized production build...
Failed to compile.

./src/AppSass.scss
To import Sass files, you first need to install node-sass.
Run \`npm install node-sass\` or \`yarn add node-sass\` inside your workspace.


",
"stdout": "",
}
Expand Down
6 changes: 5 additions & 1 deletion test/fixtures/webpack-message-formatting/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ test('helps when users tries to use sass', async () => {
);

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

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