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

chore: bump node min version to 10.13.0 #22400

Merged
merged 14 commits into from Mar 20, 2020
22 changes: 6 additions & 16 deletions .circleci/config.yml
Expand Up @@ -7,14 +7,14 @@ executors:
parameters:
image:
type: string
default: "10"
default: "10.13"
docker:
- image: circleci/node:<< parameters.image >>

aliases:
e2e-executor: &e2e-executor
docker:
- image: cypress/browsers:node10.16.0-chrome76
- image: cypress/browsers:node10.13.0-chrome76

restore_cache: &restore_cache
restore_cache:
Expand Down Expand Up @@ -69,7 +69,7 @@ aliases:
- /blog.+/
requires:
- lint
- unit_tests_node8
- unit_tests_node10

e2e_tests_production_runtime_alias: &e2e_tests_production_runtime_alias
<<: *e2e-executor
Expand Down Expand Up @@ -238,12 +238,6 @@ jobs:
- run: yarn typecheck
- run: yarn check-repo-fields

unit_tests_node8:
executor:
name: node
image: "8"
<<: *test_template

unit_tests_node10:
executor: node
<<: *test_template
Expand Down Expand Up @@ -633,24 +627,20 @@ workflows:
- lint:
requires:
- bootstrap
- unit_tests_node8:
<<: *ignore_docs
requires:
- bootstrap
- unit_tests_node10:
<<: *ignore_docs
requires:
- lint
- unit_tests_node8
- bootstrap
- unit_tests_node12:
<<: *ignore_docs
requires:
- lint
- unit_tests_node8
- bootstrap
- unit_tests_www:
requires:
- lint
- unit_tests_node8
- bootstrap
- integration_tests_long_term_caching:
<<: *e2e-test-workflow
- integration_tests_gatsby_pipeline:
Expand Down
18 changes: 18 additions & 0 deletions docs/blog/2020-03-20-dropping-support-for-node-8/index.md
@@ -0,0 +1,18 @@
---
title: "Dropping Support for Node 8"
date: 2020-03-20
author: Mikhail Novikov
excerpt: "We're dropping support for Node 8 in minor releases of core Gatsby packages."
tags:
- releases
---

Effective in Gatsby v2.20.0, we are making a potentially breaking change and dropping support for Node 8. The new minimal Node version that Gatsby supports is 10.13.0. We are doing it in a minor release as per [Gatsby Node Support Policy](https://www.gatsbyjs.org/docs/upgrading-node-js/#gatsbys-nodejs-support-policy).

Node 8 has reach end of life in December of 2019. There were deprecation warnings about it in previous Gatsby versions. Less than 3% of Gatsby users are still using Node 8. Some libraries that Gatsby or Gatsby plugins depend on have dropped Node 8. We feel there is no point in supporting it, especially since some nice performance improvement are locked behind Node 10.
freiksenet marked this conversation as resolved.
Show resolved Hide resolved

# How will it affect me?

You should fine if you have already upgraded your Node version to 10.13.0 or higher, you won't be affected.
freiksenet marked this conversation as resolved.
Show resolved Hide resolved

Otherwise follow the [Upgrading your Node guide](https://www.gatsbyjs.org/docs/upgrading-node-js).
freiksenet marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -62,7 +62,7 @@
},
"engines": {
"yarn": "^1.17.3",
"node": ">=8.0.0"
"node": ">=10.13.0"
},
"eslintIgnore": [
"interfaces",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-plugin-remove-graphql-queries/package.json
Expand Up @@ -26,6 +26,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
Expand Up @@ -74,7 +74,7 @@ Array [
"modules": "commonjs",
"shippedProposals": true,
"targets": Object {
"node": "8.0",
"node": "10.13.0",
},
"useBuiltIns": "entry",
},
Expand All @@ -97,7 +97,7 @@ Array [
"modules": "commonjs",
"shippedProposals": true,
"targets": Object {
"node": "8.0",
"node": "10.13.0",
},
"useBuiltIns": "entry",
},
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-gatsby-package/index.js
@@ -1,7 +1,7 @@
const r = require(`./resolver`)

function preset(context, options = {}) {
const { browser = false, debug = false, nodeVersion = `8.0` } = options
const { browser = false, debug = false, nodeVersion = `10.13.0` } = options
const { NODE_ENV, BABEL_ENV } = process.env

const IS_TEST = (BABEL_ENV || NODE_ENV) === `test`
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-gatsby-package/package.json
Expand Up @@ -26,6 +26,6 @@
"license": "MIT",
"main": "index.js",
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/babel-preset-gatsby/package.json
Expand Up @@ -40,6 +40,6 @@
"slash": "^3.0.0"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
23 changes: 8 additions & 15 deletions packages/gatsby-cli/src/__tests__/index.js
Expand Up @@ -42,10 +42,13 @@ const setup = version => {
}

describe(`error handling`, () => {
it(`panics on Node < 8.0.0`, () => {
const { reporter } = setup(`v6.0.0`)
it(`panics on Node < 10.13.0`, () => {
;[`6.0.0`, `8.0.0`, `8.0.0`, `10.0.0`].forEach(version => {
freiksenet marked this conversation as resolved.
Show resolved Hide resolved
const { reporter } = setup(version)

expect(reporter.panic).toHaveBeenCalledTimes(1)
expect(reporter.panic).toHaveBeenCalledTimes(1)
reporter.panic.mockClear()
})
})

it(`shows error with link to more info`, () => {
Expand All @@ -57,19 +60,9 @@ describe(`error handling`, () => {
})
})

describe(`deprecation warning`, () => {
it(`warns on Node < 10.13.0`, () => {
const { reporter } = setup(`v10.12.0`)

expect(reporter.warn).toHaveBeenCalledWith(
expect.stringContaining(`https://gatsby.dev/upgrading-node-js`)
)
})
})

freiksenet marked this conversation as resolved.
Show resolved Hide resolved
describe(`normal behavior`, () => {
it(`does not panic on Node >= 8.0.0`, () => {
;[`8.0.0`, `8.9.0`, `10.0.0`, `12.0.0`, `13.0.0`].forEach(version => {
it(`does not panic on Node >= 10.13.0`, () => {
;[`10.13.0`, `12.0.0`, `13.0.0`].forEach(version => {
const { reporter } = setup(version)

expect(reporter.panic).not.toHaveBeenCalled()
Expand Down
22 changes: 11 additions & 11 deletions packages/gatsby-cli/src/index.ts
Expand Up @@ -24,8 +24,8 @@ if (os.platform() === `win32`) {
// Check if update is available
updateNotifier({ pkg }).notify({ isGlobal: true })

const MIN_NODE_VERSION = `8.0.0`
const NEXT_MIN_NODE_VERSION = `10.13.0`
const MIN_NODE_VERSION = `10.13.0`
// const NEXT_MIN_NODE_VERSION = `10.13.0`

if (!semver.satisfies(process.version, `>=${MIN_NODE_VERSION}`)) {
report.panic(
Expand All @@ -36,15 +36,15 @@ if (!semver.satisfies(process.version, `>=${MIN_NODE_VERSION}`)) {
)
}

if (!semver.satisfies(process.version, `>=${NEXT_MIN_NODE_VERSION}`)) {
report.warn(
report.stripIndent(`
Node.js ${process.version} has reached End of Life status on 31 December, 2019.
Gatsby will only actively support ${NEXT_MIN_NODE_VERSION} or higher and drop support for Node 8 soon.
Please upgrade Node.js to a currently active LTS release: https://gatsby.dev/upgrading-node-js
`)
)
}
// if (!semver.satisfies(process.version, `>=${NEXT_MIN_NODE_VERSION}`)) {
// report.warn(
// report.stripIndent(`
// Node.js ${process.version} has reached End of Life status on 31 December, 2019.
// Gatsby will only actively support ${NEXT_MIN_NODE_VERSION} or higher and drop support for Node 8 soon.
// Please upgrade Node.js to a currently active LTS release: https://gatsby.dev/upgrading-node-js
// `)
// )
// }

process.on(`unhandledRejection`, reason => {
// This will exit the process in newer Node anyway so lets be consistent
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-codemods/package.json
Expand Up @@ -34,6 +34,6 @@
"jscodeshift": "^0.7.0"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-cypress/package.json
Expand Up @@ -40,6 +40,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-dev-cli/package.json
Expand Up @@ -48,6 +48,6 @@
"watch": "babel -w src --out-dir dist --ignore \"**/__tests__\""
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-graphiql-explorer/package.json
Expand Up @@ -54,6 +54,6 @@
"whatwg-fetch": "^3.0.0"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-benchmark-reporting/package.json
Expand Up @@ -27,6 +27,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-canonical-urls/package.json
Expand Up @@ -36,6 +36,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-catch-links/package.json
Expand Up @@ -37,6 +37,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-coffeescript/package.json
Expand Up @@ -44,6 +44,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-create-client-paths/package.json
Expand Up @@ -36,6 +36,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-cxs/package.json
Expand Up @@ -39,6 +39,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-emotion/package.json
Expand Up @@ -41,6 +41,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-facebook-analytics/package.json
Expand Up @@ -38,6 +38,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-feed/package.json
Expand Up @@ -43,6 +43,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-flow/package.json
Expand Up @@ -34,6 +34,6 @@
"cross-env": "^5.2.1"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-fullstory/package.json
Expand Up @@ -36,6 +36,6 @@
"gatsby": "^2.0.0"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-glamor/package.json
Expand Up @@ -38,6 +38,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-google-analytics/package.json
Expand Up @@ -40,7 +40,7 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
},
"types": "./index.d.ts"
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-google-gtag/package.json
Expand Up @@ -39,6 +39,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-google-tagmanager/package.json
Expand Up @@ -38,6 +38,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-guess-js/package.json
Expand Up @@ -41,6 +41,6 @@
"gatsby": "^2.0.0"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-jss/package.json
Expand Up @@ -38,6 +38,6 @@
"watch": "babel -w src --out-dir . --ignore **/__tests__"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-layout/package.json
Expand Up @@ -33,6 +33,6 @@
"cross-env": "^5.2.1"
},
"engines": {
"node": ">=8.0.0"
"node": ">=10.13.0"
}
}