Skip to content

Commit a867042

Browse files
cometkimfhammerschmidt
authored andcommitted
Drop Node.js v18 (EoL) support (#7354)
* Drop Node.js v18 (EoL) support * pin NPM to v10.8.2
1 parent ffaf5c3 commit a867042

File tree

7 files changed

+27
-16
lines changed

7 files changed

+27
-16
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18
1+
20

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
- Replace ~date with ~day in Date.make\*. https://github.com/rescript-lang/rescript/pull/7324
2929
- Remove `-bs-jsx-mode`. https://github.com/rescript-lang/rescript/pull/7327
30+
- Drop Node.js version <20 support, as it is reaching End-of-Life. https://github.com/rescript-lang/rescript-compiler/pull/7354
3031

3132
#### :house: Internal
3233

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Happy hacking!
1414

1515
> Most of our contributors are working on Apple machines, so all our instructions are currently macOS / Linux centric. Contributions for Windows development welcome!
1616
17-
- [NodeJS v18](https://nodejs.org/)
17+
- [Node.js](https://nodejs.org/) v20.x
1818
- C compiler toolchain (usually installed with `xcode` on Mac)
1919
- Python <= 3.11 (required to build ninja)
2020
- Rust toolchain (required to build rewatch; follow the instructions at https://www.rust-lang.org/tools/install)

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"Woonki Moon (https://github.com/mununki)"
3434
],
3535
"engines": {
36-
"node": ">=18"
36+
"node": ">=20.11.0"
3737
},
3838
"bin": {
3939
"bsc": "cli/bsc",
@@ -78,5 +78,5 @@
7878
"mocha": "10.8.2",
7979
"nyc": "15.0.0"
8080
},
81-
"packageManager": "[email protected].1+sha512.0e9d42e92bd2318408ed81eaff2da5f78baf23ee7d12a6eed44a6e2901d0f29d7ab715d1b918ade601f72e769a824d9a5c322383f22bbbda5dd396e79de2a077"
81+
"packageManager": "[email protected].2+sha512.c7f0088c520a46596b85c6f8f1da943400199748a0f7ea8cb8df75469668dc26f6fb3ba26df87e2884a5ebe91557292d0f3db7d0929cdb4f14910c3032ac81fb"
8282
}

tests/docstring_tests/DocTest.res

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ let nodeVersion =
2121

2222
let ignoreRuntimeTests = [
2323
(
24-
// Ignore some tests not supported by node v18
25-
18,
24+
// Ignore some tests require Node.js v20+
25+
20,
26+
["Stdlib.Array.toReversed", "Stdlib.Array.toSorted"],
27+
),
28+
(
29+
// Ignore some tests require Node.js v22+
30+
22,
2631
[
27-
"Stdlib.Array.toReversed",
28-
"Stdlib.Array.toSorted",
2932
"Stdlib.Promise.withResolvers",
3033
"Stdlib.Set.union",
3134
"Stdlib.Set.isSupersetOf",
@@ -202,7 +205,7 @@ let main = async () => {
202205
let codeExamples = examples->Array.filterMap(example => {
203206
let ignoreExample =
204207
ignoreRuntimeTests->Array.some(
205-
((version, tests)) => nodeVersion === version && tests->Array.includes(example.id),
208+
((version, tests)) => nodeVersion < version && tests->Array.includes(example.id),
206209
)
207210

208211
if ignoreExample {

tests/docstring_tests/DocTest.res.mjs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@ import * as RescriptTools_Docgen from "rescript/lib/es6/RescriptTools_Docgen.js"
2323

2424
let nodeVersion = Stdlib_Option.getExn(Stdlib_Int.fromString(Stdlib_Option.getExn(process.version.replace("v", "").split(".")[0], "Failed to find major version of Node"), undefined), "Failed to convert node version to Int");
2525

26-
let ignoreRuntimeTests = [[
27-
18,
26+
let ignoreRuntimeTests = [
27+
[
28+
20,
2829
[
2930
"Stdlib.Array.toReversed",
30-
"Stdlib.Array.toSorted",
31+
"Stdlib.Array.toSorted"
32+
]
33+
],
34+
[
35+
22,
36+
[
3137
"Stdlib.Promise.withResolvers",
3238
"Stdlib.Set.union",
3339
"Stdlib.Set.isSupersetOf",
@@ -37,7 +43,8 @@ let ignoreRuntimeTests = [[
3743
"Stdlib.Set.symmetricDifference",
3844
"Stdlib.Set.difference"
3945
]
40-
]];
46+
]
47+
];
4148

4249
function getOutput(buffer) {
4350
return buffer.map(e => e.toString()).join("");
@@ -60,7 +67,7 @@ async function extractDocFromFile(file) {
6067
RE_EXN_ID: "Assert_failure",
6168
_1: [
6269
"DocTest.res",
63-
58,
70+
61,
6471
9
6572
],
6673
Error: new Error()
@@ -237,7 +244,7 @@ async function main() {
237244
examples.sort((a, b) => Primitive_string.compare(a.name, b.name));
238245
let codeExamples = Stdlib_Array.filterMap(examples, example => {
239246
let ignoreExample = ignoreRuntimeTests.some(param => {
240-
if (nodeVersion === param[0]) {
247+
if (nodeVersion < param[0]) {
241248
return param[1].includes(example.id);
242249
} else {
243250
return false;

0 commit comments

Comments
 (0)