cross-tab-worker-databus 0.20.95 → 0.20.96
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/CHANGELOG.md +9 -0
- package/dist/centrifuge.js +1 -1
- package/dist/{chunk-7BPB2Y4E.js → chunk-SSSJNWCH.js} +20 -2
- package/dist/{chunk-7BPB2Y4E.js.map → chunk-SSSJNWCH.js.map} +2 -2
- package/dist/cjs/centrifuge.cjs +19 -1
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/index.cjs +19 -1
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/core/data-bus.d.ts +6 -0
- package/dist/core/data-bus.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/docs/api.md +1 -0
- package/docs/architecture.md +2 -0
- package/docs/benchmarks.md +7 -7
- package/docs/getting-started.md +2 -0
- package/docs/roadmap.md +9 -1
- package/docs/zh/api.md +1 -0
- package/docs/zh/architecture.md +2 -0
- package/docs/zh/benchmarks.md +7 -7
- package/docs/zh/getting-started.md +2 -0
- package/docs/zh/roadmap.md +9 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.20.96] - 2026-09-22
|
|
4
|
+
|
|
5
|
+
### Deprecated
|
|
6
|
+
- An empty topic string (`""`) is deprecated in `subscribe()`, `publish()` and `publishBatch()`. It is still accepted and still flows through routing as a literal channel, but no transport can address such a channel, so the subscription it creates can never receive anything. The bus now logs one `console.warn` per instance the first time any of the three is called with `""`. Following the pre-1.0 deprecation policy, a future minor will reject it at that boundary with a `TypeError`, like the existing option guards. Callers using `""` as a topic should move to a real channel name.
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
- Documentation and tests only, otherwise: seven behaviors that could not fail their tests are now mutation-verified — the departing-owner handoff that deletes an unserved route instead of migrating it onto a live peer, the owner's release of its transport subscription when the last remote subscriber leaves, a cancelled durable-retention sweep staying silent, a superseded hydration snapshot being dropped rather than merged, the default platform `WebSocket` construction (subprotocols included), `ready()` surfacing the recorded transport error once the recovery budget is spent, and the Vue adapter containing a rejected `ready()`. `docs/architecture.md` (en + zh) gains the **Unserved route drop** and **Last-subscriber release** invariants; `AGENTS.md` records the two `ChannelHub`/batching-writer traps and the duplicated-guard mutation trap that made early drafts decorative. `vue.ts` and `hooks.ts` are now at 100% on all four coverage metrics, and `cluster.ts` is down to one uncovered line.
|
|
10
|
+
- `typescript-eslint` refreshed to `8.70.1`. TypeScript stays at `6.0.3`: the lint toolchain's peer range is still `typescript >=4.8.4 <6.1.0`, so a 7.x install breaks the lint gate before it touches this project's own types.
|
|
11
|
+
|
|
3
12
|
## [0.20.95] - 2026-09-22
|
|
4
13
|
|
|
5
14
|
### Fixed
|
package/dist/centrifuge.js
CHANGED
|
@@ -2340,7 +2340,7 @@ var DedupManager = class {
|
|
|
2340
2340
|
};
|
|
2341
2341
|
|
|
2342
2342
|
// src/core/version.ts
|
|
2343
|
-
var SDK_VERSION = true ? "0.20.
|
|
2343
|
+
var SDK_VERSION = true ? "0.20.96" : "";
|
|
2344
2344
|
|
|
2345
2345
|
// src/core/data-bus.ts
|
|
2346
2346
|
var DEFAULT_REPLAY_MAX_PER_TOPIC = 100;
|
|
@@ -2431,6 +2431,10 @@ var CrossTabDataBus = class {
|
|
|
2431
2431
|
// themselves demand: the failure path starts an on-demand reopen instead of
|
|
2432
2432
|
// stranding them until some unrelated future operation arrives.
|
|
2433
2433
|
recoveryWaiters = 0;
|
|
2434
|
+
// Latch for the empty-topic deprecation warning so a hot publish path cannot
|
|
2435
|
+
// fill the console. It is per-bus and never reset: the warning is about the
|
|
2436
|
+
// caller's code, not about a transient runtime condition.
|
|
2437
|
+
emptyTopicWarned = false;
|
|
2434
2438
|
/** Monotonic generation incremented on every successful transport open.
|
|
2435
2439
|
* Stays in lockstep with `lastSuccessAt` so callers can detect that the
|
|
2436
2440
|
* transport has been reopened even if the timestamp window is short. */
|
|
@@ -2835,6 +2839,7 @@ var CrossTabDataBus = class {
|
|
|
2835
2839
|
};
|
|
2836
2840
|
}
|
|
2837
2841
|
this.ensureStarted();
|
|
2842
|
+
if (topic === "") this.warnEmptyTopic("subscribe");
|
|
2838
2843
|
const handlers = this.topicHandlers.get(topic) ?? /* @__PURE__ */ new Set();
|
|
2839
2844
|
const wasUnused = handlers.size === 0;
|
|
2840
2845
|
handlers.add(handler);
|
|
@@ -2884,8 +2889,20 @@ var CrossTabDataBus = class {
|
|
|
2884
2889
|
resetDedup() {
|
|
2885
2890
|
this.dedupManager.reset();
|
|
2886
2891
|
}
|
|
2892
|
+
/** Warn (once per bus) that an empty topic is deprecated, without changing
|
|
2893
|
+
* behavior yet. `''` flows through routing as a literal channel, so the
|
|
2894
|
+
* subscription it creates can never be addressed by a transport: the message
|
|
2895
|
+
* silently goes nowhere. A future minor rejects it at this boundary. */
|
|
2896
|
+
warnEmptyTopic(operation) {
|
|
2897
|
+
if (this.emptyTopicWarned) return;
|
|
2898
|
+
this.emptyTopicWarned = true;
|
|
2899
|
+
console.warn(
|
|
2900
|
+
`cross-tab-worker-databus: ${operation}("") addresses a channel no transport can route. Use a non-empty topic; passing "" is planned to throw in a future minor.`
|
|
2901
|
+
);
|
|
2902
|
+
}
|
|
2887
2903
|
/** Publish a message to `topic`. The owning Worker delivers it to the transport. */
|
|
2888
2904
|
publish(topic, data, options) {
|
|
2905
|
+
if (topic === "") this.warnEmptyTopic("publish");
|
|
2889
2906
|
this.ensureStarted();
|
|
2890
2907
|
if (this.rejectPublishDuringStop("publish")) return;
|
|
2891
2908
|
if (!this.cluster.publish(topic, data, options)) {
|
|
@@ -2904,6 +2921,7 @@ var CrossTabDataBus = class {
|
|
|
2904
2921
|
publishBatch(topic, items) {
|
|
2905
2922
|
this.ensureStarted();
|
|
2906
2923
|
if (items.length === 0) return;
|
|
2924
|
+
if (topic === "") this.warnEmptyTopic("publishBatch");
|
|
2907
2925
|
if (this.rejectPublishDuringStop("publishBatch")) return;
|
|
2908
2926
|
if (items.length === 1) {
|
|
2909
2927
|
const first = items[0];
|
|
@@ -3532,4 +3550,4 @@ export {
|
|
|
3532
3550
|
parseDataBusPublication,
|
|
3533
3551
|
selectWorkerBackend
|
|
3534
3552
|
};
|
|
3535
|
-
//# sourceMappingURL=chunk-
|
|
3553
|
+
//# sourceMappingURL=chunk-SSSJNWCH.js.map
|