Skip to content
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 cross-fetch dependency #1658

Open
flevi29 opened this issue May 23, 2024 · 0 comments
Open

Remove cross-fetch dependency #1658

flevi29 opened this issue May 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@flevi29
Copy link
Collaborator

flevi29 commented May 23, 2024

As detailed in #1610, cross-fetch isn't helping much. The only thing it does is use node-fetch on older Node.js versions.

Also we are using two additional web standards that won't run on IE11 and we're not polyfilling:

const constructURL = new URL(url, this.url)
if (params) {
const queryParams = new URLSearchParams()
Object.keys(params)
.filter((x: string) => params[x] !== null)
.map((x: string) => queryParams.set(x, params[x]))
constructURL.search = queryParams.toString()
}

I propose we remove this polyfill, users of this library can import a polyfill script for fetch (browser) (node) and the other stuff themselves in the few cases where they might still need to do so, and if they're targeting IE11, they already need to do this with URL https://github.com/lifaon74/url-polyfill. I believe polyfilling should be the responsibility of the final apps/websites.

#1656 is kind of a blocker for this, as removing cross-fetch would break tests, and that PR already fixes them.

@flevi29 flevi29 added the enhancement New feature or request label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant