@luvio/environments 0.138.8 → 0.138.9

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.
@@ -1,4 +1,4 @@
1
- import { StoreKeySet, serializeStructuredKey, emitAdapterEvent, StoreKeyMap, buildStaleWhileRevalidateImplementation, Reader } from '@luvio/engine';
1
+ import { StoreKeySet, serializeStructuredKey, emitAdapterEvent, buildStaleWhileRevalidateImplementation, Reader } from '@luvio/engine';
2
2
 
3
3
  // the last version the metadata shape was altered
4
4
  const DURABLE_METADATA_VERSION = '0.111.0';
@@ -281,16 +281,6 @@ class DurableTTLStore {
281
281
  }
282
282
  }
283
283
 
284
- function copy(source) {
285
- if (typeof source !== 'object' || source === null) {
286
- return source;
287
- }
288
- if (isArray(source)) {
289
- // TS doesn't trust that this new array is an array unless we cast it
290
- return [...source];
291
- }
292
- return { ...source };
293
- }
294
284
  function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStoreErrorHandler) {
295
285
  const durableRecords = create(null);
296
286
  const evictedRecords = create(null);
@@ -309,9 +299,7 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
309
299
  }
310
300
  const metadata = storeMetadata[key];
311
301
  durableRecords[key] = {
312
- // copy the data in case the store is mutated during the
313
- // async setEntries call
314
- data: copy(record),
302
+ data: record,
315
303
  };
316
304
  if (metadata !== undefined) {
317
305
  durableRecords[key].metadata = {
@@ -435,7 +423,7 @@ function isUnfulfilledSnapshot(cachedSnapshotResult) {
435
423
  function makeDurable(environment, { durableStore, instrumentation }) {
436
424
  let ingestStagingStore = null;
437
425
  const durableTTLStore = new DurableTTLStore(durableStore);
438
- const mergeKeysPromiseMap = new StoreKeyMap();
426
+ const mergeKeysPromiseMap = new Map();
439
427
  // When a context store is mutated we write it to L2, which causes DS on change
440
428
  // event. If this instance of makeDurable caused that L2 write we can ignore that
441
429
  // on change event. This Set helps us do that.
@@ -285,16 +285,6 @@
285
285
  }
286
286
  }
287
287
 
288
- function copy(source) {
289
- if (typeof source !== 'object' || source === null) {
290
- return source;
291
- }
292
- if (isArray(source)) {
293
- // TS doesn't trust that this new array is an array unless we cast it
294
- return [...source];
295
- }
296
- return { ...source };
297
- }
298
288
  function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStoreErrorHandler) {
299
289
  const durableRecords = create(null);
300
290
  const evictedRecords = create(null);
@@ -313,9 +303,7 @@
313
303
  }
314
304
  const metadata = storeMetadata[key];
315
305
  durableRecords[key] = {
316
- // copy the data in case the store is mutated during the
317
- // async setEntries call
318
- data: copy(record),
306
+ data: record,
319
307
  };
320
308
  if (metadata !== undefined) {
321
309
  durableRecords[key].metadata = {
@@ -439,7 +427,7 @@
439
427
  function makeDurable(environment, { durableStore, instrumentation }) {
440
428
  let ingestStagingStore = null;
441
429
  const durableTTLStore = new DurableTTLStore(durableStore);
442
- const mergeKeysPromiseMap = new engine.StoreKeyMap();
430
+ const mergeKeysPromiseMap = new Map();
443
431
  // When a context store is mutated we write it to L2, which causes DS on change
444
432
  // event. If this instance of makeDurable caused that L2 write we can ignore that
445
433
  // on change event. This Set helps us do that.
@@ -85,16 +85,6 @@
85
85
  } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
86
86
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
87
87
  }
88
- }
89
-
90
- function __spreadArray(to, from, pack) {
91
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
92
- if (ar || !(i in from)) {
93
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
94
- ar[i] = from[i];
95
- }
96
- }
97
- return to.concat(ar || Array.prototype.slice.call(from));
98
88
  }
99
89
 
100
90
  var keys = Object.keys, create = Object.create, freeze = Object.freeze;
@@ -366,16 +356,6 @@
366
356
  return DurableTTLStore;
367
357
  }());
368
358
 
369
- function copy(source) {
370
- if (typeof source !== 'object' || source === null) {
371
- return source;
372
- }
373
- if (isArray(source)) {
374
- // TS doesn't trust that this new array is an array unless we cast it
375
- return __spreadArray([], source, true);
376
- }
377
- return __assign({}, source);
378
- }
379
359
  function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStoreErrorHandler) {
380
360
  var durableRecords = create(null);
381
361
  var evictedRecords = create(null);
@@ -394,9 +374,7 @@
394
374
  }
395
375
  var metadata = storeMetadata[key];
396
376
  durableRecords[key] = {
397
- // copy the data in case the store is mutated during the
398
- // async setEntries call
399
- data: copy(record),
377
+ data: record,
400
378
  };
401
379
  if (metadata !== undefined) {
402
380
  durableRecords[key].metadata = __assign(__assign({}, metadata), { metadataVersion: DURABLE_METADATA_VERSION });
@@ -543,7 +521,7 @@
543
521
  var durableStore = _a.durableStore, instrumentation = _a.instrumentation;
544
522
  var ingestStagingStore = null;
545
523
  var durableTTLStore = new DurableTTLStore(durableStore);
546
- var mergeKeysPromiseMap = new engine.StoreKeyMap();
524
+ var mergeKeysPromiseMap = new Map();
547
525
  // When a context store is mutated we write it to L2, which causes DS on change
548
526
  // event. If this instance of makeDurable caused that L2 write we can ignore that
549
527
  // on change event. This Set helps us do that.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luvio/environments",
3
- "version": "0.138.8",
3
+ "version": "0.138.9",
4
4
  "description": "Luvio Environments",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,7 +23,7 @@
23
23
  "watch": "yarn build --watch"
24
24
  },
25
25
  "dependencies": {
26
- "@luvio/engine": "^0.138.8"
26
+ "@luvio/engine": "^0.138.9"
27
27
  },
28
28
  "volta": {
29
29
  "extends": "../../../package.json"