@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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/react@0.37.1 build /home/runner/work/pluv/pluv/packages/react
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
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- CJS dist/index.js 13.74 KB
12
- CJS ⚡️ Build success in 88ms
13
- ESM dist/index.mjs 11.36 KB
14
- ESM ⚡️ Build success in 91ms
11
+ CJS dist/index.js 13.89 KB
12
+ CJS ⚡️ Build success in 132ms
13
+ ESM dist/index.mjs 11.51 KB
14
+ ESM ⚡️ Build success in 133ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 6272ms
16
+ DTS ⚡️ Build success in 6040ms
17
17
  DTS dist/index.d.mts 5.39 KB
18
18
  DTS dist/index.d.ts 5.39 KB
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 = () => (0, import_react4.useContext)(PluvRoomContext);
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 = () => useContext(PluvRoomContext);
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.1",
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.1",
22
- "@pluv/crdt": "^0.37.1",
23
- "@pluv/types": "^0.37.1"
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.1",
36
- "eslint-config-pluv": "^0.37.1"
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",
@@ -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 = () => useContext(PluvRoomContext);
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();