@pluv/react 0.5.3 → 0.5.5

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.5.3 build /home/runner/work/pluv/pluv/packages/react
2
+ > @pluv/react@0.5.5 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,10 +8,10 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- CJS dist/index.js 10.98 KB
12
- CJS ⚡️ Build success in 115ms
13
- ESM dist/index.mjs 8.56 KB
14
- ESM ⚡️ Build success in 126ms
11
+ CJS dist/index.js 11.24 KB
12
+ CJS ⚡️ Build success in 94ms
13
+ ESM dist/index.mjs 8.75 KB
14
+ ESM ⚡️ Build success in 98ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 4316ms
16
+ DTS ⚡️ Build success in 4893ms
17
17
  DTS dist/index.d.ts 4.37 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @pluv/react
2
2
 
3
+ ## 0.5.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 9ae251d: bumped dependencies
8
+ - Updated dependencies [9ae251d]
9
+ - @pluv/client@0.6.2
10
+
11
+ ## 0.5.4
12
+
13
+ ### Patch Changes
14
+
15
+ - 19433af: updated MockedRoomProvider events to allow partial events
16
+ - b80c555: updated react hooks to not re-render if state is deeply equal by default
17
+ - 74870ee: bumped dependencies
18
+ - Updated dependencies [19433af]
19
+ - Updated dependencies [74870ee]
20
+ - @pluv/client@0.6.1
21
+ - @pluv/types@0.1.5
22
+
3
23
  ## 0.5.3
4
24
 
5
25
  ### Patch Changes
package/dist/index.js CHANGED
@@ -140,6 +140,7 @@ var createRoomBundle = (client, options = {}) => {
140
140
  );
141
141
  };
142
142
  const usePluvConnection = (selector = identity, options2) => {
143
+ var _a;
143
144
  const room = usePluvRoom();
144
145
  const subscribe = (0, import_react3.useCallback)(
145
146
  (onStoreChange) => {
@@ -157,7 +158,7 @@ var createRoomBundle = (client, options = {}) => {
157
158
  getSnapshot,
158
159
  getSnapshot,
159
160
  _selector,
160
- options2 == null ? void 0 : options2.isEqual
161
+ (_a = options2 == null ? void 0 : options2.isEqual) != null ? _a : import_fast_deep_equal.default
161
162
  );
162
163
  };
163
164
  const usePluvEvent = (type, callback) => {
@@ -170,6 +171,7 @@ var createRoomBundle = (client, options = {}) => {
170
171
  }, [callback, room, type]);
171
172
  };
172
173
  const usePluvMyPresence = (selector = identity, options2) => {
174
+ var _a;
173
175
  const room = usePluvRoom();
174
176
  const subscribe = (0, import_react3.useCallback)(
175
177
  (onStoreChange) => {
@@ -189,7 +191,7 @@ var createRoomBundle = (client, options = {}) => {
189
191
  getSnapshot,
190
192
  getSnapshot,
191
193
  _selector,
192
- options2 == null ? void 0 : options2.isEqual
194
+ (_a = options2 == null ? void 0 : options2.isEqual) != null ? _a : import_fast_deep_equal.default
193
195
  );
194
196
  const updateMyPresence = (0, import_react3.useCallback)(
195
197
  (value) => {
@@ -205,6 +207,7 @@ var createRoomBundle = (client, options = {}) => {
205
207
  return [myPresence, updateMyPresence];
206
208
  };
207
209
  const usePluvMyself = (selector = identity, options2) => {
210
+ var _a;
208
211
  const room = usePluvRoom();
209
212
  const subscribe = (0, import_react3.useCallback)(
210
213
  (onStoreChange) => {
@@ -224,10 +227,11 @@ var createRoomBundle = (client, options = {}) => {
224
227
  getSnapshot,
225
228
  getSnapshot,
226
229
  _selector,
227
- options2 == null ? void 0 : options2.isEqual
230
+ (_a = options2 == null ? void 0 : options2.isEqual) != null ? _a : import_fast_deep_equal.default
228
231
  );
229
232
  };
230
233
  const usePluvOther = (connectionId, selector = identity, options2) => {
234
+ var _a;
231
235
  const room = usePluvRoom();
232
236
  const subscribe = (0, import_react3.useCallback)(
233
237
  (onStoreChange) => {
@@ -250,7 +254,7 @@ var createRoomBundle = (client, options = {}) => {
250
254
  getSnapshot,
251
255
  getSnapshot,
252
256
  _selector,
253
- options2 == null ? void 0 : options2.isEqual
257
+ (_a = options2 == null ? void 0 : options2.isEqual) != null ? _a : import_fast_deep_equal.default
254
258
  );
255
259
  };
256
260
  const usePluvOthers = (selector = identity, options2) => {
package/dist/index.mjs CHANGED
@@ -103,6 +103,7 @@ var createRoomBundle = (client, options = {}) => {
103
103
  );
104
104
  };
105
105
  const usePluvConnection = (selector = identity, options2) => {
106
+ var _a;
106
107
  const room = usePluvRoom();
107
108
  const subscribe = useCallback2(
108
109
  (onStoreChange) => {
@@ -120,7 +121,7 @@ var createRoomBundle = (client, options = {}) => {
120
121
  getSnapshot,
121
122
  getSnapshot,
122
123
  _selector,
123
- options2 == null ? void 0 : options2.isEqual
124
+ (_a = options2 == null ? void 0 : options2.isEqual) != null ? _a : fastDeepEqual
124
125
  );
125
126
  };
126
127
  const usePluvEvent = (type, callback) => {
@@ -133,6 +134,7 @@ var createRoomBundle = (client, options = {}) => {
133
134
  }, [callback, room, type]);
134
135
  };
135
136
  const usePluvMyPresence = (selector = identity, options2) => {
137
+ var _a;
136
138
  const room = usePluvRoom();
137
139
  const subscribe = useCallback2(
138
140
  (onStoreChange) => {
@@ -152,7 +154,7 @@ var createRoomBundle = (client, options = {}) => {
152
154
  getSnapshot,
153
155
  getSnapshot,
154
156
  _selector,
155
- options2 == null ? void 0 : options2.isEqual
157
+ (_a = options2 == null ? void 0 : options2.isEqual) != null ? _a : fastDeepEqual
156
158
  );
157
159
  const updateMyPresence = useCallback2(
158
160
  (value) => {
@@ -168,6 +170,7 @@ var createRoomBundle = (client, options = {}) => {
168
170
  return [myPresence, updateMyPresence];
169
171
  };
170
172
  const usePluvMyself = (selector = identity, options2) => {
173
+ var _a;
171
174
  const room = usePluvRoom();
172
175
  const subscribe = useCallback2(
173
176
  (onStoreChange) => {
@@ -187,10 +190,11 @@ var createRoomBundle = (client, options = {}) => {
187
190
  getSnapshot,
188
191
  getSnapshot,
189
192
  _selector,
190
- options2 == null ? void 0 : options2.isEqual
193
+ (_a = options2 == null ? void 0 : options2.isEqual) != null ? _a : fastDeepEqual
191
194
  );
192
195
  };
193
196
  const usePluvOther = (connectionId, selector = identity, options2) => {
197
+ var _a;
194
198
  const room = usePluvRoom();
195
199
  const subscribe = useCallback2(
196
200
  (onStoreChange) => {
@@ -213,7 +217,7 @@ var createRoomBundle = (client, options = {}) => {
213
217
  getSnapshot,
214
218
  getSnapshot,
215
219
  _selector,
216
- options2 == null ? void 0 : options2.isEqual
220
+ (_a = options2 == null ? void 0 : options2.isEqual) != null ? _a : fastDeepEqual
217
221
  );
218
222
  };
219
223
  const usePluvOthers = (selector = identity, options2) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/react",
3
- "version": "0.5.3",
3
+ "version": "0.5.5",
4
4
  "description": "@pluv/client React.js bindings",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -20,21 +20,21 @@
20
20
  "@types/use-sync-external-store": "^0.0.3",
21
21
  "fast-deep-equal": "^3.1.3",
22
22
  "use-sync-external-store": "^1.2.0",
23
- "@pluv/client": "^0.6.0",
24
- "@pluv/types": "^0.1.4"
23
+ "@pluv/client": "^0.6.2",
24
+ "@pluv/types": "^0.1.5"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "^17.0.0 || ^18.0.0",
28
28
  "yjs": "^13.0.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@types/react": "18.0.29",
31
+ "@types/react": "18.0.33",
32
32
  "react": "18.2.0",
33
33
  "tsup": "^6.7.0",
34
- "typescript": "^5.0.2",
35
- "yjs": "^13.5.51",
34
+ "typescript": "^5.0.3",
35
+ "yjs": "^13.5.52",
36
36
  "@pluv/tsconfig": "^0.1.4",
37
- "eslint-config-pluv": "^0.1.7"
37
+ "eslint-config-pluv": "^0.1.8"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "tsup src/index.ts --format esm,cjs --dts --external react",
@@ -3,11 +3,11 @@ import type { IOLike, JsonObject } from "@pluv/types";
3
3
  import { createContext, FC, ReactNode } from "react";
4
4
  import { memo, useContext } from "react";
5
5
  import type { AbstractType } from "yjs";
6
- import {
6
+ import type {
7
7
  CreateRoomBundle,
8
- createRoomBundle as _createRoomBundle,
9
8
  CreateRoomBundleOptions,
10
9
  } from "./createRoomBundle";
10
+ import { createRoomBundle as _createRoomBundle } from "./createRoomBundle";
11
11
 
12
12
  export interface PluvProviderProps {
13
13
  children?: ReactNode;
@@ -282,7 +282,7 @@ export const createRoomBundle = <
282
282
  getSnapshot,
283
283
  getSnapshot,
284
284
  _selector,
285
- options?.isEqual
285
+ options?.isEqual ?? fastDeepEqual
286
286
  );
287
287
  };
288
288
 
@@ -328,7 +328,7 @@ export const createRoomBundle = <
328
328
  getSnapshot,
329
329
  getSnapshot,
330
330
  _selector,
331
- options?.isEqual
331
+ options?.isEqual ?? fastDeepEqual
332
332
  );
333
333
 
334
334
  const updateMyPresence: Dispatch<UpdateMyPresenceAction<TPresence>> =
@@ -378,7 +378,7 @@ export const createRoomBundle = <
378
378
  getSnapshot,
379
379
  getSnapshot,
380
380
  _selector,
381
- options?.isEqual
381
+ options?.isEqual ?? fastDeepEqual
382
382
  );
383
383
  };
384
384
 
@@ -413,7 +413,7 @@ export const createRoomBundle = <
413
413
  getSnapshot,
414
414
  getSnapshot,
415
415
  _selector,
416
- options?.isEqual
416
+ options?.isEqual ?? fastDeepEqual
417
417
  );
418
418
  };
419
419