@knocklabs/react 0.10.5 → 0.11.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 +48 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,53 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2af3f5e: Initialize feeds in `"compact"` mode by default
|
|
8
|
+
|
|
9
|
+
The feed client can now be initialized with a `mode` option, set to either `"compact"` or `"rich"`. When `mode` is `"compact"`, the following restrictions will apply when the feed is fetched:
|
|
10
|
+
|
|
11
|
+
- The `activities` and `total_activities` fields will _not_ be present on feed items
|
|
12
|
+
- The `data` field will _not_ include nested arrays and objects
|
|
13
|
+
- The `actors` field will only have up to one actor
|
|
14
|
+
|
|
15
|
+
**By default, feeds are initialized in `"compact"` mode. If you need to access `activities`, `total_activities`, the complete `data`, or the complete array of `actors`, you must initialize your feed in `"rich"` mode.**
|
|
16
|
+
|
|
17
|
+
If you are using the feed client via `@knocklabs/client` directly:
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
const knockFeed = knockClient.feeds.initialize(
|
|
21
|
+
process.env.KNOCK_FEED_CHANNEL_ID,
|
|
22
|
+
{ mode: "rich" },
|
|
23
|
+
);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If you are using `<KnockFeedProvider>` via `@knocklabs/react`, `@knocklabs/react-native`, or `@knocklabs/expo`:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
<KnockFeedProvider
|
|
30
|
+
feedId={process.env.KNOCK_FEED_CHANNEL_ID}
|
|
31
|
+
defaultFeedOptions={{ mode: "rich" }}
|
|
32
|
+
/>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
If you are using the `useNotifications` hook via `@knocklabs/react-core`:
|
|
36
|
+
|
|
37
|
+
```js
|
|
38
|
+
const feedClient = useNotifications(
|
|
39
|
+
knockClient,
|
|
40
|
+
process.env.KNOCK_FEED_CHANNEL_ID,
|
|
41
|
+
{ mode: "rich" },
|
|
42
|
+
);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- Updated dependencies [2af3f5e]
|
|
48
|
+
- @knocklabs/client@0.21.0
|
|
49
|
+
- @knocklabs/react-core@0.13.0
|
|
50
|
+
|
|
3
51
|
## 0.10.5
|
|
4
52
|
|
|
5
53
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@knocklabs/react",
|
|
3
3
|
"description": "A set of React components to build notification experiences powered by Knock",
|
|
4
4
|
"author": "@knocklabs",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.11.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
8
8
|
"module": "dist/esm/index.mjs",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@knocklabs/client": "^0.
|
|
76
|
-
"@knocklabs/react-core": "^0.
|
|
75
|
+
"@knocklabs/client": "^0.21.0",
|
|
76
|
+
"@knocklabs/react-core": "^0.13.0",
|
|
77
77
|
"@popperjs/core": "^2.11.8",
|
|
78
78
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
79
79
|
"@telegraph/combobox": "^0.1.16",
|