-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
BREAKING CHANGE: drop support for XMLHttpRequest and remove cross-fetch #144
base: master
Are you sure you want to change the base?
Conversation
XMLHttpRequest is only used as fallback... if no fetch is available... |
@adrai unnecessary code being downloaded by browsers and package managers. Other packages might also import cross-fetch but with another version, resulting in dependency duplication. |
Do you have an actual issue with the current i18next-http-backend version? |
@adrai there's no urgency of it getting merged, I just submitted a PR as a general ecosystem cleanup. That's done so that modern environments aren't slowed down by unnecessary polyfills. |
My concern is, I know there are users out there having still the need for this fallbacks... if I merge this now, there risk is high there will be more github issues, etc... asking for bringing back support etc... |
ok, then let's keep this PR open for a while... |
|
will come back to this in 6-7 months... |
@adrai thanks for reaching out and taking time to look at the PR! I'll ping in 6 months in case of anything |
This PR removes support for XMLHttpRequest as it is not used widely anymore for fetching things. Fetch API no longer requires a polyfill on Node.js, and is supported by all major browsers and runtimes.
See compatibility table: https://developer.mozilla.org/en-US/docs/Web/API/fetch#browser_compatibility
and: https://caniuse.com/fetch
For environments that don't support fetch (such as IE11) - they should install a fetch polyfill in their projects.
It also removes dependency on
cross-fetch
as it is not needed anymore. Node.js supportsfetch
natively since 18.x. I've added anengines.node
field to notify that minimum node 18 is required.Since it's a breaking change, in my opinion a semver major bump is required.
Checklist
npm run test
Checklist (for documentation change)