Skip to content

Drop Node.js v18 (EoL) support #7354

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

Merged
merged 5 commits into from
Mar 23, 2025
Merged
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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

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

#### :house: Internal

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Happy hacking!

> Most of our contributors are working on Apple machines, so all our instructions are currently macOS / Linux centric. Contributions for Windows development welcome!

- [NodeJS v18](https://nodejs.org/)
- [Node.js](https://nodejs.org/) v20.x
- C compiler toolchain (usually installed with `xcode` on Mac)
- Python <= 3.11 (required to build ninja)
- Rust toolchain (required to build rewatch; follow the instructions at https://www.rust-lang.org/tools/install)
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"Woonki Moon (https://github.com/mununki)"
],
"engines": {
"node": ">=18"
"node": ">=20.11.0"
},
"bin": {
"bsc": "cli/bsc",
Expand Down Expand Up @@ -78,5 +78,5 @@
"mocha": "10.8.2",
"nyc": "15.0.0"
},
"packageManager": "[email protected].1+sha512.0e9d42e92bd2318408ed81eaff2da5f78baf23ee7d12a6eed44a6e2901d0f29d7ab715d1b918ade601f72e769a824d9a5c322383f22bbbda5dd396e79de2a077"
"packageManager": "[email protected].2+sha512.c7f0088c520a46596b85c6f8f1da943400199748a0f7ea8cb8df75469668dc26f6fb3ba26df87e2884a5ebe91557292d0f3db7d0929cdb4f14910c3032ac81fb"
}
13 changes: 8 additions & 5 deletions tests/docstring_tests/DocTest.res
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,14 @@ let nodeVersion =

let ignoreRuntimeTests = [
(
// Ignore some tests not supported by node v18
18,
// Ignore some tests require Node.js v20+
20,
["Stdlib.Array.toReversed", "Stdlib.Array.toSorted"],
),
(
// Ignore some tests require Node.js v22+
22,
[
"Stdlib.Array.toReversed",
"Stdlib.Array.toSorted",
"Stdlib.Promise.withResolvers",
"Stdlib.Set.union",
"Stdlib.Set.isSupersetOf",
Expand Down Expand Up @@ -202,7 +205,7 @@ let main = async () => {
let codeExamples = examples->Array.filterMap(example => {
let ignoreExample =
ignoreRuntimeTests->Array.some(
((version, tests)) => nodeVersion === version && tests->Array.includes(example.id),
((version, tests)) => nodeVersion < version && tests->Array.includes(example.id),
)

if ignoreExample {
Expand Down
19 changes: 13 additions & 6 deletions tests/docstring_tests/DocTest.res.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@ import * as RescriptTools_Docgen from "rescript/lib/es6/RescriptTools_Docgen.js"

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");

let ignoreRuntimeTests = [[
18,
let ignoreRuntimeTests = [
[
20,
[
"Stdlib.Array.toReversed",
"Stdlib.Array.toSorted",
"Stdlib.Array.toSorted"
]
],
[
22,
[
"Stdlib.Promise.withResolvers",
"Stdlib.Set.union",
"Stdlib.Set.isSupersetOf",
Expand All @@ -37,7 +43,8 @@ let ignoreRuntimeTests = [[
"Stdlib.Set.symmetricDifference",
"Stdlib.Set.difference"
]
]];
]
];

function getOutput(buffer) {
return buffer.map(e => e.toString()).join("");
Expand All @@ -60,7 +67,7 @@ async function extractDocFromFile(file) {
RE_EXN_ID: "Assert_failure",
_1: [
"DocTest.res",
58,
61,
9
],
Error: new Error()
Expand Down Expand Up @@ -237,7 +244,7 @@ async function main() {
examples.sort((a, b) => Primitive_string.compare(a.name, b.name));
let codeExamples = Stdlib_Array.filterMap(examples, example => {
let ignoreExample = ignoreRuntimeTests.some(param => {
if (nodeVersion === param[0]) {
if (nodeVersion < param[0]) {
return param[1].includes(example.id);
} else {
return false;
Expand Down