cross-tab-worker-databus 0.20.97 → 0.21.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.
@@ -196,7 +196,6 @@ export declare class CrossTabDataBus<TConfig = unknown, TData = unknown> {
196
196
  private recoveryCancellationToken;
197
197
  private recoveryDemandAllowed;
198
198
  private recoveryWaiters;
199
- private emptyTopicWarned;
200
199
  /** Monotonic generation incremented on every successful transport open.
201
200
  * Stays in lockstep with `lastSuccessAt` so callers can detect that the
202
201
  * transport has been reopened even if the timestamp window is short. */
@@ -271,6 +270,8 @@ export declare class CrossTabDataBus<TConfig = unknown, TData = unknown> {
271
270
  * unsubscribe function for convenience. During an explicit stop() the
272
271
  * registration is rejected through onError and a no-op cleanup is returned,
273
272
  * so a late subscriber cannot leak into a future restart.
273
+ * @throws {TypeError} when `topic` is `''` — no transport can address such a
274
+ * channel, so the subscription could never receive anything.
274
275
  */
275
276
  subscribe(topic: string, handler: DataBusMessageHandler<TData>, options?: {
276
277
  replay?: boolean | number;
@@ -290,12 +291,8 @@ export declare class CrossTabDataBus<TConfig = unknown, TData = unknown> {
290
291
  getDedupStats(): DataBusDedupStats;
291
292
  /** Drop all remembered IDs and reset dedup counters. */
292
293
  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;
298
- /** Publish a message to `topic`. The owning Worker delivers it to the transport. */
294
+ /** Publish a message to `topic`. The owning Worker delivers it to the transport.
295
+ * @throws {TypeError} when `topic` is `''`; see `subscribe()`. */
299
296
  publish(topic: string, data: unknown, options?: DataBusPublishOptions): void;
300
297
  /**
301
298
  * Burst-friendly variant of `publish()`: delivers `items` in a single
@@ -303,6 +300,9 @@ export declare class CrossTabDataBus<TConfig = unknown, TData = unknown> {
303
300
  * in one tick. Per-item dedup / replay / ordering is preserved; each item
304
301
  * may carry its own `messageId` / `timestamp` via `options`. Empty array is
305
302
  * a no-op; single-item array delegates to `publish()`.
303
+ * @throws {TypeError} when `topic` is `''`; see `subscribe()`. Checked before
304
+ * the empty-array no-op, so `publishBatch('', [])` throws too — the topic is
305
+ * the caller's bug regardless of whether anything is carried.
306
306
  */
307
307
  publishBatch(topic: string, items: ReadonlyArray<{
308
308
  data: unknown;
@@ -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,iBAAiB,CAAC;AAE9E,OAAO,EAGL,cAAc,EACd,YAAY,EAEZ,cAAc,EAUf,MAAM,oBAAoB,CAAC;AAO5B;;wBAEwB;AACxB;;;;mBAImB;AACnB,MAAM,WAAW,oBAAoB,CAAC,KAAK,GAAG,OAAO;IACnD;;;sBAGkB;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,WAAW,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC;IAC9C,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;qEAIiE;IACjE,aAAa,CAAC,EAAE,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;IACrE,sEAAsE;IACtE,gBAAgB,CAAC,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AkB;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-IVTDQ2KD.js";
23
+ } from "./chunk-EJDXU4DK.js";
24
24
  import {
25
25
  DEFAULT_STORAGE_PREFIX,
26
26
  PRUNE_STRATEGY,
@@ -65,6 +65,14 @@ export declare function assertClusterOptions(options: {
65
65
  * SharedWorker reaper is not needed, e.g. a single-tab deployment).
66
66
  * @throws {TypeError} when `value` is not a positive finite number or Infinity. */
67
67
  export declare function assertHeartbeatInterval(value: number): void;
68
+ /** Public topic boundary. An empty string is not a channel any transport can
69
+ * address: the cluster happily routes it as a literal topic key, but a Centrifuge
70
+ * channel or a WebSocket frame topic of `''` never matches a publication, so a
71
+ * subscription to it can never receive anything and a publication to it is
72
+ * dropped without a trace. Accepted-and-warned from 0.20.96, rejected from
73
+ * 0.21.0 so the mistake surfaces at the call instead of as missing data.
74
+ * @throws {TypeError} when `topic` is the empty string. */
75
+ export declare function assertPublicTopic(operation: string, topic: string): void;
68
76
  /** Validate that `value` is structured-cloneable. Throws early so config errors
69
77
  * surface on the main thread rather than silently failing inside the Worker
70
78
  * (where a DataCloneError would be reported as a generic Worker error with no
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts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K,EAAE,8BAA8B,GAAG,IAAI,CAOzF;AAED;8DAC8D;AAC9D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,GAAG,IAAI,CAiB/E;AAED;wEACwE;AACxE,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,GAAG,IAAI,CAanB;AAED;;;;;;;uBAOuB;AACvB,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,oBAAoB,GAAG,SAAS,GAAG,IAAI,CAUhG;AAED;;;;;;;;;;yCAUyC;AACzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE;IAC5C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,oBAAoB,CAAC;CACtC,GAAG,IAAI,CAcP;AAED;;;;;mFAKmF;AACnF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAM3D;AAED;;;;;;2DAM2D;AAC3D,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAKxE;AAED;;;;;;kCAMkC;AAClC,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAU9D"}
package/docs/api.md CHANGED
@@ -95,7 +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
+ - Topics must be non-empty: `subscribe()`, `publish()` and `publishBatch()` throw a `TypeError` when passed `''`, before any other effect (no start is requested and no handler is registered). No transport can address an empty channel, so a subscription to it could never receive anything, and a publication to it was dropped without a trace. `''` warned once per instance from 0.20.96 and became a rejection in 0.21.0, following the pre-1.0 deprecation policy; the guard sits with the option-validation asserts, so an empty topic fails the same way a bad `replay.maxPerTopic` does. `publishBatch('', [])` throws too — the invalid argument is checked ahead of the empty-array no-op.
99
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.
100
100
  When tracing is enabled, retries emit `reliability` events with `operation: 'persistence_retry'`, a bounded `persistenceOperation`, and `attempt`.
101
101
 
@@ -2,20 +2,20 @@
2
2
 
3
3
  # Browser Benchmark Trend
4
4
 
5
- > Data through 2026-09-22, from the 44 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-22, from the 46 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 | 50.6466 | 51.8687 | +1.22 | 38.6243 |
13
- | publish per-message (ms, lower is better) — shared | 34.0188 | 33.7528 | -0.27 | 33.7123 |
14
- | wildcard dispatch ×1000 (ms, lower is better) | 7.2 | 8.1 | +0.90 | 5.8 |
15
- | publishBatch ×1000 (ms, lower is better) | 4.7 | 4.7 | +0.00 | 3.5 |
16
- | dedup ×1000 (ms, lower is better) | 14.8 | 16.1 | +1.30 | 10.6 |
17
- | trace + publish ×1000 (ms, lower is better) | 6.3 | 5.7 | -0.60 | 4.6 |
18
- | first-packet cold dispatch (ms, lower is better) | 0 | 0 | +0.00 | 0 |
12
+ | publish per-message (ms, lower is better) — dedicated | 55.7209 | 55.1633 | -0.56 | 46.6942 |
13
+ | publish per-message (ms, lower is better) — shared | 37.1139 | 39.5561 | +2.44 | 33.7528 |
14
+ | wildcard dispatch ×1000 (ms, lower is better) | 6.5 | 7 | +0.50 | 6.5 |
15
+ | publishBatch ×1000 (ms, lower is better) | 4.5 | 5.1 | +0.60 | 4.5 |
16
+ | dedup ×1000 (ms, lower is better) | 16.6 | 12.1 | -4.50 | 12.1 |
17
+ | trace + publish ×1000 (ms, lower is better) | 5.3 | 4.8 | -0.50 | 4.8 |
18
+ | first-packet cold dispatch (ms, lower is better) | 0.1 | 0 | -0.10 | 0 |
19
19
  <!-- BENCH-TREND:END -->
20
20
 
21
21
  Notes:
@@ -150,7 +150,7 @@ Open `http://localhost:4173/examples/demo/` and open it in multiple browser Tabs
150
150
  - Data flow animations, event stream, distribution latency metrics, and cluster Worker routing status
151
151
  - SDK capability, transport configuration, active/standby Worker, and visible/hidden Tab state
152
152
 
153
- Two more pages are served next to the demo. `http://localhost:4173/examples/react/` wires the framework-agnostic core by hand (effect, `subscribe`, status), while `http://localhost:4173/examples/vue/` uses nothing but the shipped `cross-tab-worker-databus/vue` composables. Both point at the same local demo endpoint, so a publication from one is received by a tab on any of the three pages that uses the same Topic which is also how the adapter pages are covered by the browser suite (`e2e/adapters.spec.ts`).
153
+ Two more pages are served next to the demo. `http://localhost:4173/examples/react/` wires the framework-agnostic core by hand (effect, `subscribe`, status), while `http://localhost:4173/examples/vue/` uses nothing but the shipped `cross-tab-worker-databus/vue` composables. Both point at the same local demo endpoint, so a publication from one is received by a tab on any of the three pages that uses the same Topic. Only the Vue page is driven by the browser suite (`e2e/adapters.spec.ts`): the React page loads React itself from `esm.sh`, so it needs the network access CI does not have, and it hand-rolls the same effect/`subscribe`/status wiring the demo page uses rather than the `cross-tab-worker-databus/react` adapter — the shipped React hooks are covered by `tests/hooks.test.tsx` in jsdom instead.
154
154
 
155
155
  When consuming the repository directly through a Git dependency, use a pinned commit. The repository ships `dist` so consumers do not need to build the SDK during installation.
156
156
 
@@ -199,7 +199,7 @@ The fallback is opt-in because coordination payloads (plaintext topic names) the
199
199
 
200
200
  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.
201
201
 
202
- 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.
202
+ Nothing is currently deprecated. The one cycle the project has run is closed: an empty topic string in `subscribe()`, `publish()` and `publishBatch()` warned once per instance from 0.20.96 and is **rejected with a `TypeError` from 0.21.0**. Nothing else about those calls changed — the rejection happens before any other effect, so an empty topic no longer starts a transport, registers a handler, or writes a route for a channel no transport can address. To migrate, give the call a real channel name; if a topic comes from user input or a config field, validate or fall back before calling, the way the bundled example pages do (`input.trim() || 'demo.flow'`).
203
203
 
204
204
  When you upgrade:
205
205
 
package/docs/roadmap.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Roadmap
2
2
 
3
- 0.20.97 was released on September 22, 2026. The project is intentionally continuing through reliability-focused releases before a 1.0.0 stability freeze.
3
+ 0.21.0 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.21.0 delivered scope
6
+
7
+ - The project's first deprecation cycle is closed: `subscribe("")`, `publish("")` and `publishBatch("")` throw a `TypeError` where `0.20.96` warned once per instance. The guard sits beside the option-validation asserts and runs before every other effect, so a rejected call starts no transport, registers no handler and writes no route record — and `publishBatch("", [])` is rejected ahead of the documented empty-array no-op.
8
+ - That boundary is carried by two tests rather than one. The empty-array case exists because every other empty-topic batch is still refused *by `publish()`* through the single-item delegation, so a guard sitting below the no-op returns silently and nothing else notices; each message naming the operation the caller used is pinned for the same reason.
9
+ - The React and Vue example pages gained the topic fallback the demo page already had, and the two new browser tests first recorded what its absence actually does — `TypeError: CrossTabDataBus.subscribe("")` surfacing as a `pageerror` while the Vue tab keeps rendering its previous topic, and an 错误 event-feed row on the demo page. `||` versus `??` and trim versus no-trim each die at a different arm, verified by mutation.
10
+ - `docs/getting-started.md` (en + zh) no longer overstates the browser suite's reach: only the Vue adapter page is driven in a browser, because the React page loads React itself from `esm.sh` and cannot load where CI has no network. That page's topic fallback is consequently the one path in this change checked by hand rather than by a gate.
11
+ - Coverage ceilings untouched and still met (98.68 / 96.16 / 98.54 / 99.45 against 96 / 92 / 96 / 97); the release adds one unit test to `pnpm check` and two cases to the browser job.
4
12
 
5
13
  ## 0.20.97 delivered scope
6
14
 
@@ -14,7 +22,7 @@
14
22
 
15
23
  ## 0.20.96 delivered scope
16
24
 
17
- - 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.
25
+ - 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 — which `0.21.0` did. The contract is documented in the API reference and in the upgrading guide, in both languages.
18
26
  - Closed the coverage-leg ledger with proof instead of assumption: eleven 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, the Vue adapter containing a rejected `ready()`, a `connectTimeoutMs` of `0` or `Infinity` genuinely waiting forever, a private topic leaving no route record when its only holder hides, the trace reporter containing a throwing sink on a runtime with no `console.warn`, and an unrelated owned wildcard pattern failing to capture a batch bound for a remote topic.
19
27
  - 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.
20
28
  - `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.
package/docs/zh/api.md CHANGED
@@ -95,7 +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
+ - Topic 必须非空:`subscribe()`、`publish()`、`publishBatch()` 传入 `''` 时会抛出 `TypeError`,且在任何其他副作用之前(不会请求 start,也不会登记 handler)。没有任何 transport 能寻址空 channel,因此对它的订阅永远收不到消息,向它的发布也会被无声丢弃。`''` 自 0.20.96 起每个实例告警一次,自 0.21.0 起直接拒绝——遵循 1.0 前的弃用策略;该守卫与选项校验断言放在一起,空 topic 与非法 `replay.maxPerTopic` 以同样方式失败。`publishBatch('', [])` 同样抛错:非法参数先于空数组 no-op 检查。
99
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 窗口约束。
100
100
  启用 trace 后,重试会发出 `reliability` 事件,包含 `operation: 'persistence_retry'`、有界的 `persistenceOperation` 和 `attempt`。
101
101
 
@@ -2,20 +2,20 @@
2
2
 
3
3
  # 浏览器基准趋势
4
4
 
5
- > 数据截至 2026-09-22,基于 44 份归档的 `bench-results/browser-*.json` 报告(运行 `pnpm bench:browser` 追加一份;用 `node scripts/bench-trend.mjs` 重新生成本文档)。
5
+ > 数据截至 2026-09-22,基于 46 份归档的 `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 | 50.6466 | 51.8687 | +1.22 | 38.6243 |
13
- | publish per-message (ms, lower is better) — shared | 34.0188 | 33.7528 | -0.27 | 33.7123 |
14
- | wildcard dispatch ×1000 (ms, lower is better) | 7.2 | 8.1 | +0.90 | 5.8 |
15
- | publishBatch ×1000 (ms, lower is better) | 4.7 | 4.7 | +0.00 | 3.5 |
16
- | dedup ×1000 (ms, lower is better) | 14.8 | 16.1 | +1.30 | 10.6 |
17
- | trace + publish ×1000 (ms, lower is better) | 6.3 | 5.7 | -0.60 | 4.6 |
18
- | first-packet cold dispatch (ms, lower is better) | 0 | 0 | +0.00 | 0 |
12
+ | publish per-message (ms, lower is better) — dedicated | 55.7209 | 55.1633 | -0.56 | 46.6942 |
13
+ | publish per-message (ms, lower is better) — shared | 37.1139 | 39.5561 | +2.44 | 33.7528 |
14
+ | wildcard dispatch ×1000 (ms, lower is better) | 6.5 | 7 | +0.50 | 6.5 |
15
+ | publishBatch ×1000 (ms, lower is better) | 4.5 | 5.1 | +0.60 | 4.5 |
16
+ | dedup ×1000 (ms, lower is better) | 16.6 | 12.1 | -4.50 | 12.1 |
17
+ | trace + publish ×1000 (ms, lower is better) | 5.3 | 4.8 | -0.50 | 4.8 |
18
+ | first-packet cold dispatch (ms, lower is better) | 0.1 | 0 | -0.10 | 0 |
19
19
  <!-- BENCH-TREND:END -->
20
20
 
21
21
  说明:
@@ -150,7 +150,7 @@ pnpm examples
150
150
  - 数据流动画、事件流、分发延迟指标和集群 Worker 路由状态
151
151
  - SDK 能力、transport 配置、活跃/等待 Worker 与可见/隐藏 Tab 状态
152
152
 
153
- 演示页之外还有两个页面:`http://localhost:4173/examples/react/` 手写接入与框架无关的核心 API(effect、`subscribe`、状态),`http://localhost:4173/examples/vue/` 则只使用已发布的 `cross-tab-worker-databus/vue` 组合式 API。二者都连到同一个本地 demo 端点,因此其中一个页面发布的数据会被三个页面里任何使用同一 Topic 的标签页收到——适配器页面也正是这样被浏览器测试覆盖的(`e2e/adapters.spec.ts`)。
153
+ 演示页之外还有两个页面:`http://localhost:4173/examples/react/` 手写接入与框架无关的核心 API(effect、`subscribe`、状态),`http://localhost:4173/examples/vue/` 则只使用已发布的 `cross-tab-worker-databus/vue` 组合式 API。二者都连到同一个本地 demo 端点,因此其中一个页面发布的数据会被三个页面里任何使用同一 Topic 的标签页收到。浏览器测试(`e2e/adapters.spec.ts`)只驱动 Vue 页:React 页的 React 本身来自 `esm.sh`,需要 CI 不具备的网络访问;而且它手写的是 demo 页那套 effect/`subscribe`/状态接入,并未使用 `cross-tab-worker-databus/react` 适配器——已发布的 React hooks 由 `tests/hooks.test.tsx` 在 jsdom 中覆盖。
154
154
 
155
155
  通过 Git 依赖直接接入仓库时,应固定到具体 commit。仓库随代码提供 `dist`,消费方安装时无需构建 SDK。
156
156
 
@@ -199,7 +199,7 @@ const bus = new CrossTabDataBus({
199
199
 
200
200
  在 `1.0.0` 之前,SDK 允许增量新增,并在明确的弃用周期后才移除 API。根导出面由回归套件与 tag 间兼容性门禁钉住,意外删除会令 CI 失败,而不是静默破坏既有消费者。
201
201
 
202
- 当前处于弃用中:`subscribe()`、`publish()`、`publishBatch()` 的空 topic 字符串。传入 `""` 的调用仍然可用,实例首次遇到时会输出一条 `console.warn`,但没有任何 transport 能寻址空 channel,因此经由它的订阅永远不会收到消息——警告针对的是一个无法工作的订阅,后续小版本会直接拒绝它。
202
+ 当前没有处于弃用中的 API。项目唯一一次弃用周期已经结束:`subscribe()`、`publish()`、`publishBatch()` 的空 topic 字符串自 0.20.96 起每个实例告警一次,**自 0.21.0 起改为抛出 `TypeError`**。这些调用的其他语义都没有变化——拒绝发生在任何副作用之前,因此空 topic 不再请求 start、登记 handler,或为没有任何 transport 能寻址的 channel 写入路由。迁移方式是给出真实的 channel 名称;若 topic 来自用户输入或配置字段,请在调用前校验或回退,随仓库附带的示例页就是这样做的(`input.trim() || 'demo.flow'`)。
203
203
 
204
204
  升级时请注意:
205
205
 
@@ -1,6 +1,14 @@
1
1
  # 路线图
2
2
 
3
- 0.20.97 已于 2026 年 9 月 22 日发布。项目会先持续完成可靠性发布,再进入 1.0.0 稳定性冻结。
3
+ 0.21.0 已于 2026 年 9 月 22 日发布。项目会先持续完成可靠性发布,再进入 1.0.0 稳定性冻结。
4
+
5
+ ## 0.21.0 已完成范围
6
+
7
+ - 项目第一个弃用周期正式结束:`subscribe("")`、`publish("")`、`publishBatch("")` 由 `0.20.96` 的每实例告警一次改为抛出 `TypeError`。守卫与选项校验断言放在一起,且先于其他任何副作用执行,因此被拒绝的调用不会请求 start、不会登记 handler,也不会写入路由记录——`publishBatch("", [])` 同样先于文档承诺的"空数组 no-op"被拒绝。
8
+ - 这条边界由两个用例而不是一个撑起:空数组用例的存在,是因为其他任何空 topic 批量调用都会经由单条目委托被 `publish()` 拒掉,所以放在 no-op 之后的守卫会静默返回且无人察觉;每条报错都使用调用方实际使用的方法名,原因也是这个。
9
+ - React 与 Vue 示例页获得 demo 页早就有的 topic 回退,而两个新的浏览器用例先记录了"没有回退会发生什么"——`TypeError: CrossTabDataBus.subscribe("")` 以 `pageerror` 冒出来,同时 Vue 标签页仍在渲染它上一个 topic;demo 页则落到 错误 并留下一条事件流错误行。`||` 与 `??`、有无 `trim()` 各被不同的断言臂杀掉,均经变异验证。
10
+ - `docs/getting-started.md`(中英双语)不再夸大浏览器测试的覆盖面:只有 Vue 适配页会在真实浏览器里被驱动,因为 React 页的 React 本身来自 `esm.sh`,在没有网络的 CI 里根本加载不起来。该页的 topic 回退因此是本次变更唯一靠手工验证、而非靠门禁覆盖的路径。
11
+ - 覆盖率上限保持不变且仍然达标(98.68 / 96.16 / 98.54 / 99.45,对应下限 96 / 92 / 96 / 97);这个版本向 `pnpm check` 增加一个单元用例,向浏览器作业增加两个用例。
4
12
 
5
13
  ## 0.20.97 已完成范围
6
14
 
@@ -14,7 +22,7 @@
14
22
 
15
23
  ## 0.20.96 已完成范围
16
24
 
17
- - 开启项目第一个弃用周期:空 topic(`""`)现在会在 `subscribe()`、`publish()`、`publishBatch()` 中每个 bus 实例告警一次,而不再静默登记一个没有任何 transport 能寻址的 channel。行为保持不变;按 pre-1.0 策略,后续小版本会在该边界直接拒绝。契约已写入 API 参考与升级指南(中英双语)。
25
+ - 开启项目第一个弃用周期:空 topic(`""`)现在会在 `subscribe()`、`publish()`、`publishBatch()` 中每个 bus 实例告警一次,而不再静默登记一个没有任何 transport 能寻址的 channel。行为保持不变;按 pre-1.0 策略,后续小版本会在该边界直接拒绝——`0.21.0` 已完成这一步。契约已写入 API 参考与升级指南(中英双语)。
18
26
  - 用证明取代假设,清空覆盖率分支台账:十一个"测试根本不可能失败"的行为获得经变异验证的回归用例——离开方 owner 删除无人订阅路由而非交接给存活 peer、最后一个远端订阅者离开时 owner 释放自身 transport 订阅、被取消的持久化清扫保持静默、被取代的水合快照被丢弃而非合并、默认平台 `WebSocket` 构造(含子协议)、恢复预算耗尽后 `ready()` 交出真实传输错误、Vue 适配层吞掉被拒绝的 `ready()`、把 `connectTimeoutMs` 设为 0 或 Infinity 时确实无限等待、私有 topic 在其唯一持有者隐藏时不留路由记录、在没有 `console.warn` 的运行时吞掉抛错的 trace sink,以及无关的已持有通配符 pattern 无法截获发往远端 topic 的批量消息。
19
27
  - `src` 中其余零计数分支已全部归类:被支配、按构造不可达,或属于缺失的边界校验(正是它引出了上面的弃用项)。`vue.ts` 与 `hooks.ts` 四项指标均达 100%,`cluster.ts` 只剩一行未覆盖。
20
28
  - `AGENTS.md` 记下让早期草稿变成装饰性测试的陷阱:共享 `ChannelHub` 的 peer 会自愈被观测的状态、缺少一次 microtask flush 的 peer 对其他 Tab 不可见、文本重复的守卫会让非全局替换改到错的那一份。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cross-tab-worker-databus",
3
- "version": "0.20.97",
3
+ "version": "0.21.0",
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",