-
Notifications
You must be signed in to change notification settings - Fork 62
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
Remove node-fetch in favour of native fetch #826
Conversation
Hey @eddie-atkinson! Welcome back, sooner than I thought 😅 Sorry to hear about the failed rebase but happy that as usual nothing dissuades you 😁 Firstly, thanks so much for this. All looks perfect as usual. I just wanted to share my current thoughts on a few things before we decide where to merge / release this. Edit: It's a little off-topic for this PR so I ultimately split off the relevant sections to the relevant issues, see #797 and #794 where I tagged you. Re CloudFlare specific:
Edit: I had originally said it would be nice to discuss the above (including the linked issues) to help decide when and where to merge this to, but on reflection, this PR is nicely self contained and whatever simple things we can get through before the next major release, can only help us Thanks again, as usual! 🙏 |
Ok actually let's move this chat to the various relevant issues, which might make it more manageable too. You'll be getting a few tags, sorry about that ;) |
Thanks again, @eddie-atkinson! Great to finally remove Edited my original reply above, splitting off the non-relevant parts of the PR. Except now this is merged and there are still the other CloudFlare issues you mention... we can still discuss here or open a new issue, as you prefer. P.S. Did you happen to test for creating new files with |
Hey @gadicc I have spent a little bit of time hacking around with this, and I even read the contribution guide (for the first time if you can believe it), and I don't really know how to test this. I setup a small test file in the
Which when I run with
That's obviously related to the URL being missing, but I'm slightly surprised I have to supply that. I think I'm missing the bigger picture on how this works / fits in. |
Hey, no prob, this was quite an easy fix. Yeah, hehe umm, at first glance that looks right. Not sure why you got that error. I was a bit short on time so didn't try make it work, I just added another symbol to I would't worry too much since as soon as we switch to use https://github.com/gadicc/fetch-mock-cache, P.S. Actually everywhere in the code base we manually specify an exact filename for Thanks again. |
## [2.13.3](v2.13.2...v2.13.3) (2024-12-21) ### Bug Fixes * **chart:** validate includePrePost:false, interval:1m (fixes [#812](#812)) ([5ca811d](5ca811d)) * **fetchDevel:** fix application/json detection ([cc0390a](cc0390a)) * **fetchDevel:** use std Headers methods in contentObj ([#826](#826)) ([46273db](46273db)) * **notices:** fix typo in log: s/supress/suppress/ (fixes [#845](#845)) ([0e47049](0e47049)) ### Reverts * Revert "chore(tests): temporarily disable getCrumb tests on CI" ([6f48387](6f48387)) * Revert "chore(tests): different approach for weird CI getCrumb test issue" ([d595714](d595714))
🎉 This PR is included in version 2.13.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Closes # .
Changes
node-fetch
in favour of native fetchType
Comments/notes
Annoyingly my last PR was clobbered when I synced with the upstream, so I'm going to replay my changes here. This change is pretty uncontroversial so I'll start with it.
Some things that have changed since my previous PR was opened:
nodejs_compat_v2
flag GA. This obviates the need for a bunch of mundane changes in my previous PR to do with prefixing everything withnode:
Where does this leave us?
There are only two remaining blockers to supporting Cloudflare:
node-fetch
which this PR addressesnode-yahoo-finance2
is looking to drop browser support, so I was thinking we could switch out the current import for a call tonode:fs
and then validate the structure with typebox (if we were so inclined). Though I appreciate that is a bit of a cludge fix and significantly less elegant than just using the features of the primary platform this library supports.Otherwise though I managed to get a local CloudFlare Worker running with this config using
[email protected]
:There is also the separate discussion of environment variables we started on my last PR. That is no longer a blocker for CloudFlare after the latest compatibility changes. HOWEVER, I think it still merits exploration at least for allowing callers to merge environment vars à la suggestion made by @gadicc in the last discussion:
I will have a look at doing this in a follow up.