Skip to content

Commit 113b2c9

Browse files
committed
docs: Various updates
1 parent d521830 commit 113b2c9

File tree

9 files changed

+171
-85
lines changed

9 files changed

+171
-85
lines changed

docs/core/api/Manager.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,5 +357,6 @@ export default class CustomSubsManager implements Manager {
357357
By `return Promise.resolve();` instead of calling `next(action)`, we prevent managers listed
358358
after this one from seeing that [action](./Actions.md).
359359

360-
Types: `FETCH`, `SET`, `SET_RESPONSE`, `RESET`, `SUBSCRIBE`,
361-
`UNSUBSCRIBE`, `INVALIDATE`, `INVALIDATEALL`, `EXPIREALL`
360+
Types: [`FETCH`](./Actions.md#fetch), [`SET`](./Actions.md#set), [`SET_RESPONSE`](./Actions.md#set_response),
361+
[`RESET`](./Actions.md#reset), [`SUBSCRIBE`](./Actions.md#subscribe), [`UNSUBSCRIBE`](./Actions.md#unsubscribe),
362+
[`INVALIDATE`](./Actions.md#invalidate), [`INVALIDATEALL`](./Actions.md#invalidateall), [`EXPIREALL`](./Actions.md#expireall)

docs/core/api/NetworkManager.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ it is able to dedupe identical requests if they are made using the throttle flag
1414

1515
:::
1616

17+
## Lifecycle
18+
19+
### Success
20+
21+
import SuccessLifecycle from '../../rest/diagrams/\_endpoint_success_lifecycle.mdx';
22+
23+
<SuccessLifecycle/>
24+
25+
### Error
26+
27+
import ErrorLifecycle from '../../rest/diagrams/\_endpoint_error_lifecycle.mdx';
28+
29+
<ErrorLifecycle/>
30+
1731
## Members
1832

1933
### constructor(\{ dataExpiryLength = 60000, errorExpiryLength = 1000 }) {#constructor}

docs/rest/api/Collection.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,16 +408,16 @@ This is used by these creation schemas to determine which collections to add to.
408408
Default:
409409

410410
```ts
411-
const defaultFilter =
412-
(urlParams: Record<string, any>, body?: Record<string, any>) =>
413-
(collectionKey: Record<string, string>) =>
411+
createCollectionFilter(...args: Args) {
412+
return (collectionKey: Record<string, string>) =>
414413
Object.entries(collectionKey).every(
415414
([key, value]) =>
416-
key.startsWith('order') ||
417-
// double equals lets us compare non-strings and strings
418-
urlParams[key] == value ||
419-
body?.[key] == value,
415+
this.nonFilterArgumentKeys(key) ||
416+
// strings are canonical form. See pk() above for value transformation
417+
`${args[0][key]}` === value ||
418+
`${args[1]?.[key]}` === value,
420419
);
420+
}
421421
```
422422

423423
## Methods

docs/rest/diagrams/_endpoint_error_lifecycle.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,26 @@ flowchart LR
88
subgraph managers
99
NetworkManager-->endpoint("endpoint(...args)")
1010
endpoint--rejects-->Controller.resolve
11-
Controller.resolve("Controller.resolve(error)")-->dispatchR("dispatch(SET)")
11+
Controller.resolve("Controller.resolve(error)")-->dispatchR("dispatch(SET_RESPONSE)")
1212
end
1313
managers--FETCH-->reducer:FETCH
1414
Controller.fetch--FETCH-->managers
1515
subgraph reducer:FETCH
16-
optimistic("Endpoint.?getOptimisticResponse()")-->SET
17-
subgraph SET
16+
optimistic("Endpoint.?getOptimisticResponse()")-->SET_RESPONSE
17+
subgraph SET_RESPONSE
1818
normalize(normalize)-->update("Endpoint.update()")
1919
end
2020
end
2121
subgraph reducer:reduceError
2222
direction LR
2323
filterOptimistic(filterOptimistic)-->errorPolicy("Endpoint.errorPolicy()")
2424
end
25-
managers--SET:error-->reducer:reduceError
25+
managers--SET_RESPONSE:error-->reducer:reduceError
2626
click key "/rest/api/Endpoint#key"
2727
click optimistic "/rest/api/Endpoint#getoptimisticresponse"
2828
click update "/rest/api/Endpoint#update"
2929
click errorPolicy "/rest/api/Endpoint#errorpolicy"
3030
click NetworkManager "/docs/api/NetworkManager"
31+
click dispatch "/docs/api/Actions#fetch"
32+
click dispatchR "/docs/api/Actions#set_response"
3133
```

docs/rest/diagrams/_endpoint_success_lifecycle.mdx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,26 @@ flowchart LR
88
subgraph managers
99
NetworkManager-->endpoint("endpoint(...args)")
1010
endpoint--resolves-->Controller.resolve
11-
Controller.resolve("Controller.resolve(response)")-->dispatchR("dispatch(SET)")
11+
Controller.resolve("Controller.resolve(response)")-->dispatchR("dispatch(SET_RESPONSE)")
1212
end
1313
managers--FETCH-->reducer:FETCH
1414
Controller.fetch--FETCH-->managers
1515
subgraph reducer:FETCH
16-
optimistic("Endpoint.?getOptimisticResponse()")-->SET
17-
subgraph SET
16+
optimistic("Endpoint.?getOptimisticResponse()")-->SET_RESPONSE
17+
subgraph SET_RESPONSE
1818
normalize(normalize)-->update("Endpoint.update()")
1919
end
2020
end
21-
subgraph reducer:SET
21+
subgraph reducer:SET_RESPONSE
2222
direction LR
2323
normalize2(normalize)-->update2("Endpoint.update()")
2424
end
25-
managers--SET-->reducer:SET
25+
managers--SET_RESPONSE-->reducer:SET_RESPONSE
2626
click key "/rest/api/Endpoint#key"
2727
click NetworkManager "/docs/api/NetworkManager"
2828
click optimistic "/rest/api/Endpoint#getoptimisticresponse"
2929
click update "/rest/api/Endpoint#update"
3030
click update2 "/rest/api/Endpoint#update"
31+
click dispatch "/docs/api/Actions#fetch"
32+
click dispatchR "/docs/api/Actions#set_response"
3133
```

packages/core/CHANGELOG.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
- [#3141](https://github.com/reactive/data-client/pull/3141) [`d225595`](https://github.com/reactive/data-client/commit/d2255959489b71cfdfcaf4be72fd272231d392f1) Thanks [@ntucker](https://github.com/ntucker)! - BREAKING CHANGE: setResponseAction.payload -> setResponseAction.response
184184

185185
This only affects those writing custom [Managers](https://dataclient.io/docs/concepts/managers) that
186-
inspect `SET_RESPONSE_TYPE` `action.payload`.
186+
handle [SET_RESPONSE](/docs/api/Actions#set_response).
187187

188188
#### Before
189189

@@ -276,7 +276,7 @@
276276
- [#3141](https://github.com/reactive/data-client/pull/3141) [`d225595`](https://github.com/reactive/data-client/commit/d2255959489b71cfdfcaf4be72fd272231d392f1) Thanks [@ntucker](https://github.com/ntucker)! - BREAKING CHANGE: remove fetchAction.payload
277277

278278
This only affects those writing custom [Managers](https://dataclient.io/docs/concepts/managers) that
279-
inspect `FETCH_TYPE` `action.fetch`.
279+
handle [FETCH](/docs/api/Actions#fetch).
280280

281281
#### Before
282282

@@ -292,7 +292,7 @@
292292
switch (action.type) {
293293
case FETCH_TYPE:
294294
// consume fetch, and print the resolution
295-
action.fetch().then(response => console.log(response));
295+
action.payload().then(response => console.log(response));
296296
default:
297297
return next(action);
298298
}
@@ -318,7 +318,6 @@
318318
// consume fetch, and print the resolution
319319
action
320320
.endpoint(...action.meta.args)
321-
.fetch()
322321
.then(response => console.log(response));
323322
default:
324323
return next(action);

packages/react/CHANGELOG.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@
294294
- [#3141](https://github.com/reactive/data-client/pull/3141) [`d225595`](https://github.com/reactive/data-client/commit/d2255959489b71cfdfcaf4be72fd272231d392f1) Thanks [@ntucker](https://github.com/ntucker)! - BREAKING CHANGE: setResponseAction.payload -> setResponseAction.response
295295

296296
This only affects those writing custom [Managers](https://dataclient.io/docs/concepts/managers) that
297-
inspect `SET_RESPONSE_TYPE` `action.payload`.
297+
handle [SET_RESPONSE](/docs/api/Actions#set_response).
298298

299299
#### Before
300300

@@ -386,7 +386,7 @@
386386
- [#3141](https://github.com/reactive/data-client/pull/3141) [`d225595`](https://github.com/reactive/data-client/commit/d2255959489b71cfdfcaf4be72fd272231d392f1) Thanks [@ntucker](https://github.com/ntucker)! - BREAKING CHANGE: remove fetchAction.payload
387387

388388
This only affects those writing custom [Managers](https://dataclient.io/docs/concepts/managers) that
389-
inspect `FETCH_TYPE` `action.fetch`.
389+
handle [FETCH](/docs/api/Actions#fetch).
390390

391391
#### Before
392392

@@ -402,7 +402,7 @@
402402
switch (action.type) {
403403
case FETCH_TYPE:
404404
// consume fetch, and print the resolution
405-
action.fetch().then(response => console.log(response));
405+
action.payload().then(response => console.log(response));
406406
default:
407407
return next(action);
408408
}
@@ -428,7 +428,6 @@
428428
// consume fetch, and print the resolution
429429
action
430430
.endpoint(...action.meta.args)
431-
.fetch()
432431
.then(response => console.log(response));
433432
default:
434433
return next(action);

website/blog/2024-06-17-v0.13-nextjs-app-router-expogo-native.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 'v0.13: NextJS App Router, ExpoGo, React Native, Redux'
2+
title: 'v0.13: NextJS App Router, ExpoGo, React 19, Redux'
33
description: Support for NextJS App Router and React 19, while improving comaptibility with React Native and ExpoGo
44
authors: [ntucker]
55
tags: [releases, nextjs, expogo, native]
@@ -12,14 +12,14 @@ import useBaseUrl from '@docusaurus/useBaseUrl';
1212
Platforms:
1313
- NextJS App Router
1414
- ExpoGo
15+
- React 19
1516

1617
Packages moved inside:
1718
- Redux
1819
- Hooks
1920

2021
**Other Improvements**
2122

22-
- React 19 support
2323
- Added [controller.set(Todo, \{ id }, \{ id, completed: false })](/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#controllerset)
2424
- RestEndpoint.path [supports +, * and \{}](/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#path-strings)
2525
- Fixed [controller.fetch() return value for Unions](/blog/2024/06/17/v0.13-nextjs-app-router-expogo-native#ctrlfetch-and-unions)

0 commit comments

Comments
 (0)