Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

JS client: use native fetch when available. #181

Merged
merged 1 commit into from
Feb 17, 2023
Merged

JS client: use native fetch when available. #181

merged 1 commit into from
Feb 17, 2023

Conversation

BearLemma
Copy link
Contributor

Might be fixing #179
Needs testing though.

@BearLemma
Copy link
Contributor Author

BearLemma commented Feb 12, 2023 via email

@CodingDoug
Copy link
Contributor

Yeah I tried that but the compiler gave me a finger :(

Really? tsc gave me no issues with that.

@MarinPostma
Copy link
Collaborator

@BearLemma this may overlap with #214 where I had to switch to axios because of the keep-alive mess.

@CodingDoug
Copy link
Contributor

@BearLemma this may overlap with #214 where I had to switch to axios because of the keep-alive mess.

@MarinPostma Does axios work on CloudFlare? If it's not using native fetch behind the scenes, it might not work on CF at all. CF workers are one of our primary use case right now for this client library.

@MarinPostma
Copy link
Collaborator

uhh no it does not. So we abandon support for node?
Let's make sure that worker fetch supports keep-alive at least

@MarinPostma
Copy link
Collaborator

what a joke this language is...

@CodingDoug
Copy link
Contributor

CodingDoug commented Feb 15, 2023

uhh no it does not. So we abandon support for node? Let's make sure that worker fetch supports keep-alive at least

Not sure what you mean. This library already works on node, browsers, and react native via the cross-fetch library. This PR enables the use of native fetch if it's available (which cross-fetch inconveniently does not delegate to correctly) in order to support CF.

@MarinPostma
Copy link
Collaborator

I'm referring to #214. I need to find a way to make the version check portable.

@BearLemma
Copy link
Contributor Author

bors merge

@bors
Copy link
Contributor

bors bot commented Feb 17, 2023

Build succeeded:

@bors bors bot merged commit f8043c6 into main Feb 17, 2023
@MarinPostma MarinPostma deleted the native-fetch branch August 25, 2023 13:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants