@pluv/react 0.37.1 → 0.37.3
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +19 -0
- package/dist/index.js +5 -1
- package/dist/index.mjs +5 -1
- package/package.json +6 -6
- package/src/createBundle.tsx +7 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/react@0.37.
|
|
2
|
+
> @pluv/react@0.37.3 build /home/runner/work/pluv/pluv/packages/react
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts --external react
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
|
-
[32mCJS[39m [1mdist/index.js [22m[32m13.
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in
|
|
13
|
-
[32mESM[39m [1mdist/index.mjs [22m[32m11.
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m13.89 KB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 132ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m11.51 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 133ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 6040ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m5.39 KB[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m5.39 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @pluv/react
|
|
2
2
|
|
|
3
|
+
## 0.37.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- dff89ff: Added an error message for when `createBundle` functions are used outside of `PluvRoomProvider`.
|
|
8
|
+
- Updated dependencies [9ae837b]
|
|
9
|
+
- @pluv/client@0.37.3
|
|
10
|
+
- @pluv/crdt@0.37.3
|
|
11
|
+
- @pluv/types@0.37.3
|
|
12
|
+
|
|
13
|
+
## 0.37.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [11920af]
|
|
18
|
+
- @pluv/client@0.37.2
|
|
19
|
+
- @pluv/crdt@0.37.2
|
|
20
|
+
- @pluv/types@0.37.2
|
|
21
|
+
|
|
3
22
|
## 0.37.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -160,7 +160,11 @@ var createBundle = (client, options = {}) => {
|
|
|
160
160
|
});
|
|
161
161
|
PluvProvider.displayName = "PluvProvider";
|
|
162
162
|
const useClient = () => (0, import_react4.useContext)(PluvContext);
|
|
163
|
-
const useRoom = () =>
|
|
163
|
+
const useRoom = () => {
|
|
164
|
+
const room = (0, import_react4.useContext)(PluvRoomContext);
|
|
165
|
+
if (!room) throw new Error("Room could not be found. Component must be wrapped with PluvRoomProvider");
|
|
166
|
+
return room;
|
|
167
|
+
};
|
|
164
168
|
const useBroadcast = () => {
|
|
165
169
|
const room = useRoom();
|
|
166
170
|
const broadcast = (0, import_react4.useCallback)(
|
package/dist/index.mjs
CHANGED
|
@@ -124,7 +124,11 @@ var createBundle = (client, options = {}) => {
|
|
|
124
124
|
});
|
|
125
125
|
PluvProvider.displayName = "PluvProvider";
|
|
126
126
|
const useClient = () => useContext(PluvContext);
|
|
127
|
-
const useRoom = () =>
|
|
127
|
+
const useRoom = () => {
|
|
128
|
+
const room = useContext(PluvRoomContext);
|
|
129
|
+
if (!room) throw new Error("Room could not be found. Component must be wrapped with PluvRoomProvider");
|
|
130
|
+
return room;
|
|
131
|
+
};
|
|
128
132
|
const useBroadcast = () => {
|
|
129
133
|
const room = useRoom();
|
|
130
134
|
const broadcast = useCallback3(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/react",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.3",
|
|
4
4
|
"description": "@pluv/client React.js bindings",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"fast-deep-equal": "^3.1.3",
|
|
21
|
-
"@pluv/client": "^0.37.
|
|
22
|
-
"@pluv/crdt": "^0.37.
|
|
23
|
-
"@pluv/types": "^0.37.
|
|
21
|
+
"@pluv/client": "^0.37.3",
|
|
22
|
+
"@pluv/crdt": "^0.37.3",
|
|
23
|
+
"@pluv/types": "^0.37.3"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@types/react": "^18.0.0 || ^19.0.0",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"react": "^19.0.0",
|
|
33
33
|
"tsup": "^8.4.0",
|
|
34
34
|
"typescript": "^5.8.2",
|
|
35
|
-
"@pluv/tsconfig": "^0.37.
|
|
36
|
-
"eslint-config-pluv": "^0.37.
|
|
35
|
+
"@pluv/tsconfig": "^0.37.3",
|
|
36
|
+
"eslint-config-pluv": "^0.37.3"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"build": "tsup src/index.ts --format esm,cjs --dts --external react",
|
package/src/createBundle.tsx
CHANGED
|
@@ -246,7 +246,13 @@ export const createBundle = <
|
|
|
246
246
|
|
|
247
247
|
const useClient = (): PluvClient<TIO, TPresence, TStorage, TMetadata> => useContext(PluvContext);
|
|
248
248
|
|
|
249
|
-
const useRoom = () =>
|
|
249
|
+
const useRoom = () => {
|
|
250
|
+
const room = useContext(PluvRoomContext);
|
|
251
|
+
|
|
252
|
+
if (!room) throw new Error("Room could not be found. Component must be wrapped with PluvRoomProvider");
|
|
253
|
+
|
|
254
|
+
return room;
|
|
255
|
+
};
|
|
250
256
|
|
|
251
257
|
const useBroadcast = (): BroadcastProxy<MergeEvents<TEvents, TIO>> => {
|
|
252
258
|
const room = useRoom();
|