@liveblocks/react 0.16.5 → 0.16.8
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/index.js +6 -6
- package/index.mjs +6 -6
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -197,15 +197,15 @@ var _create = function() {
|
|
|
197
197
|
},
|
|
198
198
|
useHistory: useHistory,
|
|
199
199
|
useList: function(key, items) {
|
|
200
|
-
internal.deprecateIf(items, 'Support for initializing items in useList() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n import { LiveList } from "@liveblocks/client";\n\n const initialStorage = () => {\n ' + JSON.stringify(key) + ": new LiveList(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.");
|
|
200
|
+
internal.deprecateIf(items, 'Support for initializing items in useList() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n import { LiveList } from "@liveblocks/client";\n\n const initialStorage = () => ({\n ' + JSON.stringify(key) + ": new LiveList(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.");
|
|
201
201
|
var value = useStorageValue(key, new client.LiveList(items));
|
|
202
|
-
return "ok" === value.status ? value.value : (internal.deprecateIf("notfound" === value.status, "Key " + JSON.stringify(key) + ' was not found in Storage. Starting with 0.18, useList() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveList } from "@liveblocks/client";\n\n const initialStorage = () => {\n ' + JSON.stringify(key) + ": new LiveList(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details."),
|
|
202
|
+
return "ok" === value.status ? value.value : (internal.deprecateIf("notfound" === value.status, "Key " + JSON.stringify(key) + ' was not found in Storage. Starting with 0.18, useList() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveList } from "@liveblocks/client";\n\n const initialStorage = () => ({\n ' + JSON.stringify(key) + ": new LiveList(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details."),
|
|
203
203
|
null);
|
|
204
204
|
},
|
|
205
205
|
useMap: function(key, entries) {
|
|
206
|
-
internal.deprecateIf(entries, "Support for initializing entries in useMap() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n const initialStorage = () => {\n " + JSON.stringify(key) + ": new LiveMap(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.");
|
|
206
|
+
internal.deprecateIf(entries, "Support for initializing entries in useMap() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n const initialStorage = () => ({\n " + JSON.stringify(key) + ": new LiveMap(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.");
|
|
207
207
|
var value = useStorageValue(key, new client.LiveMap(null != entries ? entries : void 0));
|
|
208
|
-
return "ok" === value.status ? value.value : (internal.deprecateIf("notfound" === value.status, "Key " + JSON.stringify(key) + ' was not found in Storage. Starting with 0.18, useMap() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveMap } from "@liveblocks/client";\n\n const initialStorage = () => {\n ' + JSON.stringify(key) + ": new LiveMap(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details."),
|
|
208
|
+
return "ok" === value.status ? value.value : (internal.deprecateIf("notfound" === value.status, "Key " + JSON.stringify(key) + ' was not found in Storage. Starting with 0.18, useMap() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveMap } from "@liveblocks/client";\n\n const initialStorage = () => ({\n ' + JSON.stringify(key) + ": new LiveMap(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details."),
|
|
209
209
|
null);
|
|
210
210
|
},
|
|
211
211
|
useMyPresence: function() {
|
|
@@ -220,9 +220,9 @@ var _create = function() {
|
|
|
220
220
|
}), [ room ]) ];
|
|
221
221
|
},
|
|
222
222
|
useObject: function(key, initialData) {
|
|
223
|
-
internal.deprecateIf(initialData, 'Support for initializing data in useObject() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n import { LiveObject } from "@liveblocks/client";\n\n const initialStorage = () => {\n ' + JSON.stringify(key) + ": new LiveObject(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.");
|
|
223
|
+
internal.deprecateIf(initialData, 'Support for initializing data in useObject() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n import { LiveObject } from "@liveblocks/client";\n\n const initialStorage = () => ({\n ' + JSON.stringify(key) + ": new LiveObject(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.");
|
|
224
224
|
var value = useStorageValue(key, new client.LiveObject(initialData));
|
|
225
|
-
return "ok" === value.status ? value.value : (internal.deprecateIf("notfound" === value.status, "Key " + JSON.stringify(key) + ' was not found in Storage. Starting with 0.18, useObject() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveObject } from "@liveblocks/client";\n\n const initialStorage = () => {\n ' + JSON.stringify(key) + ": new LiveObject(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details."),
|
|
225
|
+
return "ok" === value.status ? value.value : (internal.deprecateIf("notfound" === value.status, "Key " + JSON.stringify(key) + ' was not found in Storage. Starting with 0.18, useObject() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveObject } from "@liveblocks/client";\n\n const initialStorage = () => ({\n ' + JSON.stringify(key) + ": new LiveObject(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details."),
|
|
226
226
|
null);
|
|
227
227
|
},
|
|
228
228
|
useOthers: function() {
|
package/index.mjs
CHANGED
|
@@ -166,15 +166,15 @@ const {RoomProvider: RoomProvider, useRoom: useRoom, useMyPresence: useMyPresenc
|
|
|
166
166
|
},
|
|
167
167
|
useHistory: useHistory,
|
|
168
168
|
useList: function(key, items) {
|
|
169
|
-
deprecateIf(items, `Support for initializing items in useList() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n import { LiveList } from "@liveblocks/client";\n\n const initialStorage = () => {\n ${JSON.stringify(key)}: new LiveList(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`);
|
|
169
|
+
deprecateIf(items, `Support for initializing items in useList() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n import { LiveList } from "@liveblocks/client";\n\n const initialStorage = () => ({\n ${JSON.stringify(key)}: new LiveList(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`);
|
|
170
170
|
const value = useStorageValue(key, new LiveList(items));
|
|
171
|
-
return "ok" === value.status ? value.value : (deprecateIf("notfound" === value.status, `Key ${JSON.stringify(key)} was not found in Storage. Starting with 0.18, useList() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveList } from "@liveblocks/client";\n\n const initialStorage = () => {\n ${JSON.stringify(key)}: new LiveList(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`),
|
|
171
|
+
return "ok" === value.status ? value.value : (deprecateIf("notfound" === value.status, `Key ${JSON.stringify(key)} was not found in Storage. Starting with 0.18, useList() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveList } from "@liveblocks/client";\n\n const initialStorage = () => ({\n ${JSON.stringify(key)}: new LiveList(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`),
|
|
172
172
|
null);
|
|
173
173
|
},
|
|
174
174
|
useMap: function(key, entries) {
|
|
175
|
-
deprecateIf(entries, `Support for initializing entries in useMap() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n const initialStorage = () => {\n ${JSON.stringify(key)}: new LiveMap(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`);
|
|
175
|
+
deprecateIf(entries, `Support for initializing entries in useMap() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n const initialStorage = () => ({\n ${JSON.stringify(key)}: new LiveMap(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`);
|
|
176
176
|
const value = useStorageValue(key, new LiveMap(null != entries ? entries : void 0));
|
|
177
|
-
return "ok" === value.status ? value.value : (deprecateIf("notfound" === value.status, `Key ${JSON.stringify(key)} was not found in Storage. Starting with 0.18, useMap() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveMap } from "@liveblocks/client";\n\n const initialStorage = () => {\n ${JSON.stringify(key)}: new LiveMap(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`),
|
|
177
|
+
return "ok" === value.status ? value.value : (deprecateIf("notfound" === value.status, `Key ${JSON.stringify(key)} was not found in Storage. Starting with 0.18, useMap() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveMap } from "@liveblocks/client";\n\n const initialStorage = () => ({\n ${JSON.stringify(key)}: new LiveMap(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`),
|
|
178
178
|
null);
|
|
179
179
|
},
|
|
180
180
|
useMyPresence: function() {
|
|
@@ -187,9 +187,9 @@ const {RoomProvider: RoomProvider, useRoom: useRoom, useMyPresence: useMyPresenc
|
|
|
187
187
|
}), [ room ]), [ presence, React.useCallback(((overrides, options) => room.updatePresence(overrides, options)), [ room ]) ];
|
|
188
188
|
},
|
|
189
189
|
useObject: function(key, initialData) {
|
|
190
|
-
deprecateIf(initialData, `Support for initializing data in useObject() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n import { LiveObject } from "@liveblocks/client";\n\n const initialStorage = () => {\n ${JSON.stringify(key)}: new LiveObject(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`);
|
|
190
|
+
deprecateIf(initialData, `Support for initializing data in useObject() directly will be removed in @liveblocks/react 0.18.\n\nInstead, please initialize this data where you set up your RoomProvider:\n\n import { LiveObject } from "@liveblocks/client";\n\n const initialStorage = () => ({\n ${JSON.stringify(key)}: new LiveObject(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`);
|
|
191
191
|
const value = useStorageValue(key, new LiveObject(initialData));
|
|
192
|
-
return "ok" === value.status ? value.value : (deprecateIf("notfound" === value.status, `Key ${JSON.stringify(key)} was not found in Storage. Starting with 0.18, useObject() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveObject } from "@liveblocks/client";\n\n const initialStorage = () => {\n ${JSON.stringify(key)}: new LiveObject(...),\n ...\n };\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`),
|
|
192
|
+
return "ok" === value.status ? value.value : (deprecateIf("notfound" === value.status, `Key ${JSON.stringify(key)} was not found in Storage. Starting with 0.18, useObject() will no longer automatically create this key.\n\nInstead, please initialize your storage where you set up your RoomProvider:\n\n import { LiveObject } from "@liveblocks/client";\n\n const initialStorage = () => ({\n ${JSON.stringify(key)}: new LiveObject(...),\n ...\n });\n\n <RoomProvider initialStorage={initialStorage}>\n ...\n </RoomProvider>\n\nPlease see https://bit.ly/3Niy5aP for details.`),
|
|
193
193
|
null);
|
|
194
194
|
},
|
|
195
195
|
useOthers: function() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liveblocks/react",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.8",
|
|
4
4
|
"description": "A set of React hooks and providers to use Liveblocks declaratively.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./index.mjs",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"license": "Apache-2.0",
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@liveblocks/client": "0.16.
|
|
31
|
+
"@liveblocks/client": "0.16.8",
|
|
32
32
|
"react": "^16.14.0 || ^17 || ^18"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|