@nkzw/fate-indexeddb 2.0.1 → 2.2.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/README.md +36 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -759,6 +759,29 @@ fate.hydrate(loaderData.fate, { merge: 'replace' });
|
|
|
759
759
|
|
|
760
760
|
Snapshots from different hydration scopes cannot be combined. Keep each user's server client and snapshot separate.
|
|
761
761
|
|
|
762
|
+
#### Selective Hydration in React
|
|
763
|
+
|
|
764
|
+
If your server-rendered app uses Suspense boundaries that can hydrate at different times, pass the original snapshot to the React provider as well:
|
|
765
|
+
|
|
766
|
+
```tsx
|
|
767
|
+
const state = loaderData.fate;
|
|
768
|
+
const fate = createFateClient();
|
|
769
|
+
fate.hydrate(state);
|
|
770
|
+
|
|
771
|
+
hydrateRoot(
|
|
772
|
+
document,
|
|
773
|
+
<FateClient client={fate} hydrationState={state}>
|
|
774
|
+
<App />
|
|
775
|
+
</FateClient>,
|
|
776
|
+
);
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
If the live cache changes before a boundary hydrates, that boundary first reads the original snapshot to match its server HTML. Once it hydrates, it reads the live cache and applies any changes. Request policies that fetch from the network resume after the component hydrates.
|
|
780
|
+
|
|
781
|
+
Keep the same snapshot on the provider for the lifetime of the hydrated tree. The provider retains a separate copy of the server cache so delayed boundaries can still read it. This works with preloaded SSR data that covers the rendered content.
|
|
782
|
+
|
|
783
|
+
The snapshot applies to the React request and view hooks. If you pass an explicit client to a view hook, an enclosing provider for that client supplies its snapshot. Direct reads from the client or its store still read the live cache.
|
|
784
|
+
|
|
762
785
|
### Observing Request State
|
|
763
786
|
|
|
764
787
|
Outside React or Vue components, `fate.observeRequest(request, options)` provides request state through `getSnapshot()` and `subscribe(listener)`:
|
|
@@ -3174,7 +3197,19 @@ export const fate = createDrizzleFate<AppContext, typeof procedure>({
|
|
|
3174
3197
|
});
|
|
3175
3198
|
```
|
|
3176
3199
|
|
|
3177
|
-
The Drizzle adapter loads the selected fields and relations for you.
|
|
3200
|
+
The Drizzle adapter loads the selected fields and relations for you. By default,
|
|
3201
|
+
nested pagination queries each parent separately. On databases that support
|
|
3202
|
+
window functions, set `nestedPaginationBatching: true` to group parents into
|
|
3203
|
+
window queries, including cursor-based and many-to-many pages. Each query
|
|
3204
|
+
returns at most the requested page size plus one row per parent. Large parent
|
|
3205
|
+
sets are split into bounded batches.
|
|
3206
|
+
|
|
3207
|
+
Independent sibling relations load concurrently. Nested hydration shares a limit
|
|
3208
|
+
of 10 active database queries across sibling and recursive relations in each
|
|
3209
|
+
source fetch; set `nestedPaginationConcurrency` to match your database pool. Query slots are released
|
|
3210
|
+
before recursively hydrating children.
|
|
3211
|
+
|
|
3212
|
+
Both paths preserve the same ordering, cursors, and page metadata.
|
|
3178
3213
|
|
|
3179
3214
|
Count filters can use equality objects or Drizzle predicates such as `(columns) => eq(columns.status, 'GOING')`.
|
|
3180
3215
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nkzw/fate-indexeddb",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Optional IndexedDB persistence adapter for fate.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"idb": "^8.0.4"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@nkzw/fate": "2.0
|
|
22
|
+
"@nkzw/fate": "2.2.0",
|
|
23
23
|
"fake-indexeddb": "^6.2.8",
|
|
24
24
|
"vite": "npm:@voidzero-dev/vite-plus-core@1.6.0",
|
|
25
25
|
"vite-plus": "1.6.0"
|