@@ -115,66 +115,6 @@ type IsomorphicLoadedClerk = Without<
115
115
apiKeys : APIKeysNamespace | undefined ;
116
116
} ;
117
117
118
- export type RecursiveMock = {
119
- ( ...args : unknown [ ] ) : RecursiveMock ;
120
- } & {
121
- readonly [ key in string | symbol ] : RecursiveMock ;
122
- } ;
123
-
124
- /**
125
- * Creates a recursively self-referential Proxy that safely handles:
126
- * - Arbitrary property access (e.g., obj.any.prop.path)
127
- * - Function calls at any level (e.g., obj.a().b.c())
128
- * - Construction (e.g., new obj.a.b())
129
- *
130
- * Always returns itself to allow infinite chaining without throwing.
131
- */
132
- function createRecursiveProxy ( label : string = 'Mock' ) : RecursiveMock {
133
- // The callable target for the proxy so that `apply` works
134
- const callableTarget = function noop ( ) : void { } ;
135
-
136
- // eslint-disable-next-line prefer-const
137
- let self : RecursiveMock ;
138
- const handler : ProxyHandler < typeof callableTarget > = {
139
- get ( _target , prop ) {
140
- // Avoid being treated as a Promise/thenable by test runners or frameworks
141
- if ( prop === 'then' ) {
142
- return undefined ;
143
- }
144
- if ( prop === 'toString' ) {
145
- return ( ) => `[${ label } ]` ;
146
- }
147
- if ( prop === Symbol . toPrimitive ) {
148
- return ( ) => 0 ;
149
- }
150
- return self ;
151
- } ,
152
- apply ( ) {
153
- return self ;
154
- } ,
155
- construct ( ) {
156
- return self as unknown as object ;
157
- } ,
158
- has ( ) {
159
- return true ;
160
- } ,
161
- set ( ) {
162
- return true ;
163
- } ,
164
- } ;
165
-
166
- self = new Proxy ( callableTarget , handler ) as unknown as RecursiveMock ;
167
- return self ;
168
- }
169
-
170
- /**
171
- * Returns a permissive mock compatible with `QueryClient` usage in tests.
172
- * It accepts any chain of property accesses and calls without throwing.
173
- */
174
- export function createMockQueryClient ( ) : RecursiveMock {
175
- return createRecursiveProxy ( 'MockQueryClient' ) as unknown as RecursiveMock ;
176
- }
177
-
178
118
export class IsomorphicClerk implements IsomorphicLoadedClerk {
179
119
private readonly mode : 'browser' | 'server' ;
180
120
private readonly options : IsomorphicClerkOptions ;
@@ -224,7 +164,6 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk {
224
164
#publishableKey: string ;
225
165
#eventBus = createClerkEventBus ( ) ;
226
166
#stateProxy: StateProxy ;
227
- #__internal_queryClient = createMockQueryClient ( ) ;
228
167
229
168
get publishableKey ( ) : string {
230
169
return this . #publishableKey;
@@ -348,14 +287,7 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk {
348
287
349
288
get __internal_queryClient ( ) {
350
289
// @ts -expect-error - __internal_queryClient is not typed
351
- if ( ! this . clerkjs ?. __internal_queryClient ) {
352
- // @ts -expect-error - __internal_queryClient is not typed
353
- void this . clerkjs ?. getInternalQueryClient ?.( ) ;
354
- this . prefetchQueryClientStatus = true ;
355
- }
356
-
357
- // @ts -expect-error - __internal_queryClient is not typed
358
- return this . clerkjs ?. __internal_queryClient || this . #__internal_queryClient;
290
+ return this . clerkjs ?. __internal_queryClient ;
359
291
}
360
292
361
293
get isSatellite ( ) {
@@ -693,10 +625,10 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk {
693
625
clerkjs . openWaitlist ( this . preOpenWaitlist ) ;
694
626
}
695
627
696
- if ( this . prefetchQueryClientStatus ) {
697
- // @ts -expect-error - queryClientStatus is not typed
698
- this . clerkjs . getInternalQueryClient ?.( ) ;
699
- }
628
+ // if (this.prefetchQueryClientStatus) {
629
+ // // @ts -expect-error - queryClientStatus is not typed
630
+ // this.clerkjs.getInternalQueryClient?.();
631
+ // }
700
632
701
633
this . premountSignInNodes . forEach ( ( props , node ) => {
702
634
clerkjs . mountSignIn ( node , props ) ;
0 commit comments