@ssrx/plugin-tanstack-query
Advanced tools
Comparing version 0.4.0 to 0.5.0
@@ -23,3 +23,2 @@ // src/plugin.tsx | ||
// src/query-client.ts | ||
import { deepmerge } from "@ssrx/renderer"; | ||
import { QueryCache, QueryClient } from "@tanstack/query-core"; | ||
@@ -38,10 +37,3 @@ var createQueryClient = ({ trackedQueries, blockingQueries, clientConfig } = {}) => { | ||
queryCache, | ||
defaultOptions: deepmerge( | ||
{ | ||
queries: { | ||
suspense: true | ||
} | ||
}, | ||
clientConfig?.defaultOptions || {} | ||
) | ||
defaultOptions: clientConfig?.defaultOptions || {} | ||
}); | ||
@@ -85,4 +77,3 @@ if (trackedQueries && import.meta.env.SSR) { | ||
emitToDocumentHead: () => { | ||
if (skipHydration) | ||
return; | ||
if (skipHydration) return; | ||
const html = [`$TQD = [];`, `$TQS = data => $TQD.push(data);`]; | ||
@@ -92,4 +83,3 @@ return `<script>${html.join("")}</script>`; | ||
emitBeforeStreamChunk: async () => { | ||
if (skipHydration) | ||
return; | ||
if (skipHydration) return; | ||
if (blockingQueries.size) { | ||
@@ -99,4 +89,3 @@ await Promise.allSettled(blockingQueries.values()); | ||
} | ||
if (!trackedQueries.size) | ||
return; | ||
if (!trackedQueries.size) return; | ||
const shouldDehydrate = defaultShouldDehydrateQuery; | ||
@@ -109,4 +98,3 @@ const dehydratedState = dehydrate(queryClient, { | ||
trackedQueries.clear(); | ||
if (!dehydratedState.queries.length) | ||
return; | ||
if (!dehydratedState.queries.length) return; | ||
const dehydratedString = JSON.stringify(stringify(dehydratedState)); | ||
@@ -113,0 +101,0 @@ return `<script>${[`$TQS(${dehydratedString})`].join("")}</script>`; |
{ | ||
"name": "@ssrx/plugin-tanstack-query", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"sideEffects": false, | ||
@@ -34,7 +34,7 @@ "type": "module", | ||
"@ssrx/renderer": "^0.4.0", | ||
"devalue": "^4.3.2" | ||
"devalue": "^5.0.0" | ||
}, | ||
"devDependencies": { | ||
"@tanstack/query-core": "^5.18.0" | ||
"@tanstack/query-core": "^5.56.2" | ||
} | ||
} |
@@ -1,2 +0,1 @@ | ||
import { deepmerge } from '@ssrx/renderer'; | ||
import { QueryCache, QueryClient, type QueryClientConfig } from '@tanstack/query-core'; | ||
@@ -27,10 +26,3 @@ | ||
queryCache, | ||
defaultOptions: deepmerge( | ||
{ | ||
queries: { | ||
suspense: true, | ||
}, | ||
}, | ||
clientConfig?.defaultOptions || {}, | ||
), | ||
defaultOptions: clientConfig?.defaultOptions || {}, | ||
}); | ||
@@ -37,0 +29,0 @@ |
Sorry, the diff of this file is not supported yet
19346
265
+ Addeddevalue@5.1.1(transitive)
- Removeddevalue@4.3.3(transitive)
Updateddevalue@^5.0.0