cross-tab-worker-databus 0.21.46 → 0.21.48
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 +40 -0
- package/dist/centrifuge.d.ts.map +1 -1
- package/dist/centrifuge.js +1 -1
- package/dist/centrifuge.js.map +2 -2
- package/dist/centrifuge.shared.worker.js.map +2 -2
- package/dist/{chunk-VUHBF4CY.js → chunk-A3AYPDMW.js} +10 -2
- package/dist/chunk-A3AYPDMW.js.map +7 -0
- package/dist/cjs/centrifuge.cjs +9 -1
- package/dist/cjs/centrifuge.cjs.map +2 -2
- package/dist/cjs/index.cjs +15 -2
- package/dist/cjs/index.cjs.map +2 -2
- package/dist/core/environment.d.ts.map +1 -1
- package/dist/core/replay-manager.d.ts.map +1 -1
- package/dist/core/replay-persistence.d.ts +9 -0
- package/dist/core/replay-persistence.d.ts.map +1 -1
- package/dist/core/storage-batch.d.ts.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +2 -2
- package/dist/workers/port-reaper.d.ts.map +1 -1
- package/docs/api.md +1 -1
- package/docs/benchmarks.md +7 -7
- package/docs/configuration.md +18 -1
- package/docs/release-checklist.md +1 -1
- package/docs/roadmap.md +1 -1
- package/docs/zh/api.md +1 -1
- package/docs/zh/benchmarks.md +7 -7
- package/docs/zh/configuration.md +16 -1
- package/docs/zh/release-checklist.md +1 -1
- package/docs/zh/roadmap.md +1 -1
- package/package.json +2 -2
- package/dist/chunk-VUHBF4CY.js.map +0 -7
package/dist/cjs/index.cjs
CHANGED
|
@@ -487,6 +487,14 @@ var BatchingStorageWriter = class {
|
|
|
487
487
|
}
|
|
488
488
|
// Reads always see the pending value first (task-local consistency), then
|
|
489
489
|
// fall back to the underlying storage.
|
|
490
|
+
//
|
|
491
|
+
// The two operands are **interchangeable formulations of one test**, which is
|
|
492
|
+
// measured rather than argued: `has(key)` and `get(key) ?? null` each suffice,
|
|
493
|
+
// because a pending *delete* stores `null` (which `??` passes straight through)
|
|
494
|
+
// and a key that is not pending yields `undefined` from `get`. So deleting
|
|
495
|
+
// either one alone is a no-op mutation that the whole suite cannot see, while
|
|
496
|
+
// deleting the guard as a whole is caught by four cases. Noted so a future edit
|
|
497
|
+
// does not read the survival of one operand as that of the pair.
|
|
490
498
|
getItem(key) {
|
|
491
499
|
if (this.pending.has(key)) return this.pending.get(key) ?? null;
|
|
492
500
|
return this.storage.getItem(key);
|
|
@@ -2635,7 +2643,7 @@ var SDK_VERSION = (
|
|
|
2635
2643
|
// declaration's type is `string | undefined` and the export's is `string`
|
|
2636
2644
|
// (dropping the conditional is TS2322, measured). Recorded here so the leg reads
|
|
2637
2645
|
// as a shape the harness cannot reach rather than as a case nobody exercised.
|
|
2638
|
-
true ? "0.21.
|
|
2646
|
+
true ? "0.21.48" : ""
|
|
2639
2647
|
);
|
|
2640
2648
|
|
|
2641
2649
|
// src/core/data-bus.ts
|
|
@@ -3829,10 +3837,15 @@ function holdLastFinite(source) {
|
|
|
3829
3837
|
}
|
|
3830
3838
|
|
|
3831
3839
|
// src/core/replay-persistence.ts
|
|
3840
|
+
function resolveDbName(options) {
|
|
3841
|
+
if (options.dbName !== void 0) return options.dbName;
|
|
3842
|
+
if (options.clusterKey === void 0) return DEFAULT_STORAGE_PREFIX;
|
|
3843
|
+
return `${DEFAULT_STORAGE_PREFIX}:${createOpaqueKey(options.clusterKey || "__default__")}`;
|
|
3844
|
+
}
|
|
3832
3845
|
function createIndexedDbReplayPersistence(options) {
|
|
3833
3846
|
const indexedDb = globalThis.indexedDB;
|
|
3834
3847
|
if (!indexedDb) throw new Error("IndexedDB is unavailable in this environment.");
|
|
3835
|
-
const dbName = options
|
|
3848
|
+
const dbName = resolveDbName(options);
|
|
3836
3849
|
const storeName = "replay";
|
|
3837
3850
|
const maxPerTopic = options.maxPerTopic;
|
|
3838
3851
|
const pruneStrategy = options.pruneStrategy ?? PRUNE_STRATEGY.COUNT;
|