@relyio/sdk 0.8.0 → 0.10.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/CHANGELOG.md +52 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/{chunk-72UK5U7T.cjs → chunk-2HP566NI.cjs} +10 -2
- package/dist/{chunk-QFHVF3YF.js → chunk-2L5JUW7O.js} +65 -21
- package/dist/{chunk-XIE7WJV3.cjs → chunk-DC4QLAI3.cjs} +65 -20
- package/dist/{chunk-YEJUMW4X.js → chunk-IGHYC2WM.js} +10 -2
- package/dist/client/index.cjs +3 -3
- package/dist/client/index.d.cts +4 -4
- package/dist/client/index.d.ts +4 -4
- package/dist/client/index.js +1 -1
- package/dist/{define-content-type-cEGjIwT5.d.cts → define-content-type-DfnTu26S.d.cts} +78 -2
- package/dist/{define-content-type-cEGjIwT5.d.ts → define-content-type-DfnTu26S.d.ts} +78 -2
- package/dist/{define-schema-DgbJ5Kwn.d.cts → define-schema-W-0u1Jg1.d.cts} +13 -20
- package/dist/{define-schema-BPj2srgh.d.ts → define-schema-rbTrXxNN.d.ts} +13 -20
- package/dist/{index-Cv4tmcrw.d.ts → index-B9hDmCho.d.ts} +1 -1
- package/dist/{index-DBoPPlT1.d.cts → index-KuYgc7eG.d.cts} +80 -14
- package/dist/{index-B_rIWO_l.d.cts → index-NnLCwSqF.d.cts} +1 -1
- package/dist/{index-yRJ2IqM_.d.ts → index-rLEBSFvK.d.ts} +80 -14
- package/dist/index.cjs +85 -81
- package/dist/index.d.cts +12 -11
- package/dist/index.d.ts +12 -11
- package/dist/index.js +3 -3
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +3 -3
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.js +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# @relyio/sdk
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d147cb3: **A view's filters are a flat list.** `defineView`'s `filters` take `{ field, operator, value }` filters, joined by AND — the Filters the Studio's entry list takes, each shown as a chip. The group form, an `operator` with `conditions`, is gone: `ViewFilterGroup` is no longer exported, `ViewFilter` is one filter, and `defineView` throws, naming the view and the filter, if you pass a group from JavaScript. For an OR within one field, use `isAnyOf`:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
defineView('newsAndSport', {
|
|
11
|
+
name: 'News and sport',
|
|
12
|
+
scope: { type: 'contentType', contentType: 'post' },
|
|
13
|
+
filters: [
|
|
14
|
+
{ field: 'category', operator: 'isAnyOf', value: ['news', 'sport'] },
|
|
15
|
+
{ field: 'featured', operator: 'is', value: true },
|
|
16
|
+
],
|
|
17
|
+
})
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
A YAML schema's `views[].filters` are the same list, and `relyio validate` and `relyio deploy` refuse a filter group by name, at `views.<n>.filters.<n>`.
|
|
21
|
+
|
|
22
|
+
**Deploy now checks each view filter against the entries it narrows.** The field must be one the view's entries can be filtered by, and must offer the operator and take the value — so a boolean field takes `is` with `true` or `false`, not `isTrue`, and a tags field is not filtered with `includes`. A filter that does not fit is refused by name at `views.<n>.filters.<n>.field`, `.operator` or `.value`. `relyio status` refuses it too. `relyio validate` checks a view filter's shape, not this: run `relyio status` to see what deploy will say.
|
|
23
|
+
|
|
24
|
+
## 0.9.0
|
|
25
|
+
|
|
26
|
+
### Minor Changes
|
|
27
|
+
|
|
28
|
+
- 187624c: **`<RelyIOProvider live>` no longer misses a publish that lands while the page is loading.** The provider used to send its reads first and open the feed afterwards, from the feed's position at that moment — so anything published in between was in neither, and the page showed the old content until that entry changed again. With `live` on, the reads beneath the provider now wait until the feed has opened and sent its position — the first thing it sends, so there is no extra request and the edge counts your visitor once — and then go; anything published after that position is announced and refetched like any other change. The same holds after a connection that failed before it had a position: everything is refetched once the new one has sent its position. If the feed fails before it has one — it is down, or refuses the key — the reads are sent without it, so content never waits on a feed that is down. A server render is unchanged: its reads never wait. Nothing to change in your code, but `@relyio/react` now needs `@relyio/sdk` 0.9.0 or later, the release that carries this.
|
|
29
|
+
|
|
30
|
+
**A socket that neither opens nor fails is given up after fifteen seconds.** `liveChanges()` used to wait on such a socket — a network that holds the upgrade without refusing it — for as long as the page was open. It now closes a socket that has not opened and been told its position within `LIVE_SOCKET_OPEN_TIMEOUT_MS` (the poll interval, fifteen seconds; newly exported) and polls the edge from the same cursor instead, as it does for a socket that fails to open. That also bounds how long the provider's first reads wait.
|
|
31
|
+
|
|
32
|
+
**Read after the feed's position, with no request of your own for it.** Opened without `since`, `liveChanges()` and `changes()` hand the position they start from to `reached` before anything after it — the edge's `feed.opened` or first poll's answer; `/v1/changes`' first answer. `ChangesOptions` gains `reached` for this; `changes()` calls it once, with that head, and never with a later page's cursor — so `followChanges()` over `changes()` now reopens from that head after a failure before the first change, rather than refetching everything. Read what you show after that call, and a publish your read did not see is announced. With `followChanges()`, which hands the source its own `reached`, call both:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
let positioned!: () => void
|
|
36
|
+
const position = new Promise<void>(resolve => (positioned = resolve))
|
|
37
|
+
const following = followChanges(
|
|
38
|
+
from =>
|
|
39
|
+
relyio.liveChanges({
|
|
40
|
+
...from,
|
|
41
|
+
ids: [id],
|
|
42
|
+
reached: cursor => {
|
|
43
|
+
from.reached(cursor)
|
|
44
|
+
positioned()
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
{ signal, onChange, onResync, onState: state => state.kind !== 'following' && positioned() },
|
|
48
|
+
)
|
|
49
|
+
await position
|
|
50
|
+
const post = await relyio.content('post').findById(id).execute()
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`changesHead()` still takes the position with a request of its own, for a feed you open later.
|
|
54
|
+
|
|
3
55
|
## 0.8.0
|
|
4
56
|
|
|
5
57
|
### Minor Changes
|