cross-tab-worker-databus 0.21.0 → 0.21.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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.21.2] - 2026-09-22
4
+
5
+ ### Changed
6
+ - One unreachable defensive branch removed, with no behavior change: `performStop()` awaited its pending transport stop through `.catch(() => undefined)`, but that absorption could never run — `pendingStop` is assigned non-null in exactly two places (`openTransport`'s failure path via `createStopPromise()`, and `suspendTransport()`'s stop chained behind the in-flight open) and both chains already end in a terminal `.catch(error => this.reportError(error))` that resolves, so the failure is recorded where it is produced. The neighbouring `startPromise?.catch(() => undefined)` is kept, because that promise *does* reject: it holds the opening a failing `ready()` reports to its caller. Naming which kind of arm each one is is now written into the source and into `AGENTS.md`, since the difference decides whether deleting it is a cleanup or a regression.
7
+ - No public surface, no observable behavior and no protocol changed; `verify:compat` is green against `v0.21.1` by construction. Whole-suite coverage moves from 98.68 / 96.16 / 98.54 / 99.45 to 98.71 / 96.16 / 98.72 / 99.45 (one fewer uncovered function, no test deleted or weakened).
8
+
9
+ ## [0.21.1] - 2026-09-22
10
+
11
+ ### Added
12
+ - `pnpm build:examples` bundles the React example page's framework dependencies (`react`, `react-dom/client`) out of the local install into `examples/react/vendor/react.esm.js`, which is gitignored and regenerated by `pnpm examples` and `pnpm test:e2e`. React ships no browser ESM build, so the page used to import React from `esm.sh` — which meant it could not load where CI has no network, and it was pinned to React 18 while the library's own React tests run against 19.
13
+
14
+ ### Changed
15
+ - `e2e/adapters.spec.ts` now drives both example pages with one set of cases (fan-out, reactive rebind, delivery after the owning tab closes, and the cleared-topic-box fallback), because the two pages expose the same surface: `#topicInput`/`#publishButton`/`#messageList` ids, a `?topic=` override, and a `__vueBus`/`__reactBus` diagnostics hook. The React page gained those ids, the query override, a topic badge and the hook — it hand-wires the core API rather than importing `cross-tab-worker-databus/hooks`, so a failure that shows up for one page and not the other localizes to the adapter instead of to the library. All four cases pass against both pages, and the fallback leg was verified by mutation on each.
16
+ - `docs/getting-started.md` (en + zh) records that both adapter pages are browser-covered and need no network.
17
+ - One correction to the `0.21.0` entry below: it named the React adapter `cross-tab-worker-databus/react`, which is not an export this package has (`cross-tab-worker-databus/hooks` is). The published `0.21.0` release notes keep the original wording — npm versions and GitHub releases are not rewritten — so this fixes it for anyone reading between tags.
18
+
3
19
  ## [0.21.0] - 2026-09-22
4
20
 
5
21
  ### Breaking
@@ -7,7 +23,7 @@
7
23
 
8
24
  ### Changed
9
25
  - `examples/react` and `examples/vue` now resolve their topic as `topicInput.trim() || <default>`, matching what `examples/demo` already did, because their boxes feed a reactive subscription and would otherwise hand `""` straight to the bus. The failure mode the fallback prevents is measured rather than assumed: with it removed, the Vue page keeps rendering its *previous* topic while a `TypeError` escapes to `pageerror`, and the demo page lands on 错误 with an error-feed row that never mentions the field the user just emptied. Both pages are now driven in real browser tabs (`e2e/adapters.spec.ts`, `e2e/demo.spec.ts`), each arm of the guard killing a different mutant.
10
- - `docs/getting-started.md` (en + zh) claimed the browser suite covers both adapter pages. It covers the Vue page only — the React page loads React from `esm.sh`, so it cannot run where CI has no network, and it hand-wires the demo page's pattern rather than using the shipped `cross-tab-worker-databus/react` adapter (covered in jsdom by `tests/hooks.test.tsx`). The paragraph now says exactly that.
26
+ - `docs/getting-started.md` (en + zh) claimed the browser suite covers both adapter pages. It covers the Vue page only — the React page loads React from `esm.sh`, so it cannot run where CI has no network, and it hand-wires the demo page's pattern rather than using the shipped `cross-tab-worker-databus/hooks` adapter (covered in jsdom by `tests/hooks.test.tsx`). The paragraph now says exactly that.
11
27
 
12
28
  ## [0.20.97] - 2026-09-22
13
29
 
@@ -5,7 +5,7 @@ import {
5
5
  parseDataBusPublication,
6
6
  publicationMetadata,
7
7
  selectWorkerBackend
8
- } from "./chunk-EJDXU4DK.js";
8
+ } from "./chunk-HRB4SND7.js";
9
9
  import {
10
10
  CENTRIFUGE_INPUT_TYPE,
11
11
  CENTRIFUGE_OUTPUT_TYPE,
@@ -2346,7 +2346,7 @@ var DedupManager = class {
2346
2346
  };
2347
2347
 
2348
2348
  // src/core/version.ts
2349
- var SDK_VERSION = true ? "0.21.0" : "";
2349
+ var SDK_VERSION = true ? "0.21.2" : "";
2350
2350
 
2351
2351
  // src/core/data-bus.ts
2352
2352
  var DEFAULT_REPLAY_MAX_PER_TOPIC = 100;
@@ -3107,7 +3107,7 @@ var CrossTabDataBus = class {
3107
3107
  try {
3108
3108
  await this.startPromise?.catch(() => void 0);
3109
3109
  const pendingStop = this.pendingStop;
3110
- if (pendingStop) await pendingStop.catch(() => void 0);
3110
+ if (pendingStop) await pendingStop;
3111
3111
  else await this.transport.stop();
3112
3112
  } catch (error) {
3113
3113
  this.reportError(error);
@@ -3547,4 +3547,4 @@ export {
3547
3547
  parseDataBusPublication,
3548
3548
  selectWorkerBackend
3549
3549
  };
3550
- //# sourceMappingURL=chunk-EJDXU4DK.js.map
3550
+ //# sourceMappingURL=chunk-HRB4SND7.js.map