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

Draft: Fetch Adapter #1

Draft
wants to merge 77 commits into
base: v1.x
Choose a base branch
from
Draft

Draft: Fetch Adapter #1

wants to merge 77 commits into from

Conversation

sgammon
Copy link
Owner

@sgammon sgammon commented Nov 14, 2022

Filing locally for CI runs.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@sgammon sgammon added enhancement New feature or request dependencies Pull requests that update a dependency file labels Dec 17, 2022
@sgammon sgammon force-pushed the feat/fetch-adapter branch 5 times, most recently from 5e48702 to 0c8e974 Compare December 19, 2022 03:14
@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2022

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@sgammon sgammon force-pushed the feat/fetch-adapter branch 2 times, most recently from f140892 to 2aeff49 Compare December 19, 2022 09:53
Copy link

@accesslint accesslint bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are accessibility issues in these changes.

<div>
<h3>User</h3>
<div class="row">
<img id="useravatar" src="" class="col-md-1"/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This image is missing a text alternative. This is a problem for people using screen readers.

Copy link

@accesslint accesslint bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are accessibility issues in these changes.

<div>
<h3>User</h3>
<div class="row">
<img id="useravatar" src="" class="col-md-1"/>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This image is missing a text alternative. This is a problem for people using screen readers.

sgammon and others added 15 commits April 11, 2024 13:13
This 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.
- 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`
- Mock fetch implementation for testing
- Spawn fetch adapter configs for testing
- Test for expected instance/static props related to fetch adapter
- Add initial browser tests for fetch adapter
- Test for acceptance of `URL`
- 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
- 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`)
- Add basic fetch overhead benchmark
- Add example using new `generic` output
sgammon and others added 29 commits April 11, 2024 14:17
- Tweak treeshaking to be more aggressive on modern platforms
- Move license comment to bottom of output targets
- Structured type for `FetchOptions`
- Better type export for `Fetcher`
- Better type export for `AxiosFetchAdapter`
- Add support for `beforeEach`/`afterEach`
- Add full typings for abstract test types
- Prep to extend abstract test suite to Node
- Skip checking config for handler type if no `responseType` param
  is present
- Only resolve handler from `Content-Type` if header is available
  in response
- Move properties around to avoid stray changes in diffs
- Move `cross-fetch` to optional deps
- Instead of failing, bypass URL parsing, and pass the URL verbatim
  to the underlying fetch implementation
- Move abstract fetch testsuite tests into basic test spec file
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Relates to axios#5146

Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Signed-off-by: Sam Gammon <sam@elide.ventures>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants