@salesforce/lds-runtime-bridge 1.302.0 → 1.303.0
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/ldsRuntimeBridge.js
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { register, setDefaultLuvio } from 'force/ldsEngine';
|
|
15
15
|
import { setBypassDeepFreeze, StoreKeySet, serializeStructuredKey, StringKeyInMemoryStore, Reader, deepFreeze, emitAdapterEvent, InMemoryStore, Environment, Luvio } from 'force/luvioEngine';
|
|
16
|
-
import { instrumentLuvio } from 'force/ldsInstrumentation';
|
|
16
|
+
import { setupInstrumentation, instrumentAdapter as instrumentAdapter$1, instrumentLuvio } from 'force/ldsInstrumentation';
|
|
17
|
+
import { instrument as instrument$1 } from 'force/ldsBindings';
|
|
17
18
|
import 'force/ldsGraphqlParser';
|
|
18
19
|
import networkAdapter from 'force/ldsNetwork';
|
|
19
20
|
import ldsEngineCreator from 'force/ldsEngineCreator';
|
|
@@ -1079,6 +1080,32 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
1079
1080
|
}, revivingStore).finally(() => {
|
|
1080
1081
|
});
|
|
1081
1082
|
};
|
|
1083
|
+
const expirePossibleStaleRecords = async function (keys$1, config, refresh) {
|
|
1084
|
+
validateNotDisposed();
|
|
1085
|
+
const metadataKeys = keys$1.map(serializeStructuredKey);
|
|
1086
|
+
const now = Date.now();
|
|
1087
|
+
const entries = await durableStore.getMetadata(metadataKeys, DefaultDurableSegment);
|
|
1088
|
+
if (entries === undefined || keys$3(entries).length === 0) {
|
|
1089
|
+
return environment.expirePossibleStaleRecords(keys$1);
|
|
1090
|
+
}
|
|
1091
|
+
let metaDataChanged = false;
|
|
1092
|
+
const metadataEntries = metadataKeys.reduce((accu, key) => {
|
|
1093
|
+
const metadataEntry = entries[key];
|
|
1094
|
+
if (metadataEntry.metadata !== undefined) {
|
|
1095
|
+
const metadata = { ...metadataEntry.metadata, expirationTimestamp: now };
|
|
1096
|
+
accu[key] = { metadata };
|
|
1097
|
+
metaDataChanged = true;
|
|
1098
|
+
}
|
|
1099
|
+
return accu;
|
|
1100
|
+
}, {});
|
|
1101
|
+
if (metaDataChanged) {
|
|
1102
|
+
await durableStore.setMetadata(metadataEntries, DefaultDurableSegment);
|
|
1103
|
+
}
|
|
1104
|
+
if (config !== undefined && refresh !== undefined) {
|
|
1105
|
+
return environment.refreshPossibleStaleRecords(config, refresh);
|
|
1106
|
+
}
|
|
1107
|
+
return Promise.resolve();
|
|
1108
|
+
};
|
|
1082
1109
|
// set the default cache policy of the base environment
|
|
1083
1110
|
environment.setDefaultCachePolicy({
|
|
1084
1111
|
type: 'stale-while-revalidate',
|
|
@@ -1111,6 +1138,7 @@ function makeDurable(environment, { durableStore, instrumentation, useRevivingSt
|
|
|
1111
1138
|
handleErrorResponse: { value: handleErrorResponse },
|
|
1112
1139
|
getNotifyChangeStoreEntries: { value: getNotifyChangeStoreEntries },
|
|
1113
1140
|
notifyStoreUpdateAvailable: { value: notifyStoreUpdateAvailable },
|
|
1141
|
+
expirePossibleStaleRecords: { value: expirePossibleStaleRecords },
|
|
1114
1142
|
});
|
|
1115
1143
|
}
|
|
1116
1144
|
|
|
@@ -1521,6 +1549,25 @@ class NimbusSqliteStore {
|
|
|
1521
1549
|
}
|
|
1522
1550
|
}
|
|
1523
1551
|
|
|
1552
|
+
let reportObservers = [];
|
|
1553
|
+
function instrumentAdapter(adapter, metadata) {
|
|
1554
|
+
let instrumentedMobileAdapter = adapter;
|
|
1555
|
+
return instrumentAdapter$1(instrumentedMobileAdapter, metadata, {
|
|
1556
|
+
trackL1Hits: true,
|
|
1557
|
+
trackL2Hits: true,
|
|
1558
|
+
trackCacheMisses: true,
|
|
1559
|
+
reportObserver: (report) => {
|
|
1560
|
+
for (const observer of reportObservers) {
|
|
1561
|
+
observer(report);
|
|
1562
|
+
}
|
|
1563
|
+
},
|
|
1564
|
+
});
|
|
1565
|
+
}
|
|
1566
|
+
function setupMobileInstrumentation(luvio, store) {
|
|
1567
|
+
setupInstrumentation(luvio, store);
|
|
1568
|
+
instrument$1({ instrumentAdapter });
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1524
1571
|
/**
|
|
1525
1572
|
* Copyright (c) 2022, Salesforce, Inc.,
|
|
1526
1573
|
* All rights reserved.
|
|
@@ -2667,6 +2714,8 @@ function getRuntime() {
|
|
|
2667
2714
|
luvio = new Luvio(durableEnv, {
|
|
2668
2715
|
instrument: instrumentLuvio,
|
|
2669
2716
|
});
|
|
2717
|
+
// Currently instruments store runtime perf
|
|
2718
|
+
setupMobileInstrumentation(luvio, store);
|
|
2670
2719
|
return luvio;
|
|
2671
2720
|
}
|
|
2672
2721
|
|
|
@@ -2688,4 +2737,4 @@ function ldsRuntimeBridge() {
|
|
|
2688
2737
|
}
|
|
2689
2738
|
|
|
2690
2739
|
export { ldsRuntimeBridge as default };
|
|
2691
|
-
// version: 1.
|
|
2740
|
+
// version: 1.303.0-a698c7cc67
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-bridge",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.303.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS runtime for bridge.app.",
|
|
6
6
|
"main": "dist/ldsRuntimeBridge.js",
|
|
@@ -34,16 +34,17 @@
|
|
|
34
34
|
"release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-bridge"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@salesforce/lds-
|
|
38
|
-
"@salesforce/lds-
|
|
37
|
+
"@salesforce/lds-bindings": "^1.303.0",
|
|
38
|
+
"@salesforce/lds-durable-records": "^1.303.0",
|
|
39
|
+
"@salesforce/lds-instrumentation": "^1.303.0",
|
|
39
40
|
"@salesforce/user": "0.0.21",
|
|
40
41
|
"o11y": "250.7.0"
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
|
-
"@salesforce/lds-network-aura": "^1.
|
|
44
|
-
"@salesforce/lds-runtime-aura": "^1.
|
|
45
|
-
"@salesforce/lds-store-nimbus": "^1.
|
|
46
|
-
"@salesforce/nimbus-plugin-lds": "^1.
|
|
44
|
+
"@salesforce/lds-network-aura": "^1.303.0",
|
|
45
|
+
"@salesforce/lds-runtime-aura": "^1.303.0",
|
|
46
|
+
"@salesforce/lds-store-nimbus": "^1.303.0",
|
|
47
|
+
"@salesforce/nimbus-plugin-lds": "^1.303.0",
|
|
47
48
|
"babel-plugin-dynamic-import-node": "^2.3.3"
|
|
48
49
|
},
|
|
49
50
|
"luvioBundlesize": [
|