Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
siddhsuresh committed Oct 26, 2024
1 parent ff95925 commit e46f059
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/blitz-auth/src/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export interface UseSessionOptions {
}

export const useSession = (options: UseSessionOptions = {}): ClientSession => {
const suspense = options?.suspense ?? Boolean(globalThis.__BLITZ_SUSPENSE_ENABLED)
const suspense = options?.suspense ?? true

let initialState: ClientSession
if (options.initialPublicData) {
Expand Down
1 change: 0 additions & 1 deletion packages/blitz-auth/src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ import type {SessionConfigMethods} from "./shared"
declare global {
var sessionConfig: AuthPluginOptions & SessionConfigMethods
var __BLITZ_SESSION_COOKIE_PREFIX: string | undefined
var __BLITZ_SUSPENSE_ENABLED: boolean
var __BLITZ_GET_RSC_CONTEXT: () => Promise<Ctx>
}
4 changes: 2 additions & 2 deletions packages/blitz-rpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
"supports-color": "8.1.1"
},
"peerDependencies": {
"@tanstack/query-core": "4.24.4",
"@tanstack/query-core": "5.51.1",
"blitz": "2.1.3",
"next": "*",
"react": "*"
},
"devDependencies": {
"@blitzjs/auth": "2.1.3",
"@blitzjs/config": "2.1.3",
"@tanstack/query-core": "4.24.4",
"@tanstack/query-core": "5.51.1",
"@types/debug": "4.1.7",
"@types/react": "18.0.25",
"@types/react-dom": "17.0.14",
Expand Down
1 change: 0 additions & 1 deletion packages/blitz-rpc/src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type {Ctx} from "blitz"

declare global {
var queryClient: QueryClient
var __BLITZ_SUSPENSE_ENABLED: boolean
var blitzRpcRpcLoggerOptions: RpcLoggerOptions | undefined
var __BLITZ_GET_RSC_CONTEXT: () => Promise<Ctx>
}
7 changes: 1 addition & 6 deletions packages/blitz-rpc/src/query/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ type MutateOptions = {
}

export const initializeQueryClient = () => {
let suspenseEnabled = true
if (!process.env.CLI_COMMAND_CONSOLE && !process.env.CLI_COMMAND_DB) {
suspenseEnabled = Boolean(globalThis.__BLITZ_SUSPENSE_ENABLED)
}

return new QueryClient({
defaultOptions: {
queries: {
Expand All @@ -54,7 +49,7 @@ export const initializeQueryClient = () => {
}

// Query client is initialised in `BlitzRpcPlugin`, and can only be used with BlitzRpcPlugin right now
export const getQueryClient = () => globalThis.queryClient
export const getQueryClient = () => globalThis.queryClient as QueryClient

function isRpcClient(f: any): f is RpcClient<any, any> {
return !!f._isRpcClient
Expand Down
12 changes: 2 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e46f059

Please sign in to comment.