@pluv/client 0.38.12 → 0.38.14
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 +15 -0
- package/dist/index.js +4 -7
- package/dist/index.mjs +4 -7
- package/package.json +5 -5
- package/src/PluvRoom.ts +2 -3
- package/src/UsersManager.ts +3 -9
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/client@0.38.
|
|
2
|
+
> @pluv/client@0.38.14 build /home/runner/work/pluv/pluv/packages/client
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
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
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
11
|
+
[32mCJS[39m [1mdist/index.js [22m[32m49.20 KB[39m
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 128ms
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m47.88 KB[39m
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 134ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 3169ms
|
|
17
17
|
[32mDTS[39m [1mdist/index.d.mts [22m[32m23.23 KB[39m
|
|
18
18
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m23.23 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @pluv/client
|
|
2
2
|
|
|
3
|
+
## 0.38.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 886a1f9: Fix cases where the user's own presence was getting updated excessively, and without re-triggering subscriptions.
|
|
8
|
+
- @pluv/crdt@0.38.14
|
|
9
|
+
- @pluv/types@0.38.14
|
|
10
|
+
|
|
11
|
+
## 0.38.13
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- @pluv/crdt@0.38.13
|
|
16
|
+
- @pluv/types@0.38.13
|
|
17
|
+
|
|
3
18
|
## 0.38.12
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -347,9 +347,7 @@ var UsersManager = class {
|
|
|
347
347
|
patchPresence(connectionId, patch) {
|
|
348
348
|
var _a, _b;
|
|
349
349
|
if (((_a = this._myself) == null ? void 0 : _a.connectionId) === connectionId) {
|
|
350
|
-
|
|
351
|
-
this._myself.presence = presence2;
|
|
352
|
-
this._myPresence = presence2;
|
|
350
|
+
this.updateMyPresence(patch);
|
|
353
351
|
return;
|
|
354
352
|
}
|
|
355
353
|
const other = this._others.get(connectionId);
|
|
@@ -400,8 +398,8 @@ var UsersManager = class {
|
|
|
400
398
|
/**
|
|
401
399
|
* @description This method need not care about being connected.
|
|
402
400
|
*/
|
|
403
|
-
updateMyPresence(
|
|
404
|
-
this._myPresence = __spreadValues(__spreadValues({}, this._myPresence),
|
|
401
|
+
updateMyPresence(patch) {
|
|
402
|
+
this._myPresence = __spreadValues(__spreadValues({}, this._myPresence), patch);
|
|
405
403
|
if (!this._myself) return;
|
|
406
404
|
this._myself.presence = this._myPresence;
|
|
407
405
|
}
|
|
@@ -874,10 +872,9 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
874
872
|
if (!connectionId) return;
|
|
875
873
|
if (!this._state.webSocket) throw new Error("Could not find WebSocket");
|
|
876
874
|
const data = message.data;
|
|
877
|
-
this._usersManager.patchPresence(connectionId, data.presence);
|
|
878
|
-
const myPresence = this._usersManager.myPresence;
|
|
879
875
|
const myself = (_a = this._usersManager.myself) != null ? _a : null;
|
|
880
876
|
if ((myself == null ? void 0 : myself.connectionId) === connectionId) return;
|
|
877
|
+
this._usersManager.patchPresence(connectionId, data.presence);
|
|
881
878
|
const other = this._usersManager.getOther(connectionId);
|
|
882
879
|
const others = this._usersManager.getOthers();
|
|
883
880
|
this._otherNotifier.subject(connectionId).next(other);
|
package/dist/index.mjs
CHANGED
|
@@ -316,9 +316,7 @@ var UsersManager = class {
|
|
|
316
316
|
patchPresence(connectionId, patch) {
|
|
317
317
|
var _a, _b;
|
|
318
318
|
if (((_a = this._myself) == null ? void 0 : _a.connectionId) === connectionId) {
|
|
319
|
-
|
|
320
|
-
this._myself.presence = presence2;
|
|
321
|
-
this._myPresence = presence2;
|
|
319
|
+
this.updateMyPresence(patch);
|
|
322
320
|
return;
|
|
323
321
|
}
|
|
324
322
|
const other = this._others.get(connectionId);
|
|
@@ -369,8 +367,8 @@ var UsersManager = class {
|
|
|
369
367
|
/**
|
|
370
368
|
* @description This method need not care about being connected.
|
|
371
369
|
*/
|
|
372
|
-
updateMyPresence(
|
|
373
|
-
this._myPresence = __spreadValues(__spreadValues({}, this._myPresence),
|
|
370
|
+
updateMyPresence(patch) {
|
|
371
|
+
this._myPresence = __spreadValues(__spreadValues({}, this._myPresence), patch);
|
|
374
372
|
if (!this._myself) return;
|
|
375
373
|
this._myself.presence = this._myPresence;
|
|
376
374
|
}
|
|
@@ -843,10 +841,9 @@ var PluvRoom = class extends AbstractRoom {
|
|
|
843
841
|
if (!connectionId) return;
|
|
844
842
|
if (!this._state.webSocket) throw new Error("Could not find WebSocket");
|
|
845
843
|
const data = message.data;
|
|
846
|
-
this._usersManager.patchPresence(connectionId, data.presence);
|
|
847
|
-
const myPresence = this._usersManager.myPresence;
|
|
848
844
|
const myself = (_a = this._usersManager.myself) != null ? _a : null;
|
|
849
845
|
if ((myself == null ? void 0 : myself.connectionId) === connectionId) return;
|
|
846
|
+
this._usersManager.patchPresence(connectionId, data.presence);
|
|
850
847
|
const other = this._usersManager.getOther(connectionId);
|
|
851
848
|
const others = this._usersManager.getOthers();
|
|
852
849
|
this._otherNotifier.subject(connectionId).next(other);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/client",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.14",
|
|
4
4
|
"description": "@pluv/io frontend client",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"wonka": "^6.3.5",
|
|
21
|
-
"@pluv/crdt": "^0.38.
|
|
22
|
-
"@pluv/types": "^0.38.
|
|
21
|
+
"@pluv/crdt": "^0.38.14",
|
|
22
|
+
"@pluv/types": "^0.38.14"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"eslint": "^8.57.1",
|
|
26
26
|
"tsup": "^8.4.0",
|
|
27
27
|
"typescript": "^5.8.3",
|
|
28
|
-
"@pluv/tsconfig": "^0.38.
|
|
29
|
-
"eslint-config-pluv": "^0.38.
|
|
28
|
+
"@pluv/tsconfig": "^0.38.14",
|
|
29
|
+
"eslint-config-pluv": "^0.38.14"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/PluvRoom.ts
CHANGED
|
@@ -785,9 +785,6 @@ export class PluvRoom<
|
|
|
785
785
|
|
|
786
786
|
const data = message.data as BaseIOEventRecord<InferIOAuthorize<TIO>>["$presenceUpdated"];
|
|
787
787
|
|
|
788
|
-
this._usersManager.patchPresence(connectionId, data.presence as TPresence);
|
|
789
|
-
|
|
790
|
-
const myPresence = this._usersManager.myPresence;
|
|
791
788
|
const myself = this._usersManager.myself ?? null;
|
|
792
789
|
|
|
793
790
|
/**
|
|
@@ -799,6 +796,8 @@ export class PluvRoom<
|
|
|
799
796
|
*/
|
|
800
797
|
if (myself?.connectionId === connectionId) return;
|
|
801
798
|
|
|
799
|
+
this._usersManager.patchPresence(connectionId, data.presence as TPresence);
|
|
800
|
+
|
|
802
801
|
const other = this._usersManager.getOther(connectionId);
|
|
803
802
|
const others = this._usersManager.getOthers();
|
|
804
803
|
|
package/src/UsersManager.ts
CHANGED
|
@@ -52,13 +52,7 @@ export class UsersManager<TIO extends IOLike, TPresence extends JsonObject = {}>
|
|
|
52
52
|
|
|
53
53
|
public patchPresence(connectionId: string, patch: Partial<TPresence>): void {
|
|
54
54
|
if (this._myself?.connectionId === connectionId) {
|
|
55
|
-
|
|
56
|
-
...this._myPresence,
|
|
57
|
-
...patch,
|
|
58
|
-
} as TPresence;
|
|
59
|
-
|
|
60
|
-
this._myself.presence = presence;
|
|
61
|
-
this._myPresence = presence;
|
|
55
|
+
this.updateMyPresence(patch);
|
|
62
56
|
|
|
63
57
|
return;
|
|
64
58
|
}
|
|
@@ -135,8 +129,8 @@ export class UsersManager<TIO extends IOLike, TPresence extends JsonObject = {}>
|
|
|
135
129
|
/**
|
|
136
130
|
* @description This method need not care about being connected.
|
|
137
131
|
*/
|
|
138
|
-
public updateMyPresence(
|
|
139
|
-
this._myPresence = { ...this._myPresence, ...
|
|
132
|
+
public updateMyPresence(patch: Partial<TPresence>): void {
|
|
133
|
+
this._myPresence = { ...this._myPresence, ...patch };
|
|
140
134
|
|
|
141
135
|
if (!this._myself) return;
|
|
142
136
|
|