@mmstack/mesh 21.15.1 → 21.15.2
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/README.md +5 -1
- package/fesm2022/mmstack-mesh.mjs +7 -3
- package/fesm2022/mmstack-mesh.mjs.map +1 -1
- package/package.json +2 -2
- package/types/mmstack-mesh.d.ts +18 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmstack/mesh",
|
|
3
|
-
"version": "21.15.
|
|
3
|
+
"version": "21.15.2",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"angular",
|
|
6
6
|
"signals",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@angular/core": ">=21 <22",
|
|
23
23
|
"@mmstack/primitives": ">=21.25 <22",
|
|
24
|
-
"@mmstack/mesh-protocol": ">=0.15.
|
|
24
|
+
"@mmstack/mesh-protocol": ">=0.15.2 <1"
|
|
25
25
|
},
|
|
26
26
|
"sideEffects": false,
|
|
27
27
|
"module": "fesm2022/mmstack-mesh.mjs",
|
package/types/mmstack-mesh.d.ts
CHANGED
|
@@ -49,15 +49,30 @@ type MeshTransportFactory = () => MeshTransport;
|
|
|
49
49
|
* flushed on open; malformed inbound frames are dropped.
|
|
50
50
|
*/
|
|
51
51
|
declare function webSocketTransport(url: string, protocols?: string | string[]): MeshTransportFactory;
|
|
52
|
+
type DirectTransportOptions = {
|
|
53
|
+
/**
|
|
54
|
+
* Hand the relay's messages to this peer BY REFERENCE instead of through a JSON hop. A snapshot
|
|
55
|
+
* welcome then costs the peer no copy of the room's registers: its stores hold the relay's own
|
|
56
|
+
* sibling objects, the same ones every other such peer holds. The peer must therefore treat
|
|
57
|
+
* everything it receives as the relay's memory and never mutate it — a write in place would
|
|
58
|
+
* corrupt the room for everyone. The peer's own messages still cross as JSON, so what it writes
|
|
59
|
+
* reaches the relay exactly as a socket peer's would. Off by default; opt in only for a process
|
|
60
|
+
* whose readers are known not to mutate what a seat materializes.
|
|
61
|
+
*/
|
|
62
|
+
readonly byReference?: boolean;
|
|
63
|
+
};
|
|
52
64
|
/**
|
|
53
65
|
* Connects directly to an in-process `createRelay` — no network. The backbone of full-loop
|
|
54
66
|
* tests, and handy for single-process demos or an SSR-side room.
|
|
55
67
|
*
|
|
56
68
|
* Messages cross as JSON in both directions, as they would over a socket, so a direct peer holds
|
|
57
69
|
* exactly what a socket peer would. Handed over by reference, an `undefined` an emitter wrote
|
|
58
|
-
* would reach relay memory where a socket peer's would have been dropped.
|
|
70
|
+
* would reach relay memory where a socket peer's would have been dropped. The relay's own
|
|
71
|
+
* messages may skip the hop ({@link DirectTransportOptions.byReference}): they never hold an
|
|
72
|
+
* `undefined` (every value in a room arrived as JSON), so the two peers read the same state and
|
|
73
|
+
* differ only in who owns the objects.
|
|
59
74
|
*/
|
|
60
|
-
declare function directTransport(relay: Relay, ctx: PrincipalCtx): MeshTransportFactory;
|
|
75
|
+
declare function directTransport(relay: Relay, ctx: PrincipalCtx, options?: DirectTransportOptions): MeshTransportFactory;
|
|
61
76
|
|
|
62
77
|
/**
|
|
63
78
|
* Why a write is a conflict: its replay into a new generation cites something the generation does
|
|
@@ -750,4 +765,4 @@ type RtcPresenceRef<T> = {
|
|
|
750
765
|
declare function rtcPresence<T>(links: PeerLinks, opt: RtcPresenceOptions): RtcPresenceRef<T>;
|
|
751
766
|
|
|
752
767
|
export { agentSeat, defaultPeerChannels, describeOp, directTransport, meshSync, peerLinks, presenceChannel, rtcPeerConnector, rtcPresence, setAtPath, webRtcMesh, webSocketTransport };
|
|
753
|
-
export type { AgentSeat, AgentSeatOptions, DataChannelLike, MeshDirect, MeshPeer, MeshStatus, MeshSyncOptions, MeshSyncRef, MeshTransport, MeshTransportFactory, PeerChannelSpec, PeerConnector, PeerLinks, PeerLinksOptions, PresenceFrame, RtcPresenceOptions, RtcPresenceRef, SeatChange, SeatEvent, SeatResync, SeatSync, SignalingPort, StableSnapshot, SyncHealth, SyncHealthStatus, WebRtcMeshOptions, WebRtcMeshRef };
|
|
768
|
+
export type { AgentSeat, AgentSeatOptions, DataChannelLike, DirectTransportOptions, MeshDirect, MeshPeer, MeshStatus, MeshSyncOptions, MeshSyncRef, MeshTransport, MeshTransportFactory, PeerChannelSpec, PeerConnector, PeerLinks, PeerLinksOptions, PresenceFrame, RtcPresenceOptions, RtcPresenceRef, SeatChange, SeatEvent, SeatResync, SeatSync, SignalingPort, StableSnapshot, SyncHealth, SyncHealthStatus, WebRtcMeshOptions, WebRtcMeshRef };
|