Skip to content

Commit da0a0d5

Browse files
committed
Drop support for node14
Motivation: technically node14 end of life will happen in two months so we can still support it but it creates problems with graphql#3791 Node14 doesn't support `AbortSignal` and since we want to allow resolvers to be canceled we need to expose this object through our public API (inside `info` argument). Potentialy this and all the other issues (e.g. how to test this feature on node14) can be worked around but complicates solution. So I think, it worth to deprecate node14 two months earlier in order to unblock graphql#3791 especially since we still in alpha stage. Less critical but still significant problem with node14 is that it ships with npm6 which doesn't support default format of the lockfile used by npm9 and this make updating dependencies trickier.
1 parent 8313944 commit da0a0d5

File tree

8 files changed

+14
-13649
lines changed

8 files changed

+14
-13649
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ module.exports = {
390390
'prefer-exponentiation-operator': 'error',
391391
'prefer-named-capture-group': 'off', // TODO: needs a better support in TS, see https://github.com/microsoft/TypeScript/issues/32098
392392
'prefer-numeric-literals': 'error',
393-
'prefer-object-has-own': 'off', // TODO: requires Node.js v16.9.0
393+
'prefer-object-has-own': 'error',
394394
'prefer-object-spread': 'error',
395395
'prefer-promise-reject-errors': 'error',
396396
'prefer-regex-literals': 'error',

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ jobs:
145145
runs-on: ubuntu-latest
146146
strategy:
147147
matrix:
148-
node_version_to_setup: [14, 16, 18]
148+
node_version_to_setup: [16, 18, 19]
149149
permissions:
150150
contents: read # for actions/checkout
151151
steps:

package-lock.json

Lines changed: 5 additions & 13636 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"graphql-js"
2727
],
2828
"engines": {
29-
"node": "^14.19.0 || ^16.10.0 || ^18.0.0 || >=19.0.0"
29+
"node": "^16.19.0 || ^18.14.0 || >=19.7.0"
3030
},
3131
"scripts": {
3232
"preversion": ". ./resources/checkgit.sh && npm ci --ignore-scripts",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": true,
33
"engines": {
4-
"node": ">= 14.0.0"
4+
"node": ">= 16.0.0"
55
}
66
}

src/execution/values.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function coerceVariableValues(
9292
continue;
9393
}
9494

95-
if (!hasOwnProperty(inputs, varName)) {
95+
if (!Object.hasOwn(inputs, varName)) {
9696
if (varDefNode.defaultValue) {
9797
coercedValues[varName] = valueFromAST(varDefNode.defaultValue, varType);
9898
} else if (isNonNullType(varType)) {
@@ -186,7 +186,7 @@ export function getArgumentValues(
186186
const variableName = valueNode.name.value;
187187
if (
188188
variableValues == null ||
189-
!hasOwnProperty(variableValues, variableName)
189+
!Object.hasOwn(variableValues, variableName)
190190
) {
191191
if (argDef.defaultValue !== undefined) {
192192
coercedValues[name] = argDef.defaultValue;
@@ -249,7 +249,3 @@ export function getDirectiveValues(
249249
return getArgumentValues(directiveDef, directiveNode, variableValues);
250250
}
251251
}
252-
253-
function hasOwnProperty(obj: unknown, prop: string): boolean {
254-
return Object.prototype.hasOwnProperty.call(obj, prop);
255-
}

src/language/parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ export class Parser {
14491449
parseDirectiveLocation(): NameNode {
14501450
const start = this._lexer.token;
14511451
const name = this.parseName();
1452-
if (Object.prototype.hasOwnProperty.call(DirectiveLocation, name.value)) {
1452+
if (Object.hasOwn(DirectiveLocation, name.value)) {
14531453
return name;
14541454
}
14551455
throw this.unexpected(start);

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
],
88
"compilerOptions": {
99
"lib": [
10-
"es2020",
10+
"es2022",
1111
"dom" // Workaround for missing web-compatible globals in `@types/node`
1212
],
13-
"target": "es2020",
13+
"target": "es2021",
1414
"module": "es2022",
1515
"moduleResolution": "node",
1616
"noEmit": true,

0 commit comments

Comments
 (0)