-
-
Notifications
You must be signed in to change notification settings - Fork 914
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(http): onFetchRequest #2048
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 6dbe040 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
b8871cc
to
b8fe3e4
Compare
fetchOptions?: Omit<RequestInit, 'body'> | undefined | ||
// A callback to handle the response. | ||
/** A callback to handle the request. */ | ||
onRequest?: ((request: Request) => Promise<void> | void) | undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be more useful to type with input
and init
instead.
(input: string | Request | URL, init?: RequestInit | undefined) => Promise<void> | void
size-limit report 📦
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2048 +/- ##
==========================================
- Coverage 92.65% 92.65% -0.01%
==========================================
Files 568 568
Lines 49472 49479 +7
Branches 1900 1899 -1
==========================================
+ Hits 45840 45845 +5
- Misses 3589 3591 +2
Partials 43 43 ☔ View full report in Codecov by Sentry. |
PR-Codex overview
This PR enhances the
http
transport inviem
by adding anonFetchRequest
callback.Detailed summary
onFetchRequest
callback tohttp
transport for handling fetch requests.http
function to includeonFetchRequest
andonFetchResponse
options.HttpRpcClientOptions
withonRequest
andonResponse
callbacks.onFetchRequest
andonRequest
handling in various test cases.getHttpRpcClient
function to utilizeonRequest
callback for request handling.