fix(clerk-js): Restore internal queryClient for backward compat with older SDKs#8562
Conversation
🦋 Changeset detectedLatest commit: d328a48 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughThis PR restores a backward-compatible internal React Query client on Clerk via a new lazy-loading getter Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
…ent shim - Use void to discard getter expressions in tests (no-unused-expressions) - Add patch changeset for @clerk/clerk-js - Bump clerk.js (543->549KB) and clerk.no-rhc.js (311->316KB) for the query-core dynamic-import infrastructure re-added by the shim
Description
clerk-js@6.11.0removedclerk.__internal_queryClientas part of #8434, which moved QueryClient ownership into@clerk/shared. However, apps still on@clerk/shared < 4.10.0rely on that getter to initialize TanStack Query. Withclerk-jsauto-updating from the CDN, those apps started seeinguseOrganizationListanduseOrganizationreturn empty data with no network request.This PR restores the getter as a backward compat shim:
@tanstack/query-coreas a lazy dynamic import (same pattern as before refactor(shared,clerk-js,react): move QueryClient ownership into @clerk/shared #8434)queryCoreVendorchunk split so it stays a separate ~11KB chunk__internal_queryClientis accessed, which new@clerk/shared(4.10.0+) never does, so there is zero runtime cost for updated usersBehavior
@clerk/shared >= 4.10.0): no change, getter is never accessed, chunk is never fetched@clerk/shared < 4.10.0): getter works again, queries fire, data loadsTest plan
undefinedstate, post-resolve shape, instance stability, andqueryClientStatusevent emission@clerk/clerk-jstest suite passes (722 tests)Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change