@salesforce/lds-runtime-mobile 1.133.0 → 1.133.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/dist/main.js CHANGED
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import { withRegistration, register } from '@salesforce/lds-default-luvio';
15
15
  import { setupInstrumentation, instrumentAdapter as instrumentAdapter$1, instrumentLuvio, setLdsAdaptersUiapiInstrumentation, setLdsNetworkAdapterInstrumentation } from '@salesforce/lds-instrumentation';
16
- import { HttpStatusCode, StoreKeyMap, buildStaleWhileRevalidateImplementation, StoreKeySet, serializeStructuredKey, Reader, emitAdapterEvent, createCustomAdapterEventEmitter, isFileReference, Environment, Luvio, InMemoryStore } from '@luvio/engine';
16
+ import { HttpStatusCode, buildStaleWhileRevalidateImplementation, StoreKeySet, serializeStructuredKey, Reader, emitAdapterEvent, createCustomAdapterEventEmitter, StoreKeyMap, isFileReference, Environment, Luvio, InMemoryStore } from '@luvio/engine';
17
17
  import { parseAndVisit, Kind, visit, execute, buildSchema, isObjectType, defaultFieldResolver } from '@luvio/graphql-parser';
18
18
  import { getRecordId18, keyBuilderQuickActionExecutionRepresentation, ingestQuickActionExecutionRepresentation, keyBuilderContentDocumentCompositeRepresentation, getResponseCacheKeysContentDocumentCompositeRepresentation, keyBuilderFromTypeContentDocumentCompositeRepresentation, ingestContentDocumentCompositeRepresentation, keyBuilderRecord, getTypeCacheKeysRecord, keyBuilderFromTypeRecordRepresentation, ingestRecord, RecordRepresentationRepresentationType, ObjectInfoRepresentationType, getRecordAdapterFactory, getObjectInfoAdapterFactory, getObjectInfosAdapterFactory, UiApiNamespace, RecordRepresentationType, RecordRepresentationTTL, RecordRepresentationVersion } from '@salesforce/lds-adapters-uiapi';
19
19
  import caseSensitiveUserId from '@salesforce/user/Id';
@@ -577,7 +577,7 @@ function isStoreEntryError(storeRecord) {
577
577
  * @param pendingWriter the PendingWriter (this is going away soon)
578
578
  * @returns
579
579
  */
580
- function publishDurableStoreEntries(durableRecords, publish, publishMetadata) {
580
+ function publishDurableStoreEntries(durableRecords, put, publishMetadata) {
581
581
  const revivedKeys = new StoreKeySet();
582
582
  let hadUnexpectedShape = false;
583
583
  if (durableRecords === undefined) {
@@ -615,7 +615,7 @@ function publishDurableStoreEntries(durableRecords, publish, publishMetadata) {
615
615
  // freeze errors on way into L1
616
616
  deepFreeze(data.error);
617
617
  }
618
- publish(key, data);
618
+ put(key, data);
619
619
  revivedKeys.add(key);
620
620
  }
621
621
  return { revivedKeys, hadUnexpectedShape };
@@ -655,7 +655,7 @@ unavailableSnapshot, durableStoreErrorHandler, buildL1Snapshot, reviveMetrics =
655
655
  // TODO [W-10072584]: instead of implicitly using L1 we should take in
656
656
  // publish and publishMetadata funcs, so callers can decide where to
657
657
  // revive to (like they pass in how to do the buildL1Snapshot)
658
- baseEnvironment.storePublish.bind(baseEnvironment), baseEnvironment.publishStoreMetadata.bind(baseEnvironment));
658
+ baseEnvironment.storePut.bind(baseEnvironment), baseEnvironment.publishStoreMetadata.bind(baseEnvironment));
659
659
  // if the data coming back from DS had an unexpected shape then just
660
660
  // return the L1 snapshot
661
661
  if (hadUnexpectedShape === true) {
@@ -778,16 +778,6 @@ class DurableTTLStore {
778
778
  }
779
779
  }
780
780
 
781
- function copy(source) {
782
- if (typeof source !== 'object' || source === null) {
783
- return source;
784
- }
785
- if (isArray$5(source)) {
786
- // TS doesn't trust that this new array is an array unless we cast it
787
- return [...source];
788
- }
789
- return { ...source };
790
- }
791
781
  function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStoreErrorHandler) {
792
782
  const durableRecords = create$5(null);
793
783
  const evictedRecords = create$5(null);
@@ -806,9 +796,7 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
806
796
  }
807
797
  const metadata = storeMetadata[key];
808
798
  durableRecords[key] = {
809
- // copy the data in case the store is mutated during the
810
- // async setEntries call
811
- data: copy(record),
799
+ data: record,
812
800
  };
813
801
  if (metadata !== undefined) {
814
802
  durableRecords[key].metadata = {
@@ -929,7 +917,7 @@ function isUnfulfilledSnapshot(cachedSnapshotResult) {
929
917
  function makeDurable(environment, { durableStore, instrumentation }) {
930
918
  let ingestStagingStore = null;
931
919
  const durableTTLStore = new DurableTTLStore(durableStore);
932
- const mergeKeysPromiseMap = new StoreKeyMap();
920
+ const mergeKeysPromiseMap = new Map();
933
921
  // When a context store is mutated we write it to L2, which causes DS on change
934
922
  // event. If this instance of makeDurable caused that L2 write we can ignore that
935
923
  // on change event. This Set helps us do that.
@@ -15743,4 +15731,4 @@ register({
15743
15731
  });
15744
15732
 
15745
15733
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
15746
- // version: 1.133.0-640b335d9
15734
+ // version: 1.133.2-0c6b84e3c
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-mobile",
3
- "version": "1.133.0",
3
+ "version": "1.133.2",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for mobile/hybrid environments.",
6
6
  "main": "dist/main.js",
@@ -92,5 +92,8 @@
92
92
  ]
93
93
  }
94
94
  }
95
+ },
96
+ "volta": {
97
+ "extends": "../../package.json"
95
98
  }
96
99
  }
package/sfdc/main.js CHANGED
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import { withRegistration, register } from 'native/ldsEngineMobile';
15
15
  import { setupInstrumentation, instrumentAdapter as instrumentAdapter$1, instrumentLuvio, setLdsAdaptersUiapiInstrumentation, setLdsNetworkAdapterInstrumentation } from 'force/ldsInstrumentation';
16
- import { HttpStatusCode, StoreKeyMap, buildStaleWhileRevalidateImplementation, StoreKeySet, serializeStructuredKey, Reader, emitAdapterEvent, createCustomAdapterEventEmitter, isFileReference, Environment, Luvio, InMemoryStore } from 'force/luvioEngine';
16
+ import { HttpStatusCode, buildStaleWhileRevalidateImplementation, StoreKeySet, serializeStructuredKey, Reader, emitAdapterEvent, createCustomAdapterEventEmitter, StoreKeyMap, isFileReference, Environment, Luvio, InMemoryStore } from 'force/luvioEngine';
17
17
  import { parseAndVisit, Kind, visit, execute, buildSchema, isObjectType, defaultFieldResolver } from 'force/ldsGraphqlParser';
18
18
  import { getRecordId18, keyBuilderQuickActionExecutionRepresentation, ingestQuickActionExecutionRepresentation, keyBuilderContentDocumentCompositeRepresentation, getResponseCacheKeysContentDocumentCompositeRepresentation, keyBuilderFromTypeContentDocumentCompositeRepresentation, ingestContentDocumentCompositeRepresentation, keyBuilderRecord, getTypeCacheKeysRecord, keyBuilderFromTypeRecordRepresentation, ingestRecord, RecordRepresentationRepresentationType, ObjectInfoRepresentationType, getRecordAdapterFactory, getObjectInfoAdapterFactory, getObjectInfosAdapterFactory, UiApiNamespace, RecordRepresentationType, RecordRepresentationTTL, RecordRepresentationVersion } from 'force/ldsAdaptersUiapi';
19
19
  import caseSensitiveUserId from '@salesforce/user/Id';
@@ -577,7 +577,7 @@ function isStoreEntryError(storeRecord) {
577
577
  * @param pendingWriter the PendingWriter (this is going away soon)
578
578
  * @returns
579
579
  */
580
- function publishDurableStoreEntries(durableRecords, publish, publishMetadata) {
580
+ function publishDurableStoreEntries(durableRecords, put, publishMetadata) {
581
581
  const revivedKeys = new StoreKeySet();
582
582
  let hadUnexpectedShape = false;
583
583
  if (durableRecords === undefined) {
@@ -615,7 +615,7 @@ function publishDurableStoreEntries(durableRecords, publish, publishMetadata) {
615
615
  // freeze errors on way into L1
616
616
  deepFreeze(data.error);
617
617
  }
618
- publish(key, data);
618
+ put(key, data);
619
619
  revivedKeys.add(key);
620
620
  }
621
621
  return { revivedKeys, hadUnexpectedShape };
@@ -655,7 +655,7 @@ unavailableSnapshot, durableStoreErrorHandler, buildL1Snapshot, reviveMetrics =
655
655
  // TODO [W-10072584]: instead of implicitly using L1 we should take in
656
656
  // publish and publishMetadata funcs, so callers can decide where to
657
657
  // revive to (like they pass in how to do the buildL1Snapshot)
658
- baseEnvironment.storePublish.bind(baseEnvironment), baseEnvironment.publishStoreMetadata.bind(baseEnvironment));
658
+ baseEnvironment.storePut.bind(baseEnvironment), baseEnvironment.publishStoreMetadata.bind(baseEnvironment));
659
659
  // if the data coming back from DS had an unexpected shape then just
660
660
  // return the L1 snapshot
661
661
  if (hadUnexpectedShape === true) {
@@ -778,16 +778,6 @@ class DurableTTLStore {
778
778
  }
779
779
  }
780
780
 
781
- function copy(source) {
782
- if (typeof source !== 'object' || source === null) {
783
- return source;
784
- }
785
- if (isArray$5(source)) {
786
- // TS doesn't trust that this new array is an array unless we cast it
787
- return [...source];
788
- }
789
- return { ...source };
790
- }
791
781
  function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStoreErrorHandler) {
792
782
  const durableRecords = create$5(null);
793
783
  const evictedRecords = create$5(null);
@@ -806,9 +796,7 @@ function flushInMemoryStoreValuesToDurableStore(store, durableStore, durableStor
806
796
  }
807
797
  const metadata = storeMetadata[key];
808
798
  durableRecords[key] = {
809
- // copy the data in case the store is mutated during the
810
- // async setEntries call
811
- data: copy(record),
799
+ data: record,
812
800
  };
813
801
  if (metadata !== undefined) {
814
802
  durableRecords[key].metadata = {
@@ -929,7 +917,7 @@ function isUnfulfilledSnapshot(cachedSnapshotResult) {
929
917
  function makeDurable(environment, { durableStore, instrumentation }) {
930
918
  let ingestStagingStore = null;
931
919
  const durableTTLStore = new DurableTTLStore(durableStore);
932
- const mergeKeysPromiseMap = new StoreKeyMap();
920
+ const mergeKeysPromiseMap = new Map();
933
921
  // When a context store is mutated we write it to L2, which causes DS on change
934
922
  // event. If this instance of makeDurable caused that L2 write we can ignore that
935
923
  // on change event. This Set helps us do that.
@@ -15743,4 +15731,4 @@ register({
15743
15731
  });
15744
15732
 
15745
15733
  export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
15746
- // version: 1.133.0-640b335d9
15734
+ // version: 1.133.2-0c6b84e3c