-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Require Node.js 18 #24
Conversation
tsconfig.json
Outdated
"lib": [ | ||
"DOM", | ||
"DOM.Iterable", | ||
"ES2021" | ||
"ES2023" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why doesn't lib
match target
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On https://node.green we can check which version we can use, by the way.
From a quick look it seems ES2023 is supported… but is it only 3 features? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So why not also 2023 "target" then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, was just providing a source to pick one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially matched the tsconfig to @tsconfig/node18. Looking into it ES2023 has more than whats listed on node.green:
ECMAScript 2023, the 14th edition, introduced the toSorted, toReversed, with, findLast, and findLastIndex methods on Array.prototype and TypedArray.prototype, as well as the toSpliced method on Array.prototype; added support for #! comments at the beginning of files to better facilitate executable ECMAScript files; and allowed the use of most Symbols as keys in weak collections.
Source: https://tc39.es/ecma262/#sec-intro
For example [].toSorted()
works with ES2023 but does not in Node.js 18.
This means only ES2022 is supported by Node.js 18 and node.green seems to miss some features? I also can not find top-level await from ES2022 on there.
Similar to 3ae0110 this updates to Node.js 18.
As Node.js is end of life since 2023-09-11 this updates the config to Node.js 18. This change is inspired by 3ae0110 and @tsconfig/node18.