-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Update @types/node
dependency version
#13987
base: main
Are you sure you want to change the base?
Conversation
packages/bun-types/package.json
Outdated
@@ -14,7 +14,7 @@ | |||
], | |||
"homepage": "https://bun.sh", | |||
"dependencies": { | |||
"@types/node": "~20.12.8", | |||
"@types/node": "~20.16.5", |
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.
The 22.x
branch is a closer match to Bun, so is there a reason to not adopt that?
"@types/node": "~20.16.5", | |
"@types/node": "~22.5.5", |
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 was being conservative because I wasn't really sure how the version was chosen or if bun
was aiming for compatibility with a particular version of node.
The version was last updated in 2a40148 and I didn't see why that specific version was chosen (I don't think it was the latest on May 1st?). A specific version of @types/node
(rather than *
) was added in #8195 but looking through that I didn't see any reasoning behind how the version was chosen.
TL;DR - I'm happy to make this change (and the corresponding change in the lockfile) but would love to understand the more about the why of this version!
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.
Very reasonable. I'm curious as well. Thanks for pushing this along!
Thanks for this. We probably should update it to match the current reported version of Node, which I think is the very latest release |
No worries :)
Sorry for being dense but not sure what you mean here... This page "reflects Bun's compatibility with Node.js v20". The node website offers |
Ah - I poked around a bit more and saw that I'm using |
When I upgraded my project to use [email protected] I ran into the issue described in [this SO post](https://stackoverflow.com/a/78790944/223931). The solution is to use a newer version of `@types/node` which has been updated to deal with the changes in the latest TypeScript. In my project I've introduced an explicit dependency on `@types/[email protected]` (the newest version currently available in the `^20.0.0` range) since the fix doesn't exist in `20.12.14` (the newest version available in the `~20.12.8` range which was currently defined) which seems to solve the problem. But I thought it would be helpful to others if the change was made here so they didn't need to debug the problem. DISCLAIMER: I don't know how these types are used and if there is any chance I've introduced other problems with this change...
This is the closest available match to the version reported by `process.version` in the current version of `bun`
75bee03
to
751a640
Compare
When I upgraded my project to use [email protected] I ran into the issue described in this SO post.
The solution is to use a newer version of
@types/node
which has been updated to deal with the changes in the latest TypeScript.In my project I've introduced an explicit dependency on
@types/[email protected]
(the newest version currently available in the^20.0.0
range) since the fix doesn't exist in20.12.14
(the newest version available in the~20.12.8
range which was currently defined) which seems to solve the problem. But I thought it would be helpful to others if the change was made here so they didn't need to debug the problem.DISCLAIMER: I don't know how these types are used and if there is any chance I've introduced other problems with this change...
What does this PR do?
Updates the
@types/node
dependency inbun-types
from~20.12.8
to~20.16.5
How did you verify your code works?