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

Replace Axios #66

Merged
merged 15 commits into from
Feb 24, 2023
Merged

Replace Axios #66

merged 15 commits into from
Feb 24, 2023

Conversation

ptpaterson
Copy link
Contributor

@ptpaterson ptpaterson commented Feb 22, 2023

Ticket(s): FE-3060

Problem

We need to get rid of Axios, because it does not work in a lot of environments

Solution

Provide an initial implementation that just uses the native fetch API in browsers and Node. Add a custom fetch function to the client configuration that we can later provide various per-environment implementations (e.g. HTTP2 in Node), or that users can also provide.

Result

Driver works with browsers and Node.

Out of scope

  • HTTP2 node implementation
  • Tagged type encoding, but I added // WIP comments where it should be straightforward to drop that in when we're ready.

Testing

Tests updated to reflect new API. Notes:

  • deleted: __tests__/integration/connection-pool.test.ts
  • commented out some tests in __tests__/unit/query.test.ts. We should review and either delete them or determine their analog for the new HTTPClient.

src/client.ts Outdated Show resolved Hide resolved
src/client.ts Outdated Show resolved Hide resolved
src/client.ts Show resolved Hide resolved
src/client.ts Show resolved Hide resolved
src/http-client/fetch-client.ts Show resolved Hide resolved
src/http-client/index.ts Show resolved Hide resolved
src/client.ts Outdated Show resolved Hide resolved
@cleve-fauna cleve-fauna merged commit 14a135d into main Feb 24, 2023
@cleve-fauna cleve-fauna deleted the FE-3060-replace-axios branch February 24, 2023 17:31
This was referenced Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants