fix: raise TanStack Query and Pinia Colada peer dependency floors - #2180
Merged
Merged
Conversation
@tanstack/query-core only passes the second context argument to mutationFn starting in 5.89.0 (5.87.4 and earlier call mutationFn(variables)), so mutation interceptors received fnContext === undefined on 5.80.2-5.87.4 and the documented fnContext.client usage threw. MutationFunctionContext is also first exported in 5.89.0. @pinia/colada first exports DefineInfiniteQueryOptions, DefineInfiniteQueryOptionsTagged and DefineMutationOptionsTagged in 1.2.0; on 1.0/1.1 those imports fail and the option types collapse to any.
More templates
@orpc/ai-sdk
@orpc/arktype
@orpc/bun
@orpc/client
@orpc/cloudflare
@orpc/contract
@orpc/experimental-effect
@orpc/evlog
@orpc/hibernation
@orpc/json-schema
@orpc/experimental-lock
@orpc/experimental-msw
@orpc/nest
@orpc/next
@orpc/node
@orpc/openapi
@orpc/opentelemetry
@orpc/pinia-colada
@orpc/pino
@orpc/publisher
@orpc/ratelimit
@orpc/server
@orpc/shared
@orpc/swr
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/zod
commit: |
Contributor
Contributor
There was a problem hiding this comment.
Reviewed changes
Raised two peer dependency floors; verified both against the published upstream packages.
@orpc/tanstack-query—@tanstack/query-corefloor>=5.80.2→>=5.89.0.5.89.0is the exact first version that passes theMutationFunctionContextsecond argument tomutationFnand exports the type;5.87.4does neither, and no5.88.xwas ever released. The adapter reads thatfnContextat runtime inprocedure-utils.ts.@orpc/pinia-colada—@pinia/coladafloor>=1.0.0→>=1.2.0.1.1.0lacksDefineInfiniteQueryOptions,DefineInfiniteQueryOptionsTagged, andDefineMutationOptionsTagged;1.2.0(the next release) exports all three, whichsrc/types.tsimports.- No
pnpm-lock.yamlupdate is needed (pnpm importers don't record peer ranges), and no docs or in-repo packages reference the old floors — all workspace devDeps/playgrounds already resolve above the new ones.
Both floors are correct and minimal. No issues found.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
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.

@orpc/tanstack-querynow requires@tanstack/query-core >=5.89.0(was>=5.80.2), and@orpc/pinia-coladarequires@pinia/colada >=1.2.0(was>=1.0.0). The old TanStack floor let 5.80.2–5.87.4 install, and on those versions mutation interceptors receivefnContext === undefined, so the documentedfnContext.client.invalidateQueries(...)throws at runtime. Package managers now warn about these setups at install time instead.Fixes
mutationFn(variables). The{ client, meta, mutationKey }context and theMutationFunctionContexttype both first ship in 5.89.0 (there is no 5.88.x). On older versions the "Interceptors" example rejects the mutation even though the server already applied it. The "Contract Options Plugin" example throws before the request is sent.DefineInfiniteQueryOptions,DefineInfiniteQueryOptionsTaggedandDefineMutationOptionsTaggedare first exported in 1.2.0. On 1.0/1.1 theinfiniteOptions()/mutationOptions()types silently becomeanyunderskipLibCheck.>=2.4.2already covers everything it uses.Testing
mutation.tsin every query-core release from 5.80.2 to 5.89.0, bothsrcand publishedbuild. Only 5.89.0 passes the second argument.MutationObserverrepro using the documented interceptor pattern. On 5.87.4 it fails withTypeError: Cannot read properties of undefined (reading 'client'); on 5.89.0 it succeeds.@tanstack/query-coreimport in the package is exported at 5.89.0, and thatQueryFunctionContext.clientalready exists at 5.80.2, so query interceptors were never affected.