@tanstack/solid-query 5.30.5 → 5.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dev.cjs +5 -1
- package/build/dev.js +5 -1
- package/build/index.cjs +5 -1
- package/build/index.js +5 -1
- package/package.json +2 -2
- package/src/createBaseQuery.ts +4 -1
package/build/dev.cjs
CHANGED
|
@@ -78,6 +78,8 @@ function reconcileFn(store$1, result, reconcileOption, queryHash) {
|
|
|
78
78
|
return { ...result, data: newData };
|
|
79
79
|
}
|
|
80
80
|
var hydratableObserverResult = (query, result) => {
|
|
81
|
+
if (!web.isServer)
|
|
82
|
+
return result;
|
|
81
83
|
const obj = {
|
|
82
84
|
...store.unwrap(result),
|
|
83
85
|
// During SSR, functions cannot be serialized, so we need to remove them
|
|
@@ -194,7 +196,9 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
194
196
|
}
|
|
195
197
|
if (!observerResult.isLoading) {
|
|
196
198
|
resolver = null;
|
|
197
|
-
return resolve(
|
|
199
|
+
return resolve(
|
|
200
|
+
hydratableObserverResult(obs.getCurrentQuery(), observerResult)
|
|
201
|
+
);
|
|
198
202
|
}
|
|
199
203
|
setStateWithReconciliation(observerResult);
|
|
200
204
|
});
|
package/build/dev.js
CHANGED
|
@@ -77,6 +77,8 @@ function reconcileFn(store, result, reconcileOption, queryHash) {
|
|
|
77
77
|
return { ...result, data: newData };
|
|
78
78
|
}
|
|
79
79
|
var hydratableObserverResult = (query, result) => {
|
|
80
|
+
if (!isServer)
|
|
81
|
+
return result;
|
|
80
82
|
const obj = {
|
|
81
83
|
...unwrap(result),
|
|
82
84
|
// During SSR, functions cannot be serialized, so we need to remove them
|
|
@@ -193,7 +195,9 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
193
195
|
}
|
|
194
196
|
if (!observerResult.isLoading) {
|
|
195
197
|
resolver = null;
|
|
196
|
-
return resolve(
|
|
198
|
+
return resolve(
|
|
199
|
+
hydratableObserverResult(obs.getCurrentQuery(), observerResult)
|
|
200
|
+
);
|
|
197
201
|
}
|
|
198
202
|
setStateWithReconciliation(observerResult);
|
|
199
203
|
});
|
package/build/index.cjs
CHANGED
|
@@ -69,6 +69,8 @@ function reconcileFn(store$1, result, reconcileOption, queryHash) {
|
|
|
69
69
|
return { ...result, data: newData };
|
|
70
70
|
}
|
|
71
71
|
var hydratableObserverResult = (query, result) => {
|
|
72
|
+
if (!web.isServer)
|
|
73
|
+
return result;
|
|
72
74
|
const obj = {
|
|
73
75
|
...store.unwrap(result),
|
|
74
76
|
// During SSR, functions cannot be serialized, so we need to remove them
|
|
@@ -185,7 +187,9 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
185
187
|
}
|
|
186
188
|
if (!observerResult.isLoading) {
|
|
187
189
|
resolver = null;
|
|
188
|
-
return resolve(
|
|
190
|
+
return resolve(
|
|
191
|
+
hydratableObserverResult(obs.getCurrentQuery(), observerResult)
|
|
192
|
+
);
|
|
189
193
|
}
|
|
190
194
|
setStateWithReconciliation(observerResult);
|
|
191
195
|
});
|
package/build/index.js
CHANGED
|
@@ -68,6 +68,8 @@ function reconcileFn(store, result, reconcileOption, queryHash) {
|
|
|
68
68
|
return { ...result, data: newData };
|
|
69
69
|
}
|
|
70
70
|
var hydratableObserverResult = (query, result) => {
|
|
71
|
+
if (!isServer)
|
|
72
|
+
return result;
|
|
71
73
|
const obj = {
|
|
72
74
|
...unwrap(result),
|
|
73
75
|
// During SSR, functions cannot be serialized, so we need to remove them
|
|
@@ -184,7 +186,9 @@ function createBaseQuery(options, Observer, queryClient) {
|
|
|
184
186
|
}
|
|
185
187
|
if (!observerResult.isLoading) {
|
|
186
188
|
resolver = null;
|
|
187
|
-
return resolve(
|
|
189
|
+
return resolve(
|
|
190
|
+
hydratableObserverResult(obs.getCurrentQuery(), observerResult)
|
|
191
|
+
);
|
|
188
192
|
}
|
|
189
193
|
setStateWithReconciliation(observerResult);
|
|
190
194
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/solid-query",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.31.0",
|
|
4
4
|
"description": "Primitives for managing, caching and syncing asynchronous and remote data in Solid",
|
|
5
5
|
"author": "tannerlinsley",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"solid-js": "^1.8.14",
|
|
48
|
-
"@tanstack/query-core": "5.
|
|
48
|
+
"@tanstack/query-core": "5.31.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"tsup-preset-solid": "^2.2.0",
|
package/src/createBaseQuery.ts
CHANGED
|
@@ -74,6 +74,7 @@ const hydratableObserverResult = <
|
|
|
74
74
|
query: Query<TQueryFnData, TError, TData, TQueryKey>,
|
|
75
75
|
result: QueryObserverResult<TDataHydratable, TError>,
|
|
76
76
|
) => {
|
|
77
|
+
if (!isServer) return result
|
|
77
78
|
const obj: any = {
|
|
78
79
|
...unwrap(result),
|
|
79
80
|
// During SSR, functions cannot be serialized, so we need to remove them
|
|
@@ -255,7 +256,9 @@ export function createBaseQuery<
|
|
|
255
256
|
}
|
|
256
257
|
if (!observerResult.isLoading) {
|
|
257
258
|
resolver = null
|
|
258
|
-
return resolve(
|
|
259
|
+
return resolve(
|
|
260
|
+
hydratableObserverResult(obs.getCurrentQuery(), observerResult),
|
|
261
|
+
)
|
|
259
262
|
}
|
|
260
263
|
|
|
261
264
|
setStateWithReconciliation(observerResult)
|