♻️ (chore) [NO-ISSUE]: Replace axios with native fetch API#1334
Draft
mbertin-ledger wants to merge 8 commits intodevelopfrom
Draft
♻️ (chore) [NO-ISSUE]: Replace axios with native fetch API#1334mbertin-ledger wants to merge 8 commits intodevelopfrom
mbertin-ledger wants to merge 8 commits intodevelopfrom
Conversation
…sources Migrate all HTTP data sources from axios to the native fetch API, using URL/URLSearchParams for query params and conditional header spreading for optional origin tokens. Made-with: Cursor
Migrate AxiosManagerApiDataSource from axios.get/post to native fetch, building URLs with URLSearchParams and returning parsed JSON directly from EitherAsync blocks. Made-with: Cursor
Remove axios instance factory and use fetch directly for APDU posting, server availability checks with AbortController timeout, and SSE streaming. Made-with: Cursor
Introduce HttpClient interface replacing AxiosInstance, implement it with native fetch and AbortController-based timeouts in the controller factory. Made-with: Cursor
Replace axios request/response interceptors with globalThis.fetch monkey-patching. Export FetchInterceptor with AxiosInterceptor alias for backwards compatibility. Made-with: Cursor
Migrate all HTTP adapters from axios to fetch, using AbortController for timeouts, response.arrayBuffer() for binary data, and standard Error handling instead of AxiosError. Made-with: Cursor
…talog Remove axios from 6 package.json files and the pnpm-workspace.yaml catalog now that all HTTP calls use the native fetch API. Made-with: Cursor
Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Remove the
axiosdependency from all packages and replace all HTTP calls with the nativefetchAPI.Changes per package:
axios.request()/axios.get()tofetch()withURL/URLSearchParamsfor query paramsAxiosManagerApiDataSource(9 API methods) fromaxios.get()/axios.post()tofetch()withinEitherAsyncblocksaxiosClientFactoryand axios instance with directfetch()calls andAbortControllerfor timeoutsHttpClientinterface replacingAxiosInstance, implemented withfetch()andAbortController-based timeoutsAxiosInterceptorasFetchInterceptorusingglobalThis.fetchmonkey-patching instead of axios interceptors/cancel tokens. Exported backwards-compatibleAxiosInterceptoralias.axiosfrom all 6package.jsonfiles and thepnpm-workspace.yamlcatalog❓ Context
✅ Checklist
globalThis.fetch. 1,592 tests pass across affected packages.fetchinstead ofaxiosFetchInterceptorreplacesAxiosInterceptorin cal-interceptor (backwards-compatible alias provided)HttpClientinterface replacesAxiosInstancein speculos-device-controllerMade with Cursor