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.
@@ -196,6 +196,7 @@ export declare class CrossTabDataBus<TConfig = unknown, TData = unknown> {
196
196
  private recoveryCancellationToken;
197
197
  private recoveryDemandAllowed;
198
198
  private recoveryWaiters;
199
+ private emptyTopicWarned;
199
200
  /** Monotonic generation incremented on every successful transport open.
200
201
  * Stays in lockstep with `lastSuccessAt` so callers can detect that the
201
202
  * transport has been reopened even if the timestamp window is short. */
@@ -289,6 +290,11 @@ export declare class CrossTabDataBus<TConfig = unknown, TData = unknown> {
289
290
  getDedupStats(): DataBusDedupStats;
290
291
  /** Drop all remembered IDs and reset dedup counters. */
291
292
  resetDedup(): void;
293
+ /** Warn (once per bus) that an empty topic is deprecated, without changing
294
+ * behavior yet. `''` flows through routing as a literal channel, so the
295
+ * subscription it creates can never be addressed by a transport: the message
296
+ * silently goes nowhere. A future minor rejects it at this boundary. */
297
+ private warnEmptyTopic;
292
298
  /** Publish a message to `topic`. The owning Worker delivers it to the transport. */
293
299
  publish(topic: string, data: unknown, options?: DataBusPublishOptions): void;
294
300
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"data-bus.d.ts","sourceRoot":"","sources":["../../src/core/data-bus.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAE7E,OAAO,KAAK,EACV,mBAAmB,EAEnB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACb,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAGrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,iBA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;;;;OAMG;IACH,OAAO,CAAC,SAAS;YAaH,WAAW;IAuCzB;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAuB9B,kFAAkF;IAClF,OAAO,CAAC,eAAe;IAIvB,6CAA6C;IAC7C,OAAO,CAAC,cAAc;IAItB;;yEAEqE;IACrE,OAAO,CAAC,QAAQ;IAWhB;;;OAGG;IACH,OAAO,CAAC,YAAY;IA2EpB,OAAO,CAAC,WAAW;IA4BnB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,WAAW;IAKnB;;4DAEwD;IACxD,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,iBAAiB;IASzB;;;8EAG0E;IAC1E,OAAO,CAAC,qBAAqB;IAW7B,8DAA8D;IAC9D,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,oBAAoB;IAM5B;;;;+CAI2C;IAC3C,OAAO,CAAC,cAAc;IAoBtB;;iFAE6E;IAC7E,OAAO,CAAC,wBAAwB;IAUhC;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAqCxB;qEACiE;IACjE,OAAO,CAAC,iBAAiB;IAMzB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IAIvB;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IA+DvB;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAuEpB;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;IAS/B;;;OAGG;IACH,OAAO,CAAC,aAAa;CAUtB"}
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  selectRebalanceTarget,
21
21
  selectWorkerBackend,
22
22
  topicMatchesPattern
23
- } from "./chunk-7BPB2Y4E.js";
23
+ } from "./chunk-SSSJNWCH.js";
24
24
  import {
25
25
  DEFAULT_STORAGE_PREFIX,
26
26
  PRUNE_STRATEGY,
package/docs/api.md CHANGED
@@ -95,6 +95,7 @@ Registers a local subscription and returns a cleanup function.
95
95
  - Subscriptions are automatically queued when the transport is not yet ready, including while a transport recovery is pending: they are held behind the recovery gate and issued once the reopen succeeds instead of being written to the connection that just reported `error`.
96
96
  - A subscription requested while an explicit `stop()` is settling is not registered: `subscribe()` reports the rejection through `onError` and returns a no-op cleanup function. Wait for `stop()` to settle, then call `start()` before subscribing again.
97
97
  - Wildcard subscriptions: a topic ending in `.*` (`chat.*`) matches any remainder, and `*` matches everything. The pattern is routed, owned, and transport-subscribed as a literal channel; publications tagged with a matching concrete topic (or with the pattern itself) are delivered to wildcard handlers. See `topicMatchesPattern` below.
98
+ - Topics must be non-empty. `''` is still accepted and routed as a literal channel, but no transport can address it, so nothing is ever delivered; the bus logs one `console.warn` per instance the first time `subscribe`/`publish`/`publishBatch` is called with it. A future minor rejects an empty topic at this boundary, consistent with the option-validation guards.
98
99
  - Replay (opt-in): construct the bus with `replay: { maxPerTopic }` and pass `{ replay: true | n }` as the third `subscribe()` argument. `maxPerTopic` must be a positive safe integer. The new handler immediately receives the buffered history (up to `n`, capped by `maxPerTopic`, default 100) with `message.replayed: true`, so late joiners do not miss earlier publications. Only dispatched publications are buffered (a topic with no local subscriber drops them as unowned); buffers are in-memory and cleared when the last handler for the topic unsubscribes. Wildcard subscriptions replay across every buffered topic matching the pattern. For reload/BFCache persistence, pass an optional `persistence` created by `createIndexedDbReplayPersistence({ maxPerTopic })`; persistence is asynchronous and failures are reported through `onError` without breaking live delivery. Set `retentionMs` to prune expired producer-timestamped history in memory and to sweep adapters that implement `clearBefore` during hydration and after appends. Set `persistenceRetry: { maxAttempts, backoffMs }` to retry transient persistence failures; defaults preserve one-attempt behavior. Set `pruneStrategy` to `'count'` (default), `'age'`, or `'both'` to cap by `maxPerTopic`, prune timestamped history by `retentionMs`, or apply both. Under `age`, timestamp-less legacy entries are retained but capped by `maxPerTopic`; timestamped entries are bounded by the retention window.
99
100
  When tracing is enabled, retries emit `reliability` events with `operation: 'persistence_retry'`, a bounded `persistenceOperation`, and `attempt`.
100
101
 
@@ -548,6 +548,8 @@ These invariants are pinned by regression tests (see `tests/stability.test.ts` a
548
548
  - **Recovery waiter invalidation.** Each operation parked behind the recovery gate captures the recovery cancellation generation. `stop()` and `suspendTransport()` invalidate that generation when they supersede the recovery cycle, so a waiter whose microtask runs after an immediate explicit `start()` cannot replay into the replacement transport. The restarted cluster owns exactly one resubscription per assigned topic, and the stale operation cannot issue a duplicate subscription.
549
549
  - **Hidden-document activation guard.** `WorkerClusterRuntime.start()` installs lifecycle listeners before it checks visibility. A start that reaches a hidden document records suspension without registering a worker, opening a channel, or starting heartbeats, so a restart queued behind an asynchronous stop cannot miss a `pagehide` during cleanup and reconnect in the background; the installed listener handles the later `pageshow`.
550
550
  - **Handoff channel close ordering.** `pause()` defers the physical `channel.close()` by one task. Closing synchronously would discard messages still queued for delivery — including the handoff's `ROUTE_RELEASED` — stranding the handoff target with an unconfirmed route.
551
+ - **Unserved route drop.** A departing owner migrates only the routes that still have subscribers. When every remaining subscriber record of a route it owns has gone — a peer tab that died without releasing — the route is deleted instead of handed to a live peer, which would otherwise carry a transport subscription no Tab listens to. `pause()` runs no orphan-route cleanup (that lives in `reconcile`), so this is the only synchronous release of that record (pinned by regression).
552
+ - **Last-subscriber release.** An owning Worker learns a topic is unserved from the last subscriber's `CONTROL/UNSUBSCRIBE`: it drops the assignment *and* dispatches the release to its transport. Consuming the message inside the handoff short-circuit alone would leave the server subscription — and its inbound fan-out — alive after every tab has left.
551
553
  - **Stranded-handoff recovery.** If the previous owner is gone and its `ROUTE_RELEASED` never arrives (dropped channel message under load, or a crash between the route write and the ACK), the reconcile loop re-elects a live owner once the unconfirmed handoff has been stuck longer than a worker TTL (10 s default): the route is rewritten with a fresh generation and the handoff marker cleared, so the normal confirmation path completes (pinned by regression). The age gate matters — a fresh unconfirmed route may simply be waiting out its confirmation flush — and while the previous owner is still alive the new owner keeps waiting, so the strict handoff keeps its no-overlap guarantee.
552
554
  - **Loss and recovery matrix.** Each coordination message has a bounded recovery path: a lost `CONTROL/SUBSCRIBE` is re-sent by the heartbeat reconcile for any route still lacking `confirmedAt`; a lost `REGISTRY` nudge costs at most one heartbeat interval (3 s default) because every tick reconciles anyway; a lost `ROUTE_RELEASED` is recovered by reconcile re-election once the previous owner is gone and the handoff has been stuck longer than a worker TTL (see the stranded-handoff invariant above, pinned by regression); publications dropped during a transport disconnect window are the one documented unrecoverable loss (transport contract). The storage-event fallback channel guarantees value-change delivery via a monotonic sequence in the envelope, and a dropped dispatch recovers through the same reconcile loop.
553
555
  - **Recovery diagnostics.** `getHealthSummary()` derives a single readiness verdict from the lifecycle flags (`stopped` / `starting` / `healthy` / `recovering` / `suspended` / `degraded`); the unified `lastFailure` ledger and persistence counters reset on every explicit `start()`.
@@ -2,19 +2,19 @@
2
2
 
3
3
  # Browser Benchmark Trend
4
4
 
5
- > Data through 2026-09-21, from the 40 archived `bench-results/browser-*.json` reports (run `pnpm bench:browser` to add one; regenerate this doc with `node scripts/bench-trend.mjs`).
5
+ > Data through 2026-09-21, from the 42 archived `bench-results/browser-*.json` reports (run `pnpm bench:browser` to add one; regenerate this doc with `node scripts/bench-trend.mjs`).
6
6
 
7
7
  The comparison baseline for release gating is `pnpm bench:compare --fail-above-pct 50`, which compares the newest report against the median of the same metric in the preceding reports (50% ceiling absorbs shared-runner noise; a single previous report was a fragile baseline because the in-page hot-path metrics alternate between a fast and a slow mode on identical code). This doc records the long-run picture: values are per-metric latencies where lower is better, and the last column is the best run inside the most recent 5 reports — not an all-time record, because the in-page matrix changed measurement semantics in early September 2026 and older reports are not comparable.
8
8
 
9
9
  <!-- BENCH-TREND:BEGIN (machine-generated table) -->
10
10
  | Metric | Previous (ms) | Latest (ms) | Δ | Best of last 5 runs (ms) |
11
11
  |---|---|---|---|---|
12
- | publish per-message (ms, lower is better) — dedicated | 49.7556 | 49.4012 | -0.35 | 40.4432 |
13
- | publish per-message (ms, lower is better) — shared | 34.1052 | 33.8616 | -0.24 | 33.8616 |
14
- | wildcard dispatch ×1000 (ms, lower is better) | 5.4 | 6.8 | +1.40 | 5.4 |
15
- | publishBatch ×1000 (ms, lower is better) | 4.2 | 3.5 | -0.70 | 3.5 |
16
- | dedup ×1000 (ms, lower is better) | 11 | 10.6 | -0.40 | 9.8 |
17
- | trace + publish ×1000 (ms, lower is better) | 4.8 | 4.6 | -0.20 | 4.5 |
12
+ | publish per-message (ms, lower is better) — dedicated | 38.6243 | 46.6942 | +8.07 | 38.6243 |
13
+ | publish per-message (ms, lower is better) — shared | 33.7123 | 44.7673 | +11.05 | 33.7123 |
14
+ | wildcard dispatch ×1000 (ms, lower is better) | 5.8 | 6.7 | +0.90 | 5.4 |
15
+ | publishBatch ×1000 (ms, lower is better) | 3.7 | 4.6 | +0.90 | 3.5 |
16
+ | dedup ×1000 (ms, lower is better) | 24.3 | 15.3 | -9.00 | 10.6 |
17
+ | trace + publish ×1000 (ms, lower is better) | 6.6 | 7.1 | +0.50 | 4.6 |
18
18
  | first-packet cold dispatch (ms, lower is better) | 0.1 | 0 | -0.10 | 0 |
19
19
  <!-- BENCH-TREND:END -->
20
20
 
@@ -197,6 +197,8 @@ The fallback is opt-in because coordination payloads (plaintext topic names) the
197
197
 
198
198
  Before `1.0.0` the SDK is allowed to grow additively and, behind an explicit deprecation cycle, remove APIs. The root export surface is pinned by the regression suite and a tag-to-tag compatibility gate, so an unintended removal fails CI rather than silently breaking consumers.
199
199
 
200
+ Currently deprecated: an empty topic string in `subscribe()`, `publish()` and `publishBatch()`. Calls with `""` still work and the bus warns once per instance, but no transport can address an empty channel, so nothing is ever delivered through it — the warning is about a subscription that cannot function, and a future minor will reject it outright.
201
+
200
202
  When you upgrade:
201
203
 
202
204
  - Read the CHANGELOG for each version between your current and target version. Every removal is called out there, and the deprecation cycle itself only forwards through minor versions.
package/docs/roadmap.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Roadmap
2
2
 
3
- 0.20.95 was released on September 22, 2026. The project is intentionally continuing through reliability-focused releases before a 1.0.0 stability freeze.
3
+ 0.20.96 was released on September 22, 2026. The project is intentionally continuing through reliability-focused releases before a 1.0.0 stability freeze.
4
+
5
+ ## 0.20.96 delivered scope
6
+
7
+ - Opened the project's first deprecation cycle: an empty topic (`""`) now warns once per bus in `subscribe()`, `publish()` and `publishBatch()` instead of silently registering a channel no transport can address. Behaviour is unchanged; a future minor rejects it at that boundary, following the pre-1.0 policy. The contract is documented in the API reference and in the upgrading guide, in both languages.
8
+ - Closed the coverage-leg ledger with proof instead of assumption: seven behaviors that could not fail their tests are now mutation-verified — the departing-owner handoff that deletes an unserved route rather than migrating it onto a live peer, the owner releasing its transport subscription when the last remote subscriber leaves, a cancelled durable-retention sweep staying silent, a superseded hydration snapshot being dropped instead of merged, the default platform `WebSocket` construction including subprotocols, `ready()` surfacing the recorded transport error after the recovery budget is spent, and the Vue adapter containing a rejected `ready()`.
9
+ - Every remaining zero-count branch in `src` is now classified as dominated, unreachable by construction, or a missing boundary check (which is what produced the deprecation above). `vue.ts` and `hooks.ts` reach 100% on all four metrics and `cluster.ts` is down to a single uncovered line.
10
+ - `AGENTS.md` records the traps that made early drafts decorative: a `ChannelHub`-sharing peer heals the state under observation, a peer started without a microtask flush is invisible, and textually duplicated guards let a non-global mutation edit the wrong copy.
11
+ - `typescript-eslint` refreshed to `8.70.1`; TypeScript stays at `6.0.3` while the lint toolchain's peer range excludes 7.x.
4
12
 
5
13
  ## 0.20.95 delivered scope
6
14
 
package/docs/zh/api.md CHANGED
@@ -95,6 +95,7 @@ subscribe(
95
95
  - transport 尚未 ready 时订阅自动排队;transport 恢复待定时同样如此:订阅会挂在恢复门之后,等重开成功才下发,而不会写入刚刚上报 `error` 的连接。
96
96
  - 显式 `stop()` 尚未 settle 时发起的订阅不会登记:`subscribe()` 通过 `onError` 上报并返回 no-op 释放函数。调用方应等待 `stop()` settle,再调用 `start()` 后重新订阅。
97
97
  - 通配符订阅:以 `.*` 结尾的 Topic(如 `chat.*`)匹配任意后缀,`*` 匹配全部。pattern 以字面量参与路由、归属与传输订阅;携带匹配的具体 topic(或 pattern 本身)的发布都会投递给通配 handler。匹配规则见下方 `topicMatchesPattern`。
98
+ - Topic 必须非空。`''` 目前仍以字面量 channel 参与路由,但没有任何 transport 能寻址它,因此永远不会投递消息;实例第一次以空 topic 调用 `subscribe`/`publish`/`publishBatch` 时会输出一条 `console.warn`。后续小版本会在该边界直接拒绝空 topic,与选项校验保持一致。
98
99
  - 重放(可选):构造 bus 时传 `replay: { maxPerTopic }` 开启缓冲,`maxPerTopic` 必须是正安全整数;`subscribe()` 第三个参数传 `{ replay: true | n }` 后,新 handler 会立即收到缓冲历史(最多 `n` 条,受 `maxPerTopic` 上限约束,默认 100),消息带 `message.replayed: true` 标记——晚加入的 handler 不会错过更早的发布。只有被分发过的消息才入缓冲(无本地订阅者的 topic 会被 owner 丢弃);缓冲仅存内存,该 topic 最后一个 handler 退订时清空。通配订阅会对所有匹配 pattern 的已缓冲 topic 做回放。需要跨 reload/BFCache 持久化时,可传入 `createIndexedDbReplayPersistence({ maxPerTopic })` 创建的 `persistence`;持久化为异步操作,失败会通过 `onError` 报告,不影响实时投递。设置 `retentionMs` 后会清理内存中过期的 producer-timestamped 历史,并通过实现 `clearBefore` 的 adapter 在 hydrate 和追加后清理 durable 历史。设置 `persistenceRetry: { maxAttempts, backoffMs }` 可重试瞬时持久化失败;默认仍保持单次尝试。设置 `pruneStrategy` 为 `'count'`(默认)、`'age'` 或 `'both'`,分别表示按 `maxPerTopic` 截断、按 `retentionMs` 清理带时间戳历史,或两者都应用。`age` 下无时间戳的 legacy 条目会保留,但受 `maxPerTopic` 限制;带时间戳条目由 retention 窗口约束。
99
100
  启用 trace 后,重试会发出 `reliability` 事件,包含 `operation: 'persistence_retry'`、有界的 `persistenceOperation` 和 `attempt`。
100
101
 
@@ -519,6 +519,8 @@ Transport 消息 → isAssigned(topic)? → 是 → broadcastEvent(EVENT)
519
519
  - **隐藏文档的激活守卫。** `WorkerClusterRuntime.start()` 会先安装 lifecycle listener 再检查可见性。若启动时文档已隐藏,则只记录挂起状态,不注册 worker、不打开 channel,也不启动 heartbeat;因此排队在异步 stop 之后的重启不会漏掉清理期间的 `pagehide` 并在后台重连,后续 `pageshow` 会由已安装的 listener 恢复。
520
520
  - **挂起态就绪判定。** 挂起中的 bus 会把 `startPromise` 复用为 `pendingStop`(即 chained `transport.stop()` 的 gate),该 Promise 只能证明清理完成,不能证明可以承载数据。`ready()` 在 `stopping` 门之后检查 `suspended`,以挂起态错误 reject,而不是返回 stop gate;`pageshow`/`reopenTransport()` 与显式 `start()` 会清除标记并安装真正的重开 Promise,使 `ready()` 跟随最新生命周期意图。`getHealthSummary()` 原本就报告 `{ healthy: false, state: 'suspended' }`,reject 让 `ready()` 与该判定保持一致。由于 `pagehide` 会独立于 transport 暂停 cluster,显式 `start()` 在解除挂起时也必须一并恢复 cluster;否则 bus 会报告 transport 健康,而 channel listener、heartbeat 与 route 分配仍保持休眠直到下一次 `pageshow`,所有入站 publication 都会因 `isAssigned()` 对照已清空的分配表而被丢弃。
521
521
  - **交接通道关闭顺序。** `pause()` 将物理 `channel.close()` 推迟一个任务。同步关闭会丢弃仍在排队等待投递的消息(包括交接的 `ROUTE_RELEASED`),使交接目标持有未确认路由。
522
+ - **无人订阅路由的删除。** 离开的 owner 只交接仍有订阅者的路由。若它拥有的某条路由,其剩余订阅记录已全部消失(某个 peer Tab 未释放就死亡),则该路由被删除而不是交给仍然存活的 peer——否则那个 peer 会背负一个没有任何 Tab 监听的 transport 订阅。`pause()` 不执行孤儿路由清理(该逻辑在 `reconcile` 中),因此这是对该记录唯一的同步释放(由回归测试固定)。
523
+ - **最后一个订阅者的释放。** owner Worker 通过最后一个订阅者发来的 `CONTROL/UNSUBSCRIBE` 得知某 Topic 已无人订阅:它会同时丢弃本地 ownership 并把释放动作派发给自己的 transport。若只在交接短路里消费该消息,server 订阅(以及它的入站扇出)会在所有 Tab 离开后依然存活。
522
524
  - **悬挂交接恢复。** 若前任 owner 已消失而其 `ROUTE_RELEASED` 始终未到达(高负载下通道消息丢失,或 route 写入与 ACK 发送之间崩溃),reconcile 循环会在该未确认交接悬挂超过一个 worker TTL(默认 10 秒)后重新选举存活 owner:路由以全新 generation 重写并清除交接标记,使常规确认路径得以完成(已有回归固化)。年龄门限很关键——刚写入的未确认路由可能只是在等确认落盘,不能误判为悬挂;而只要前任 owner 仍然存活,新 owner 会继续等待,因此严格交接的无重叠保证不受影响。
523
525
  - **丢失与恢复矩阵。** 每类协调消息都有有界恢复路径:丢失的 `CONTROL/SUBSCRIBE` 由心跳 reconcile 对未确认路由重发;丢失的 `REGISTRY` 通知最多损失一个心跳间隔(默认 3 秒),因为每次 tick 都会 reconcile;丢失的 `ROUTE_RELEASED` 由 reconcile 在前任 owner 消失且交接悬挂超过一个 worker TTL 后重新选举恢复(见上文悬挂交接不变量,已有回归固化);transport 断连窗口内被丢弃的 publication 是唯一文档化的不可恢复丢失(transport 契约)。storage-event 降级通道通过信封内的单调序列号保证变值投递,丢失的派发由同一 reconcile 循环恢复。
524
526
  - **恢复诊断。** `getHealthSummary()` 从生命周期标志推导单一就绪判定(`stopped` / `starting` / `healthy` / `recovering` / `suspended` / `degraded`);统一的 `lastFailure` 账本与持久化计数在每次显式 `start()` 后重置。
@@ -2,19 +2,19 @@
2
2
 
3
3
  # 浏览器基准趋势
4
4
 
5
- > 数据截至 2026-09-21,基于 40 份归档的 `bench-results/browser-*.json` 报告(运行 `pnpm bench:browser` 追加一份;用 `node scripts/bench-trend.mjs` 重新生成本文档)。
5
+ > 数据截至 2026-09-21,基于 42 份归档的 `bench-results/browser-*.json` 报告(运行 `pnpm bench:browser` 追加一份;用 `node scripts/bench-trend.mjs` 重新生成本文档)。
6
6
 
7
7
  发布门禁的对比基线是 `pnpm bench:compare --fail-above-pct 50`:将最新报告与其之前若干报告中同一指标的中位数比较(50% 上限用于吸收共享 runner 的噪声;此前只看"上一份报告"并不稳定,因为页内热路径指标在同一份代码上会在快/慢两档之间来回跳)。本文记录长期趋势:数值为逐指标延迟,越低越好;最后一列是最近 5 份报告内的最优值,而不是历史纪录——页内基准矩阵在 2026 年 9 月初变更过测量语义,更早的报告不可比。
8
8
 
9
9
  <!-- BENCH-TREND:BEGIN (machine-generated table) -->
10
10
  | 指标 | 上次 (ms) | 本次 (ms) | Δ | 近 5 次最优 (ms) |
11
11
  |---|---|---|---|---|
12
- | publish per-message (ms, lower is better) — dedicated | 49.7556 | 49.4012 | -0.35 | 40.4432 |
13
- | publish per-message (ms, lower is better) — shared | 34.1052 | 33.8616 | -0.24 | 33.8616 |
14
- | wildcard dispatch ×1000 (ms, lower is better) | 5.4 | 6.8 | +1.40 | 5.4 |
15
- | publishBatch ×1000 (ms, lower is better) | 4.2 | 3.5 | -0.70 | 3.5 |
16
- | dedup ×1000 (ms, lower is better) | 11 | 10.6 | -0.40 | 9.8 |
17
- | trace + publish ×1000 (ms, lower is better) | 4.8 | 4.6 | -0.20 | 4.5 |
12
+ | publish per-message (ms, lower is better) — dedicated | 38.6243 | 46.6942 | +8.07 | 38.6243 |
13
+ | publish per-message (ms, lower is better) — shared | 33.7123 | 44.7673 | +11.05 | 33.7123 |
14
+ | wildcard dispatch ×1000 (ms, lower is better) | 5.8 | 6.7 | +0.90 | 5.4 |
15
+ | publishBatch ×1000 (ms, lower is better) | 3.7 | 4.6 | +0.90 | 3.5 |
16
+ | dedup ×1000 (ms, lower is better) | 24.3 | 15.3 | -9.00 | 10.6 |
17
+ | trace + publish ×1000 (ms, lower is better) | 6.6 | 7.1 | +0.50 | 4.6 |
18
18
  | first-packet cold dispatch (ms, lower is better) | 0.1 | 0 | -0.10 | 0 |
19
19
  <!-- BENCH-TREND:END -->
20
20
 
@@ -197,6 +197,8 @@ const bus = new CrossTabDataBus({
197
197
 
198
198
  在 `1.0.0` 之前,SDK 允许增量新增,并在明确的弃用周期后才移除 API。根导出面由回归套件与 tag 间兼容性门禁钉住,意外删除会令 CI 失败,而不是静默破坏既有消费者。
199
199
 
200
+ 当前处于弃用中:`subscribe()`、`publish()`、`publishBatch()` 的空 topic 字符串。传入 `""` 的调用仍然可用,实例首次遇到时会输出一条 `console.warn`,但没有任何 transport 能寻址空 channel,因此经由它的订阅永远不会收到消息——警告针对的是一个无法工作的订阅,后续小版本会直接拒绝它。
201
+
200
202
  升级时请注意:
201
203
 
202
204
  - 逐版阅读当前版本到目标版本之间每个版本的 CHANGELOG。每次移除都会在其中明确指出,且弃用周期只在小版本间顺延。
@@ -1,6 +1,14 @@
1
1
  # 路线图
2
2
 
3
- 0.20.95 已于 2026 年 9 月 22 日发布。项目会先持续完成可靠性发布,再进入 1.0.0 稳定性冻结。
3
+ 0.20.96 已于 2026 年 9 月 22 日发布。项目会先持续完成可靠性发布,再进入 1.0.0 稳定性冻结。
4
+
5
+ ## 0.20.96 已完成范围
6
+
7
+ - 开启项目第一个弃用周期:空 topic(`""`)现在会在 `subscribe()`、`publish()`、`publishBatch()` 中每个 bus 实例告警一次,而不再静默登记一个没有任何 transport 能寻址的 channel。行为保持不变;按 pre-1.0 策略,后续小版本会在该边界直接拒绝。契约已写入 API 参考与升级指南(中英双语)。
8
+ - 用证明取代假设,清空覆盖率分支台账:七个"测试根本不可能失败"的行为获得经变异验证的回归用例——离开方 owner 删除无人订阅路由而非交接给存活 peer、最后一个远端订阅者离开时 owner 释放自身 transport 订阅、被取消的持久化清扫保持静默、被取代的水合快照被丢弃而非合并、默认平台 `WebSocket` 构造(含子协议)、恢复预算耗尽后 `ready()` 交出真实传输错误,以及 Vue 适配层吞掉被拒绝的 `ready()`。
9
+ - `src` 中其余零计数分支已全部归类:被支配、按构造不可达,或属于缺失的边界校验(正是它引出了上面的弃用项)。`vue.ts` 与 `hooks.ts` 四项指标均达 100%,`cluster.ts` 只剩一行未覆盖。
10
+ - `AGENTS.md` 记下让早期草稿变成装饰性测试的陷阱:共享 `ChannelHub` 的 peer 会自愈被观测的状态、缺少一次 microtask flush 的 peer 对其他 Tab 不可见、文本重复的守卫会让非全局替换改到错的那一份。
11
+ - `typescript-eslint` 升级到 `8.70.1`;在 lint 工具链的 peer 范围仍排除 7.x 期间,TypeScript 保持 `6.0.3`。
4
12
 
5
13
  ## 0.20.95 已完成范围
6
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cross-tab-worker-databus",
3
- "version": "0.20.95",
3
+ "version": "0.20.96",
4
4
  "description": "Framework-agnostic cross-tab data bus with Dedicated/Shared Worker clustering and Centrifuge support.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -138,7 +138,7 @@
138
138
  "react": "^19.3.0",
139
139
  "react-dom": "^19.3.0",
140
140
  "typescript": "^6.0.3",
141
- "typescript-eslint": "^8.70.0",
141
+ "typescript-eslint": "^8.70.1",
142
142
  "vitest": "^5.0.1",
143
143
  "vue": "^3.5.43"
144
144
  },