You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#4996d49f8 Thanks @JounQin! - Complete redesign from interceptor-based to middleware pipeline.
Breaking Changes
ApiInterceptor → XFetchMiddleware
interceptors → middlewares — use() / eject() API unchanged
ResponseError → XFetchError — use isXFetchError() instead of instanceof for cross-realm safety
createFetchApi / fetchApi → createXFetch / xfetch
cleanNilValues is no longer exported (inlined into normalizeUrl internally). null/undefined query values are still omitted; empty strings are now preserved (matching URLSearchParams behavior).
Middleware signature changed from (req, next) to (ctx, next), where ctx is a mutable context object (method, url, ...). Middleware can override ctx.type (response parsing). JSON body serialization is auto-detected from ctx.body at the fetch leaf — the final context is authoritative.
New Features
next() is optional — defaults to the previous context, enables clean retry: try { await next() } catch { return next() }
Per-request middlewares option: xfetch(url, { middlewares: [...] }), composed as global → per-call → fetch
Cross-realm error detection via Symbol.for('x-fetch') — isXFetchError() works across iframes / workers
Consistent error wrapping: network failures, JSON parse errors, non-ok responses all wrapped as XFetchError
Migration
- import { createFetchApi, fetchApi, ResponseError } from 'x-fetch'+ import { createXFetch, xfetch, isXFetchError } from 'x-fetch'
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer TIP This summary will be updated as you push new changes.
Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.
You can manually request rebase by checking the rebase/retry box above.
⚠️Warning: custom changes will be lost.
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
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.
This PR contains the following updates:
^6.0.3→^7.0.0^0.2.6→^0.3.04.17.0→4.17.1Release Notes
microsoft/TypeScript (typescript)
v7.0.2Compare Source
un-ts/x-fetch (x-fetch)
v0.3.0Compare Source
Minor Changes
96d49f8Thanks @JounQin! - Complete redesign from interceptor-based to middleware pipeline.Breaking Changes
ApiInterceptor→XFetchMiddlewareinterceptors→middlewares—use()/eject()API unchangedResponseError→XFetchError— useisXFetchError()instead ofinstanceoffor cross-realm safetycreateFetchApi/fetchApi→createXFetch/xfetchcleanNilValuesis no longer exported (inlined intonormalizeUrlinternally).null/undefinedquery values are still omitted; empty strings are now preserved (matchingURLSearchParamsbehavior).(req, next)to(ctx, next), wherectxis a mutable context object (method,url, ...). Middleware can overridectx.type(response parsing). JSON body serialization is auto-detected fromctx.bodyat the fetch leaf — the final context is authoritative.New Features
next()is optional — defaults to the previous context, enables clean retry:try { await next() } catch { return next() }middlewaresoption:xfetch(url, { middlewares: [...] }), composed as global → per-call → fetchSymbol.for('x-fetch')—isXFetchError()works across iframes / workersXFetchErrorMigration
Before:
After:
Retry with snapshot:
Error handling:
} catch (error) { - if (error instanceof ResponseError) { ... } + if (isXFetchError(error)) { ... } }Per-request middlewares:
v0.2.7Compare Source
Patch Changes
#45
d4c833dThanks @JounQin! - fix: allownext()to be called multiple times for request retry#48
2e005ceThanks @JounQin! - Makenext()'srequestoptional, defaults to the previous request when omitted.yarnpkg/berry (yarn)
v4.17.1: v4.17.1Compare Source
What's Changed
New Contributors
Full Changelog: https://github.com/yarnpkg/berry/compare/@yarnpkg/cli/4.17.0...@yarnpkg/cli/4.17.1
Configuration
📅 Schedule: (UTC)
* 0-3 1 * *)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.