@vertz/ui 0.2.33 → 0.2.35
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.
|
@@ -1018,12 +1018,33 @@ function query(source, options = {}) {
|
|
|
1018
1018
|
let ssrHydrated = false;
|
|
1019
1019
|
let navPrefetchDeferred = false;
|
|
1020
1020
|
if (!isSSR() && initialData === undefined) {
|
|
1021
|
-
|
|
1021
|
+
let hydrationKey;
|
|
1022
|
+
const hasSSRData = !!globalThis.__VERTZ_SSR_DATA__;
|
|
1023
|
+
if (customKey) {
|
|
1024
|
+
hydrationKey = customKey;
|
|
1025
|
+
} else if (hasSSRData) {
|
|
1026
|
+
try {
|
|
1027
|
+
const raw = callThunkWithCapture();
|
|
1028
|
+
if (raw !== null) {
|
|
1029
|
+
if (isQueryDescriptor(raw)) {
|
|
1030
|
+
if (raw._entity && !entityMeta) {
|
|
1031
|
+
entityMeta = raw._entity;
|
|
1032
|
+
}
|
|
1033
|
+
} else {
|
|
1034
|
+
raw.catch(() => {});
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
} catch {}
|
|
1038
|
+
hydrationKey = getCacheKey();
|
|
1039
|
+
} else {
|
|
1040
|
+
hydrationKey = baseKey;
|
|
1041
|
+
}
|
|
1022
1042
|
const isNavigation = isNavPrefetchActive();
|
|
1023
1043
|
ssrHydrationCleanup = hydrateQueryFromSSR(hydrationKey, (result) => {
|
|
1024
1044
|
normalizeToEntityStore(result);
|
|
1025
1045
|
rawData.value = result;
|
|
1026
1046
|
loading.value = false;
|
|
1047
|
+
idle.value = false;
|
|
1027
1048
|
cache.set(hydrationKey, result);
|
|
1028
1049
|
ssrHydrated = true;
|
|
1029
1050
|
}, { persistent: isNavigation });
|
|
@@ -1151,6 +1172,18 @@ function query(source, options = {}) {
|
|
|
1151
1172
|
disposeFn = lifecycleEffect(() => {
|
|
1152
1173
|
refetchTrigger.value;
|
|
1153
1174
|
if (isFirst && ssrHydrated) {
|
|
1175
|
+
if (!customKey) {
|
|
1176
|
+
const trackRaw = callThunkWithCapture();
|
|
1177
|
+
if (trackRaw !== null) {
|
|
1178
|
+
if (isQueryDescriptor(trackRaw)) {
|
|
1179
|
+
if (trackRaw._entity && !entityMeta) {
|
|
1180
|
+
entityMeta = trackRaw._entity;
|
|
1181
|
+
}
|
|
1182
|
+
} else {
|
|
1183
|
+
trackRaw.catch(() => {});
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1154
1187
|
isFirst = false;
|
|
1155
1188
|
return;
|
|
1156
1189
|
}
|
package/dist/src/index.js
CHANGED
package/dist/src/internals.js
CHANGED
package/dist/src/query/public.js
CHANGED