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
feat(adapters): add fetch
adapter
#5146
Commits on Apr 11, 2024
-
feat: add
fetch
adapter with cross-platform supportThis changeset adds a `fetch`-based adapter implementation to `axios`, powered by `cross-fetch`[1]. The implementation may thus be used on either Node or in browser environments. Changes enclosed: - Add `fetch` adapter implementation - Add `fetch` to standard built-in adapters - Add initial Node-side tests for `fetch` - Slight refactor to tests to use common setup / teardown code Still pending: - Upload/download progress events - Browser-side testing Fixes and closes axios#1219, and supersedes axios#2891.
Configuration menu - View commit details
-
Copy full SHA for d8bc138 - Browse repository at this point
Copy the full SHA d8bc138View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac79b8c - Browse repository at this point
Copy the full SHA ac79b8cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 847571c - Browse repository at this point
Copy the full SHA 847571cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a584083 - Browse repository at this point
Copy the full SHA a584083View commit details -
feat(fetch): continue with implementation of Fetch adapter + API
- Add support for `axios(URL(...))` and `axios({url: URL(...)})` - Add config support for `fetcher`, `fetchOptions` and `parsedUrl` - Translate `config.url = URL(...)` to string - Implement override for `config.fetcher`
Configuration menu - View commit details
-
Copy full SHA for 6add26b - Browse repository at this point
Copy the full SHA 6add26bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 84171fd - Browse repository at this point
Copy the full SHA 84171fdView commit details -
feat(fetch): implement mock
fetch
for testing- Mock fetch implementation for testing - Spawn fetch adapter configs for testing - Test for expected instance/static props related to fetch adapter
Configuration menu - View commit details
-
Copy full SHA for 97b38cd - Browse repository at this point
Copy the full SHA 97b38cdView commit details -
feat(fetch): add browser-side test suite
- Add initial browser tests for fetch adapter - Test for acceptance of `URL`
Configuration menu - View commit details
-
Copy full SHA for b57d896 - Browse repository at this point
Copy the full SHA b57d896View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ea0b0a - Browse repository at this point
Copy the full SHA 0ea0b0aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3b79be5 - Browse repository at this point
Copy the full SHA 3b79be5View commit details -
Configuration menu - View commit details
-
Copy full SHA for b141d45 - Browse repository at this point
Copy the full SHA b141d45View commit details -
feat(fetch): add new
generic
library target (ESM/pure JS)- Add pure JS Node polyfill deps - Add new `generic` dist target for Workers, Deno, etc. - Move to typealiases in `lib/platform/...` rather than direct use - Adapt tests for new alias imports - Drop `cross-fetch`, any need for Node polyfills in pure JS envs
Configuration menu - View commit details
-
Copy full SHA for 079e193 - Browse repository at this point
Copy the full SHA 079e193View commit details -
feat(fetch): implement structure for abstract fetch testsuite
- Implement abstract testsuite structure for fetch - Move browser fetch tests to new implementation + API - Implement pure-JS test for Deno, based on new API - Add test command for Deno (`npm run test:deno`) - Add alias test command for Node (`npm run test:node`) - Add alias to run all tests (`npm run test:all`)
Configuration menu - View commit details
-
Copy full SHA for d327984 - Browse repository at this point
Copy the full SHA d327984View commit details -
feat(fetch): add Deno benchmark and example
- Add basic fetch overhead benchmark - Add example using new `generic` output
Configuration menu - View commit details
-
Copy full SHA for 21ee695 - Browse repository at this point
Copy the full SHA 21ee695View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cf9879 - Browse repository at this point
Copy the full SHA 5cf9879View commit details -
Configuration menu - View commit details
-
Copy full SHA for c823ca6 - Browse repository at this point
Copy the full SHA c823ca6View commit details -
Configuration menu - View commit details
-
Copy full SHA for f783bc4 - Browse repository at this point
Copy the full SHA f783bc4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 53f5733 - Browse repository at this point
Copy the full SHA 53f5733View commit details -
Configuration menu - View commit details
-
Copy full SHA for fac5d2b - Browse repository at this point
Copy the full SHA fac5d2bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 78f857f - Browse repository at this point
Copy the full SHA 78f857fView commit details -
Configuration menu - View commit details
-
Copy full SHA for dbe9353 - Browse repository at this point
Copy the full SHA dbe9353View commit details -
feat(fetch): platform-driven default adapters for each build
- Define `knownAdapters` for each platform type - Import `knownAdapters` for library defaults - Alias XHR adapter to `#xhrAdapter`, only include in browser libs - Add `.generic.d.*ts` type entries which omit XHR adapter
Configuration menu - View commit details
-
Copy full SHA for 7125e21 - Browse repository at this point
Copy the full SHA 7125e21View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd6bc2e - Browse repository at this point
Copy the full SHA dd6bc2eView commit details -
feat(fetch): tools to analyze browser/generic bundle sizes
Temporary: will probably drop before merge
Configuration menu - View commit details
-
Copy full SHA for 4c1f890 - Browse repository at this point
Copy the full SHA 4c1f890View commit details -
Configuration menu - View commit details
-
Copy full SHA for c75abe9 - Browse repository at this point
Copy the full SHA c75abe9View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca226d9 - Browse repository at this point
Copy the full SHA ca226d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 77f765d - Browse repository at this point
Copy the full SHA 77f765dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e29bdb8 - Browse repository at this point
Copy the full SHA e29bdb8View commit details -
feat(fetch): platform-specific defaults for
fetchOptions
- Setup baseline default and platform-specific `fetchOption`s - Avoids issue with some environments not supporting `cache` - Allows shipping bundles with reasonable defaults for each env
Configuration menu - View commit details
-
Copy full SHA for 223cca0 - Browse repository at this point
Copy the full SHA 223cca0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3665213 - Browse repository at this point
Copy the full SHA 3665213View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6817bbd - Browse repository at this point
Copy the full SHA 6817bbdView commit details -
Configuration menu - View commit details
-
Copy full SHA for b3375dc - Browse repository at this point
Copy the full SHA b3375dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for d23fa4f - Browse repository at this point
Copy the full SHA d23fa4fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ccd2b81 - Browse repository at this point
Copy the full SHA ccd2b81View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5a33664 - Browse repository at this point
Copy the full SHA 5a33664View commit details -
feat(fetch): better debug logging, assertions, support for
Blob
- Support for blob responses (when not identifiable as text) - Small logging enhancements for fetch debug logs - Internal assertions which can be disabled and dropped from `min` bundles, and which ensure correct internal fetch state
Configuration menu - View commit details
-
Copy full SHA for f0e3861 - Browse repository at this point
Copy the full SHA f0e3861View commit details -
Configuration menu - View commit details
-
Copy full SHA for 111a96a - Browse repository at this point
Copy the full SHA 111a96aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e586ee6 - Browse repository at this point
Copy the full SHA e586ee6View commit details -
fix(fetch): refactor and cleanup response handler selection
- Break response handler selection into dedicated function - Only check for body if response code carries one by spec
Configuration menu - View commit details
-
Copy full SHA for 62db627 - Browse repository at this point
Copy the full SHA 62db627View commit details -
fix(fetch): fixes for Fetch adapter in CloudFlare Workers env
- Don't duck-type response based on `response.type`, which is not implemented in CloudFlare Workers' runtime
Configuration menu - View commit details
-
Copy full SHA for a7dda93 - Browse repository at this point
Copy the full SHA a7dda93View commit details -
feat(fetch): sample for CloudFlare Workers
- Sample which implements the CORS endpoint for testing Axios/Fetch - Serves the Axios Fetch-branch library, but with CORS - Enables testing of ESM
Configuration menu - View commit details
-
Copy full SHA for ae675b9 - Browse repository at this point
Copy the full SHA ae675b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for baa0553 - Browse repository at this point
Copy the full SHA baa0553View commit details -
Configuration menu - View commit details
-
Copy full SHA for a80dab3 - Browse repository at this point
Copy the full SHA a80dab3View commit details -
feat(fetch): pure-ESM web testing
- Add `web-test-runner` and associated dependencies - Add invocation point for pure ESM tests
Configuration menu - View commit details
-
Copy full SHA for 640bcca - Browse repository at this point
Copy the full SHA 640bccaView commit details -
Configuration menu - View commit details
-
Copy full SHA for cbd5c42 - Browse repository at this point
Copy the full SHA cbd5c42View commit details -
Configuration menu - View commit details
-
Copy full SHA for 72ea94a - Browse repository at this point
Copy the full SHA 72ea94aView commit details -
Configuration menu - View commit details
-
Copy full SHA for d110264 - Browse repository at this point
Copy the full SHA d110264View commit details -
Configuration menu - View commit details
-
Copy full SHA for 79b4d06 - Browse repository at this point
Copy the full SHA 79b4d06View commit details -
feat(fetch): treeshaking and terser tweaks, optimize license
- Tweak treeshaking to be more aggressive on modern platforms - Move license comment to bottom of output targets
Configuration menu - View commit details
-
Copy full SHA for 5a304e8 - Browse repository at this point
Copy the full SHA 5a304e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 44a6fc4 - Browse repository at this point
Copy the full SHA 44a6fc4View commit details -
feat(fetch): improvements to fetch typings
- Structured type for `FetchOptions` - Better type export for `Fetcher` - Better type export for `AxiosFetchAdapter`
Configuration menu - View commit details
-
Copy full SHA for a8de64a - Browse repository at this point
Copy the full SHA a8de64aView commit details -
chore: cleanup abstract fetch testsuite
- Add support for `beforeEach`/`afterEach` - Add full typings for abstract test types - Prep to extend abstract test suite to Node
Configuration menu - View commit details
-
Copy full SHA for 0e7cd28 - Browse repository at this point
Copy the full SHA 0e7cd28View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8445ed8 - Browse repository at this point
Copy the full SHA 8445ed8View commit details -
Configuration menu - View commit details
-
Copy full SHA for a4d2ba6 - Browse repository at this point
Copy the full SHA a4d2ba6View commit details -
Configuration menu - View commit details
-
Copy full SHA for e4cfe15 - Browse repository at this point
Copy the full SHA e4cfe15View commit details -
fix: handler selection with no
Content-Type
present- Skip checking config for handler type if no `responseType` param is present - Only resolve handler from `Content-Type` if header is available in response
Configuration menu - View commit details
-
Copy full SHA for 358d896 - Browse repository at this point
Copy the full SHA 358d896View commit details -
Configuration menu - View commit details
-
Copy full SHA for 71dbee0 - Browse repository at this point
Copy the full SHA 71dbee0View commit details -
Configuration menu - View commit details
-
Copy full SHA for e6771b3 - Browse repository at this point
Copy the full SHA e6771b3View commit details -
- Move properties around to avoid stray changes in diffs - Move `cross-fetch` to optional deps
Configuration menu - View commit details
-
Copy full SHA for a0e215f - Browse repository at this point
Copy the full SHA a0e215fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7310032 - Browse repository at this point
Copy the full SHA 7310032View commit details -
Configuration menu - View commit details
-
Copy full SHA for d791176 - Browse repository at this point
Copy the full SHA d791176View commit details -
fix: pass relative URLs directly to the underlying fetcher
- Instead of failing, bypass URL parsing, and pass the URL verbatim to the underlying fetch implementation
Configuration menu - View commit details
-
Copy full SHA for 3c42865 - Browse repository at this point
Copy the full SHA 3c42865View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2f4802b - Browse repository at this point
Copy the full SHA 2f4802bView commit details -
chore: cleanup abstract fetch testsuite
- Move abstract fetch testsuite tests into basic test spec file
Configuration menu - View commit details
-
Copy full SHA for bdf4b15 - Browse repository at this point
Copy the full SHA bdf4b15View commit details -
Configuration menu - View commit details
-
Copy full SHA for 07a8770 - Browse repository at this point
Copy the full SHA 07a8770View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39af694 - Browse repository at this point
Copy the full SHA 39af694View commit details -
fix: allow version tag in user-agent test
Signed-off-by: Sam Gammon <sam@elide.ventures>
Configuration menu - View commit details
-
Copy full SHA for 29fc3e6 - Browse repository at this point
Copy the full SHA 29fc3e6View commit details -
chore: version bump for
fetch
testing →1.6.8-fetch
Signed-off-by: Sam Gammon <sam@elide.ventures>
Configuration menu - View commit details
-
Copy full SHA for baa53f6 - Browse repository at this point
Copy the full SHA baa53f6View commit details -
chore: lock packages, rebuild dist
Signed-off-by: Sam Gammon <sam@elide.ventures>
Configuration menu - View commit details
-
Copy full SHA for b004d39 - Browse repository at this point
Copy the full SHA b004d39View commit details -
fixup! amend testsuite to fix combineURLs updates
Signed-off-by: Sam Gammon <sam@elide.ventures>
Configuration menu - View commit details
-
Copy full SHA for ae14db6 - Browse repository at this point
Copy the full SHA ae14db6View commit details -
test: add entrypoint for bun testing
Signed-off-by: Sam Gammon <sam@elide.ventures>
Configuration menu - View commit details
-
Copy full SHA for 3a968e0 - Browse repository at this point
Copy the full SHA 3a968e0View commit details -
chore: shutoff debug logging for release at
1.6.8
Relates to axios#5146 Signed-off-by: Sam Gammon <sam@elide.ventures>
Configuration menu - View commit details
-
Copy full SHA for 41c787c - Browse repository at this point
Copy the full SHA 41c787cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 060f45f - Browse repository at this point
Copy the full SHA 060f45fView commit details -
fixup! disable ci matrix failfast, upgrade bun in ci
Signed-off-by: Sam Gammon <sam@elide.ventures>
Configuration menu - View commit details
-
Copy full SHA for 746a6ef - Browse repository at this point
Copy the full SHA 746a6efView commit details -
chore: add node 21.x to test matrices
Signed-off-by: Sam Gammon <sam@elide.ventures>
Configuration menu - View commit details
-
Copy full SHA for ca8ac8d - Browse repository at this point
Copy the full SHA ca8ac8dView commit details -
Signed-off-by: Sam Gammon <sam@elide.ventures>
Configuration menu - View commit details
-
Copy full SHA for cde5fd8 - Browse repository at this point
Copy the full SHA cde5fd8View commit details -
fixup! browser fetch mock polyfill
Signed-off-by: Sam Gammon <sam@elide.ventures>
Configuration menu - View commit details
-
Copy full SHA for 7b83ff9 - Browse repository at this point
Copy the full SHA 7b83ff9View commit details