-
Notifications
You must be signed in to change notification settings - Fork 67
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
fix: upgrade to node-fetch@3.X MONGOSH-1702 #1845
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
paula-stacho
force-pushed
the
MONGOSH-1702
branch
from
February 29, 2024 13:34
0bd2f40
to
6153291
Compare
paula-stacho
force-pushed
the
MONGOSH-1702
branch
from
February 29, 2024 14:53
be6f028
to
1dc9ace
Compare
addaleax
reviewed
Feb 29, 2024
paula-stacho
force-pushed
the
MONGOSH-1702
branch
2 times, most recently
from
March 4, 2024 12:34
f8476c7
to
b2ef18d
Compare
addaleax
reviewed
Mar 4, 2024
paula-stacho
force-pushed
the
MONGOSH-1702
branch
2 times, most recently
from
March 4, 2024 17:02
b741f1b
to
b900d03
Compare
addaleax
approved these changes
Mar 5, 2024
paula-stacho
force-pushed
the
MONGOSH-1702
branch
from
March 6, 2024 10:28
9b1822e
to
a53c46d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://jira.mongodb.org/browse/MONGOSH-1702
Description
The new version doesn't work with our tsconfig, that's why the "skipLibCheck". I hope it's okay I added it to the common config, I've seen we already have it in @mongodb-js/tsconfig-devtools
Code changes are due to:
response.body
can be null - this was probably already true before, just the types were weaker. the upgrade guide only mentions removing a string option. from what I see we've been treating it as a stream. https://github.com/node-fetch/node-fetch/blob/main/docs/v3-UPGRADE-GUIDE.md#reqbody-can-no-longer-be-a-stringresponse.json()
isPromise<unknown>
. again, the types were probably just weaker before and it passed as any.import-node-fetch
wrapperonce
is now recommended when listening for errors https://github.com/node-fetch/node-fetch/blob/main/docs/v3-UPGRADE-GUIDE.md#a-stream-pipeline-is-now-used-to-forward-errorsNote: You'll see the code updates in the build package as well, but not the version change. Originally I thought I might as well upgrade node-fetch everywhere, but the ES Module doesn't work with
ts-node
. Looks like ESM support in ts-node comes with a warning, and this isn't directly connected to the deprecation warning in homebrew, so I think we can leave this on 2.x for now.