Skip to content

Commit 1dcca92

Browse files
authored
feat(NODE-4787)!: bump minimum Node.js version to v16.20.1 (#590)
1 parent 4c1db9a commit 1dcca92

File tree

7 files changed

+9
-23
lines changed

7 files changed

+9
-23
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,6 @@ functions:
9595
- .evergreen/run-bundling-test.sh
9696

9797
tasks:
98-
- name: node-tests-v14
99-
tags: ["node"]
100-
commands:
101-
- func: fetch source
102-
vars:
103-
NODE_LTS_VERSION: 14
104-
- func: install dependencies
105-
- func: run tests
106-
vars:
107-
TEST_TARGET: node
10898
- name: node-tests-v16
10999
tags: ["node"]
110100
commands:

.evergreen/install-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -o errexit # Exit the script with error if any of the commands fail
33

4-
NODE_LTS_VERSION=${NODE_LTS_VERSION:-14}
4+
NODE_LTS_VERSION=${NODE_LTS_VERSION:-16}
55

66
source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh"
77

package-lock.json

Lines changed: 1 addition & 1 deletion
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
@@ -94,7 +94,7 @@
9494
"require": "./lib/bson.cjs"
9595
},
9696
"engines": {
97-
"node": ">=14.20.1"
97+
"node": ">=16.20.1"
9898
},
9999
"scripts": {
100100
"pretest": "npm run build",

rollup.config.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ const tsConfig = {
99
checkJs: false,
1010
strict: true,
1111
alwaysStrict: true,
12-
target: 'es2020',
12+
target: 'es2021',
1313
module: 'esnext',
1414
moduleResolution: 'node',
1515
removeComments: true,
16-
lib: ['es2020'],
16+
lib: ['es2021'],
1717
importHelpers: false,
1818
noEmitHelpers: false,
1919
noEmitOnError: true,

test/load_bson.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@ const fs = require('node:fs');
55
const path = require('node:path');
66
const crypto = require('node:crypto');
77

8-
// TODO(NODE-4787): Node.js 16 was when the atob and btoa globals were introduced, so we need replacements for testing on 14
9-
const shim_btoa = input => Buffer.prototype.toString.call(Buffer.from(input), 'base64');
10-
const shim_atob = input => Buffer.from(input, 'base64').toString('binary');
11-
128
const commonGlobals = {
139
TextEncoder,
1410
TextDecoder,
15-
btoa: typeof btoa !== 'undefined' ? btoa : shim_btoa,
16-
atob: typeof atob !== 'undefined' ? atob : shim_atob,
11+
btoa,
12+
atob,
1713
crypto: {
1814
getRandomValues(buffer) {
1915
const random = crypto.randomBytes(buffer.byteLength);

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"checkJs": false,
55
"strict": true,
66
"alwaysStrict": true,
7-
"target": "es2020",
7+
"target": "es2021",
88
"module": "commonjs",
99
"moduleResolution": "node",
1010
"skipLibCheck": true,
1111
"lib": [
12-
"es2020",
12+
"es2021",
1313
],
1414
"outDir": "lib",
1515
"importHelpers": false,

0 commit comments

Comments
 (0)