@afterrealism/dendri-client 2.5.0 → 2.6.0

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 CHANGED
@@ -70,7 +70,33 @@ const unsubscribe = store.subscribe(() => {
70
70
  store.join("my-room");
71
71
  ```
72
72
 
73
- React can wrap `store.subscribe` and `store.getSnapshot()` with `useSyncExternalStore`. Vue can mirror snapshots into `shallowRef`. Svelte can create the store in `onMount` or a `.svelte.ts` factory and call `destroy()` during cleanup.
73
+ ## Framework Adapters
74
+
75
+ Ready-made bindings ship as subpath exports (`react` and `vue` are optional peer
76
+ dependencies; the Svelte adapter is dependency-free):
77
+
78
+ ```tsx
79
+ // React — re-renders on store changes (useSyncExternalStore under the hood)
80
+ import { useDendriStore } from "@afterrealism/dendri-client/react";
81
+ const { connectionState, peers } = useDendriStore(store);
82
+ ```
83
+
84
+ ```ts
85
+ // Vue — shallowRef that tracks the store, auto-unsubscribes with the component
86
+ import { useDendriStore } from "@afterrealism/dendri-client/vue";
87
+ const snapshot = useDendriStore(store); // snapshot.value.connectionState
88
+ ```
89
+
90
+ ```svelte
91
+ <!-- Svelte — standard store contract, works with $ auto-subscription (Svelte 4 + 5) -->
92
+ <script>
93
+ import { toSvelteStore } from "@afterrealism/dendri-client/svelte";
94
+ const snapshot = toSvelteStore(store);
95
+ </script>
96
+ {$snapshot.connectionState}
97
+ ```
98
+
99
+ Any other framework can wrap `store.subscribe` and `store.getSnapshot()` the same way.
74
100
 
75
101
  ## Features
76
102
 
@@ -0,0 +1,33 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
+ mod
29
+ ));
30
+
31
+ export { __commonJS, __export, __toESM };
32
+ //# sourceMappingURL=chunk-G3PMV62Z.js.map
33
+ //# sourceMappingURL=chunk-G3PMV62Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-G3PMV62Z.js"}
@@ -1,32 +1,4 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
- };
10
- var __export = (target, all) => {
11
- for (var name in all)
12
- __defProp(target, name, { get: all[name], enumerable: true });
13
- };
14
- var __copyProps = (to, from, except, desc) => {
15
- if (from && typeof from === "object" || typeof from === "function") {
16
- for (let key of __getOwnPropNames(from))
17
- if (!__hasOwnProp.call(to, key) && key !== except)
18
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
- // If the importer is in node compatibility mode or this is not an ESM
24
- // file that has been converted to a CommonJS file using a Babel-
25
- // compatible transform (i.e. "__esModule" has not been set), then set
26
- // "default" to the CommonJS "module.exports" for node compatibility.
27
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
28
- mod
29
- ));
1
+ import { __commonJS, __export, __toESM } from './chunk-G3PMV62Z.js';
30
2
 
31
3
  // node_modules/.pnpm/sdp@3.2.2/node_modules/sdp/sdp.js
32
4
  var require_sdp = __commonJS({
@@ -3529,7 +3501,7 @@ var Util = class extends BinaryPackChunker {
3529
3501
  var util = new Util();
3530
3502
 
3531
3503
  // src/api.ts
3532
- var version = "2.5.0";
3504
+ var version = "2.6.0";
3533
3505
  var API = class _API {
3534
3506
  constructor(_options) {
3535
3507
  this._options = _options;
@@ -5557,7 +5529,7 @@ var PollingTransport = class _PollingTransport extends SignalingTransport {
5557
5529
  };
5558
5530
 
5559
5531
  // src/socket.ts
5560
- var version2 = "2.5.0";
5532
+ var version2 = "2.6.0";
5561
5533
  var Socket = class _Socket extends SignalingTransport {
5562
5534
  constructor(secure, host, port, path, key, pingInterval = 5e3, jwt, apiKey) {
5563
5535
  super();
@@ -8024,5 +7996,5 @@ function createDendriStore(input) {
8024
7996
  }
8025
7997
 
8026
7998
  export { AckManager, BaseConnectionErrorType, BufferedConnection, ConnectionQuality, ConnectionState, ConnectionType, DataConnection, DataConnectionErrorType, Dendri, DendriError, DendriErrorType, HybridConnection, PollingTransport, PresenceManager, RelayEncryption, Room, RpcError, RpcErrorCode, RpcManager, SSETransport, SerializationType, ServerMessageType, SignalingTransport, SocketEventType, TopicClass, TopicManager, TransportMode, createDendriStore, electNewHost, isRpcRequest, isRpcResponse, isTopicEnvelope, logger_default, util };
8027
- //# sourceMappingURL=chunk-3CE674DE.js.map
8028
- //# sourceMappingURL=chunk-3CE674DE.js.map
7999
+ //# sourceMappingURL=chunk-YLWDCKUW.js.map
8000
+ //# sourceMappingURL=chunk-YLWDCKUW.js.map