@salesforce/lds-runtime-bridge 1.244.0 → 1.246.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 +37 -32
- package/package.json +1 -1
package/dist/ldsRuntimeBridge.js
CHANGED
|
@@ -1340,6 +1340,7 @@ class NimbusSqliteStore {
|
|
|
1340
1340
|
...additionalTableMap,
|
|
1341
1341
|
[DefaultDurableSegment]: new LdsDataTable(plugin),
|
|
1342
1342
|
};
|
|
1343
|
+
this.supportsBatchUpdates = plugin.supportsBatchUpdates !== undefined;
|
|
1343
1344
|
}
|
|
1344
1345
|
isEvalSupported() {
|
|
1345
1346
|
return true;
|
|
@@ -1374,16 +1375,15 @@ class NimbusSqliteStore {
|
|
|
1374
1375
|
setMetadata(entries, segment) {
|
|
1375
1376
|
const table = this.getTable(segment);
|
|
1376
1377
|
let operation;
|
|
1377
|
-
if (this.
|
|
1378
|
-
|
|
1378
|
+
if (this.supportsBatchUpdates) {
|
|
1379
|
+
operation = table.metadataToUpdateOperations(entries, segment);
|
|
1380
|
+
}
|
|
1381
|
+
else {
|
|
1379
1382
|
operation = table.entriesToUpsertOperations(entries, segment);
|
|
1380
1383
|
// manually set the context type on the upsert so notifications do not notify rebuilds without
|
|
1381
1384
|
// plugin updates
|
|
1382
1385
|
operation.context.type = 'setMetadata';
|
|
1383
1386
|
}
|
|
1384
|
-
else {
|
|
1385
|
-
operation = table.metadataToUpdateOperations(entries, segment);
|
|
1386
|
-
}
|
|
1387
1387
|
return this.batchOperationAsPromise([operation]);
|
|
1388
1388
|
}
|
|
1389
1389
|
batchOperations(operations) {
|
|
@@ -1394,17 +1394,16 @@ class NimbusSqliteStore {
|
|
|
1394
1394
|
}
|
|
1395
1395
|
else if (cur.type === 'setMetadata') {
|
|
1396
1396
|
const table = this.getTable(cur.segment);
|
|
1397
|
-
if (this.
|
|
1398
|
-
|
|
1397
|
+
if (this.supportsBatchUpdates) {
|
|
1398
|
+
acc.push(table.metadataToUpdateOperations(cur.entries, cur.segment));
|
|
1399
|
+
}
|
|
1400
|
+
else {
|
|
1399
1401
|
const upsert = table.entriesToUpsertOperations(cur.entries, cur.segment);
|
|
1400
1402
|
// manually set the context type on the upsert so notifications do not notify rebuilds without
|
|
1401
1403
|
// plugin updates
|
|
1402
1404
|
upsert.context.type = 'setMetadata';
|
|
1403
1405
|
acc.push(upsert);
|
|
1404
1406
|
}
|
|
1405
|
-
else {
|
|
1406
|
-
acc.push(table.metadataToUpdateOperations(cur.entries, cur.segment));
|
|
1407
|
-
}
|
|
1408
1407
|
}
|
|
1409
1408
|
else {
|
|
1410
1409
|
acc.push(this.idsToDeleteOperation(cur.ids, cur.segment));
|
|
@@ -5878,30 +5877,36 @@ function makeRecordDenormalizingDurableStore(luvio, durableStore, getStoreRecord
|
|
|
5878
5877
|
const operationsWithDenormedRecords = [];
|
|
5879
5878
|
for (let i = 0, len = operations.length; i < len; i++) {
|
|
5880
5879
|
const operation = operations[i];
|
|
5881
|
-
if (
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
if (
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5880
|
+
if (operation.type === 'setMetadata') {
|
|
5881
|
+
// if setMetadata also contains entry data then it needs to be denormalized.
|
|
5882
|
+
const keys$1 = keys(operation.entries);
|
|
5883
|
+
if (keys$1.length > 0) {
|
|
5884
|
+
const firstKey = keys$1[0];
|
|
5885
|
+
// casted to any to check if data exists
|
|
5886
|
+
const firstEntry = operation.entries[firstKey];
|
|
5887
|
+
// it is not possible for setMetadata to contain entries with both data and no data in the same operation.
|
|
5888
|
+
// this is determined by the plugin supporting update batch calls before it gets to this HOF.
|
|
5889
|
+
// so we only need to check one entry to confirm this for performance
|
|
5890
|
+
if (firstEntry.data !== undefined) {
|
|
5891
|
+
operationsWithDenormedRecords.push({
|
|
5892
|
+
...operation,
|
|
5893
|
+
entries: denormalizeEntries(operation.entries),
|
|
5894
|
+
});
|
|
5895
|
+
}
|
|
5896
|
+
else {
|
|
5897
|
+
operationsWithDenormedRecords.push(operation);
|
|
5898
|
+
}
|
|
5888
5899
|
}
|
|
5889
|
-
|
|
5890
|
-
...operation,
|
|
5891
|
-
entries: denormalizeEntries(operation.entries),
|
|
5892
|
-
});
|
|
5900
|
+
continue;
|
|
5893
5901
|
}
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
operationsWithDenormedRecords.push(operation);
|
|
5898
|
-
continue;
|
|
5899
|
-
}
|
|
5900
|
-
operationsWithDenormedRecords.push({
|
|
5901
|
-
...operation,
|
|
5902
|
-
entries: denormalizeEntries(operation.entries),
|
|
5903
|
-
});
|
|
5902
|
+
if (operation.segment !== DefaultDurableSegment || operation.type === 'evictEntries') {
|
|
5903
|
+
operationsWithDenormedRecords.push(operation);
|
|
5904
|
+
continue;
|
|
5904
5905
|
}
|
|
5906
|
+
operationsWithDenormedRecords.push({
|
|
5907
|
+
...operation,
|
|
5908
|
+
entries: denormalizeEntries(operation.entries),
|
|
5909
|
+
});
|
|
5905
5910
|
}
|
|
5906
5911
|
return durableStore.batchOperations(operationsWithDenormedRecords);
|
|
5907
5912
|
};
|
|
@@ -5992,4 +5997,4 @@ function ldsRuntimeBridge() {
|
|
|
5992
5997
|
}
|
|
5993
5998
|
|
|
5994
5999
|
export { ldsRuntimeBridge as default };
|
|
5995
|
-
// version: 1.
|
|
6000
|
+
// version: 1.246.0-8357100fc
|