dexie 4.0.1-alpha.20 → 4.0.1-alpha.22

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/dist/dexie.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * By David Fahlander, david.fahlander@gmail.com
6
6
  *
7
- * Version 4.0.1-alpha.20, Mon Jun 12 2023
7
+ * Version 4.0.1-alpha.22, Wed Jun 14 2023
8
8
  *
9
9
  * https://dexie.org
10
10
  *
package/dist/dexie.js CHANGED
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * By David Fahlander, david.fahlander@gmail.com
6
6
  *
7
- * Version 4.0.1-alpha.20, Mon Jun 12 2023
7
+ * Version 4.0.1-alpha.22, Wed Jun 14 2023
8
8
  *
9
9
  * https://dexie.org
10
10
  *
@@ -1284,7 +1284,7 @@
1284
1284
  }
1285
1285
  }
1286
1286
 
1287
- var DEXIE_VERSION = '4.0.1-alpha.20';
1287
+ var DEXIE_VERSION = '4.0.1-alpha.22';
1288
1288
  var maxString = String.fromCharCode(65535);
1289
1289
  var minKey = -Infinity;
1290
1290
  var INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";
@@ -4514,7 +4514,7 @@
4514
4514
 
4515
4515
  var observabilityMiddleware = {
4516
4516
  stack: "dbcore",
4517
- level: 10,
4517
+ level: 0,
4518
4518
  name: "Observability",
4519
4519
  create: function (core) {
4520
4520
  var dbName = core.schema.name;
@@ -4601,9 +4601,6 @@
4601
4601
  ? req.obsSet = {}
4602
4602
  : subscr;
4603
4603
  if (isLiveQuery) {
4604
- var signal = PSD.signal;
4605
- if (signal && signal.aborted)
4606
- throw new exceptions.Abort();
4607
4604
  var getRangeSet = function (indexName) {
4608
4605
  var part = "idb://".concat(dbName, "/").concat(tableName, "/").concat(indexName);
4609
4606
  return (obsSet[part] ||
@@ -4950,21 +4947,16 @@
4950
4947
 
4951
4948
  var cacheMiddleware = {
4952
4949
  stack: 'dbcore',
4953
- level: 10,
4950
+ level: 0,
4954
4951
  name: 'Cache',
4955
4952
  create: function (core) {
4956
4953
  var dbName = core.schema.name;
4957
4954
  var coreMW = __assign(__assign({}, core), { transaction: function (stores, mode, options) {
4958
4955
  var idbtrans = core.transaction(stores, mode, options);
4959
- var txs = PSD.txs;
4960
- if (txs || mode === 'readwrite') {
4961
- if (txs)
4962
- txs.push(idbtrans);
4956
+ if (mode === 'readwrite') {
4963
4957
  var ac_1 = new AbortController();
4964
4958
  var signal = ac_1.signal;
4965
4959
  var endTransaction = function (wasCommitted) { return function () {
4966
- if (txs)
4967
- delArrayItem(txs, idbtrans);
4968
4960
  ac_1.abort();
4969
4961
  if (mode === 'readwrite') {
4970
4962
  var affectedSubscribers_1 = new Set();
@@ -5086,13 +5078,7 @@
5086
5078
  });
5087
5079
  cacheEntry = {
5088
5080
  obsSet: req.obsSet,
5089
- promise: promise.catch(function (error) {
5090
- if (req.trans.aborted) {
5091
- var trans = coreMW.transaction([tableName], 'readonly');
5092
- return tableMW.query(__assign(__assign({}, req), { trans: trans }));
5093
- }
5094
- return Promise.reject(error);
5095
- }),
5081
+ promise: promise,
5096
5082
  subscribers: new Set(),
5097
5083
  type: 'query',
5098
5084
  req: req,
@@ -5225,10 +5211,10 @@
5225
5211
  .map(function (c) { return c.on("versionchange").fire(ev); });
5226
5212
  };
5227
5213
  this.use(cacheExistingValuesMiddleware);
5228
- this.use(virtualIndexMiddleware);
5229
- this.use(hooksMiddleware);
5230
5214
  this.use(cacheMiddleware);
5231
5215
  this.use(observabilityMiddleware);
5216
+ this.use(virtualIndexMiddleware);
5217
+ this.use(hooksMiddleware);
5232
5218
  this.vip = Object.create(this, { _vip: { value: true } });
5233
5219
  addons.forEach(function (addon) { return addon(_this); });
5234
5220
  }
@@ -5482,7 +5468,6 @@
5482
5468
  }
5483
5469
  var closed = false;
5484
5470
  var abortController;
5485
- var txs = [];
5486
5471
  var accumMuts = {};
5487
5472
  var currentObs = {};
5488
5473
  var subscription = {
@@ -5497,13 +5482,6 @@
5497
5482
  abortController.abort();
5498
5483
  if (startedListening)
5499
5484
  globalEvents.storagemutated.unsubscribe(mutationListener);
5500
- txs.forEach(function (idbtrans) {
5501
- idbtrans.aborted = true;
5502
- try {
5503
- idbtrans.abort();
5504
- }
5505
- catch (_a) { }
5506
- });
5507
5485
  },
5508
5486
  };
5509
5487
  observer.start && observer.start(subscription);
@@ -5528,19 +5506,8 @@
5528
5506
  if (abortController)
5529
5507
  abortController.abort();
5530
5508
  abortController = new AbortController();
5531
- if (txs.length) {
5532
- txs.forEach(function (idbtrans) {
5533
- idbtrans.aborted = true;
5534
- try {
5535
- idbtrans.abort();
5536
- }
5537
- catch (_a) { }
5538
- });
5539
- txs.length = 0;
5540
- }
5541
5509
  var ctx = {
5542
5510
  subscr: subscr,
5543
- txs: txs,
5544
5511
  signal: abortController.signal,
5545
5512
  requery: doQuery,
5546
5513
  trans: null