Skip to content

feat!: end of support for v14 and v16 #6223

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
18 changes: 6 additions & 12 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
include:
- os: ubuntu-24.04
# Earliest supported version
node-version: '14.16.0'
node-version: '18.17.0'
deno-version: 'v2.2.4'
fail-fast: false
steps:
Expand All @@ -76,9 +76,6 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: Install npm@7
run: npm install -g npm@7
if: ${{ matrix.node-version == '14.16.0' && !steps.release-check.outputs.IS_RELEASE }}
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
Expand Down Expand Up @@ -115,23 +112,23 @@ jobs:
# We test on the oldest supported Node.js version, but only with a
# single combination (Ubuntu)
- os: ubuntu-24.04
node-version: '14.16.0'
node-version: '18.17.0'
install-command: npm ci
machine: '0'
- os: ubuntu-24.04
node-version: '14.16.0'
node-version: '18.17.0'
install-command: npm ci
machine: '1'
- os: ubuntu-24.04
node-version: '14.16.0'
node-version: '18.17.0'
install-command: npm ci
machine: '2'
- os: ubuntu-24.04
node-version: '14.16.0'
node-version: '18.17.0'
install-command: npm ci
machine: '3'
- os: ubuntu-24.04
node-version: '14.16.0'
node-version: '18.17.0'
install-command: npm ci
machine: '4'
fail-fast: false
Expand Down Expand Up @@ -167,9 +164,6 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
if: ${{ !steps.release-check.outputs.IS_RELEASE }}
- name: Install npm@7
run: npm install -g npm@7
if: ${{ matrix.node-version == '14.16.0' && !steps.release-check.outputs.IS_RELEASE }}
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand Down
38 changes: 19 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"prettier": "^3.0.0"
},
"engines": {
"node": "^14.16.0 || >=16.0.0"
"node": ">=18.17.0"
},
"lint-staged": {
"!(packages/*/tests/**/fixtures/**/*)*.+(j|t)s": "eslint --ignore-path .gitignore --cache --fix",
Expand Down
2 changes: 1 addition & 1 deletion packages/build-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@
"vitest": "^0.34.0"
},
"engines": {
"node": "^14.16.0 || >=16.0.0"
"node": ">=18.17.0"
}
}
2 changes: 1 addition & 1 deletion packages/build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@
}
},
"engines": {
"node": "^14.16.0 || >=16.0.0"
"node": ">=18.17.0"
}
}
44 changes: 4 additions & 40 deletions packages/build/src/plugins/node_version.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { dirname } from 'path'
import { execPath, version as currentVersion } from 'process'

import semver from 'semver'
import link from 'terminal-link'

import { logWarning, logWarningSubHeader } from '../log/logger.js'
import { getPackageJson } from '../utils/package.js'

export type PluginsLoadedFrom = 'auto_install' | 'local' | 'package.json'

Expand All @@ -23,8 +21,7 @@ export type PluginsOptions = {
* This node version is minimum required to run the plugins code.
* If the users preferred Node.js version is below that we have to fall back to the system node version
*/
const MINIMUM_REQUIRED_NODE_VERSION = '^14.14.0 || >=16.0.0'
const UPCOMING_MINIMUM_REQUIRED_NODE_VERSION = '>=18.14.0'
const MINIMUM_REQUIRED_NODE_VERSION = '>=18.17.0'

/**
* Local plugins and `package.json`-installed plugins use user's preferred Node.js version if higher than our minimum
Expand All @@ -33,39 +30,28 @@ const UPCOMING_MINIMUM_REQUIRED_NODE_VERSION = '>=18.14.0'
* usually the system's Node.js version.
* If the user Node version does not satisfy our supported engine range use our own system Node version
*/
export const addPluginsNodeVersion = function ({
featureFlags,
pluginsOptions,
nodePath,
userNodeVersion,
logs,
systemLog,
}) {
export const addPluginsNodeVersion = function ({ pluginsOptions, nodePath, userNodeVersion, logs }) {
const currentNodeVersion = semver.clean(currentVersion)
return Promise.all(
pluginsOptions.map((pluginOptions) =>
addPluginNodeVersion({
featureFlags,
pluginOptions,
currentNodeVersion,
userNodeVersion,
nodePath,
logs,
systemLog,
}),
),
)
}

const addPluginNodeVersion = async function ({
featureFlags,
pluginOptions,
pluginOptions: { loadedFrom, packageName, pluginPath },
pluginOptions: { loadedFrom, packageName },
currentNodeVersion,
userNodeVersion,
nodePath,
logs,
systemLog,
}: {
pluginOptions: PluginsOptions
[key: string]: any
Expand All @@ -80,28 +66,6 @@ const addPluginNodeVersion = async function ({
return systemNode
}

if (
featureFlags.build_warn_upcoming_system_version_change &&
!semver.satisfies(userNodeVersion, UPCOMING_MINIMUM_REQUIRED_NODE_VERSION)
) {
if (pluginPath) {
const pluginDir = dirname(pluginPath)
const { packageJson: pluginPackageJson } = await getPackageJson(pluginDir)

// Ensure Node.js version is compatible with plugin's `engines.node`
const pluginNodeVersionRange = pluginPackageJson?.engines?.node
if (!pluginNodeVersionRange) {
systemLog(`plugin "${packageName}" does not specify node support range`)
} else if (semver.satisfies('22.0.0', pluginNodeVersionRange)) {
systemLog(`plugin "${packageName}" node support range includes v22`)
} else {
systemLog(`plugin "${packageName}" node support range does NOT include v22`)
}
} else {
systemLog(`plugin "${packageName}" pluginPath not available`)
}
}

if (semver.satisfies(userNodeVersion, MINIMUM_REQUIRED_NODE_VERSION)) {
return userNode
}
Expand All @@ -113,7 +77,7 @@ const addPluginNodeVersion = async function ({

Read more about our minimum required version in our ${link(
'forums announcement',
'https://answers.netlify.com/t/build-plugins-dropping-support-for-node-js-12/79421',
'https://answers.netlify.com/t/build-plugins-end-of-support-for-node-js-14-node-js-16/136405',
)}`,
)

Expand Down
2 changes: 0 additions & 2 deletions packages/build/src/plugins/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ export const resolvePluginsPath = async function ({
pluginsOptions.map((pluginOptions) => resolvePluginPath({ pluginOptions, buildDir, packagePath, autoPluginsDir })),
)
const pluginsOptionsB = await addPluginsNodeVersion({
featureFlags,
pluginsOptions: pluginsOptionsA,
nodePath,
userNodeVersion,
logs,
systemLog,
})

const pluginsOptionsC = await addPinnedVersions({ pluginsOptions: pluginsOptionsB, api, siteInfo, sendStatus })
Expand Down
Loading
Loading