-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Reason for the upgrade
Axios v1.7.0 (stable released May 2024; the feature was already available in the v1.7.0-beta.0 you linked) officially introduces a new built-in fetch adapter based on the native Fetch API.
Official release: https://github.com/axios/axios/releases/tag/v1.7.0
Main PR that added the fetch adapter: axios/axios#6371
Key benefits of the new fetch adapter
- Uses the modern Fetch API → better performance and significantly smaller bundle size (no longer depends on XMLHttpRequest).
- Native support for response streaming (
responseType: 'stream') andFormData. - Upload/download progress events work the same as with the XHR adapter.
- Allows injection of a custom fetch implementation (extremely useful in Edge runtimes like Vercel Edge Functions, Cloudflare Workers, Next.js middleware, SvelteKit server endpoints, etc.).
- Axios automatically selects the fetch adapter when
XMLHttpRequestor Node’shttpmodule are unavailable, or it can be forced explicitly:
axios.get(url, {
adapter: 'fetch' // or a custom fetch implementation
})Metadata
Metadata
Assignees
Labels
No labels