@salesforce/lds-runtime-bridge 1.365.0 → 1.366.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.
@@ -14,7 +14,7 @@
14
14
  import { setDefaultLuvio } from 'force/ldsEngine';
15
15
  import { setBypassDeepFreeze, StoreKeySet, serializeStructuredKey, StringKeyInMemoryStore, Reader, deepFreeze, emitAdapterEvent, InMemoryStore, Environment, Luvio } from 'force/luvioEngine';
16
16
  import { setupInstrumentation, instrumentAdapter as instrumentAdapter$1, instrumentLuvio } from 'force/ldsInstrumentation';
17
- import { idleDetector } from 'o11y/client';
17
+ import { idleDetector, getInstrumentation } from 'o11y/client';
18
18
  import { instrument } from 'force/ldsBindings';
19
19
  import { extractRecordIdFromStoreKey, RECORD_VIEW_ENTITY_ID_PREFIX, isStoreKeyRecordViewEntity, keyBuilderRecord, RECORD_ID_PREFIX, RECORD_FIELDS_KEY_JUNCTION } from 'force/ldsAdaptersUiapi';
20
20
  import networkAdapter from 'force/ldsNetwork';
@@ -1388,6 +1388,9 @@ class LdsInternalDataTable {
1388
1388
  }
1389
1389
 
1390
1390
  const tasker = idleDetector.declareNotifierTaskMulti('NimbusSqliteStore');
1391
+ const instrumentation = getInstrumentation('lds-mobile');
1392
+ const GRAPHQL_QUERY_ROOT_KEY = 'UiApi::uiapi::Query[uiapi]__uiapi__query';
1393
+ const GRAPHQL_QUERY_ROOT_METRIC_NAME = 'gql-query-root-object-size';
1391
1394
  class NimbusSqliteStore {
1392
1395
  constructor(plugin, additionalTableMap = {}) {
1393
1396
  this.plugin = plugin;
@@ -1439,6 +1442,9 @@ class NimbusSqliteStore {
1439
1442
  }
1440
1443
  const table = this.getTable(segment);
1441
1444
  const upsertOperation = table.entriesToUpsertOperations(entries, segment);
1445
+ if (entries[GRAPHQL_QUERY_ROOT_KEY]) {
1446
+ this.trackGraphQLQueryRootSize(upsertOperation);
1447
+ }
1442
1448
  return this.batchOperationAsPromise([upsertOperation]);
1443
1449
  }
1444
1450
  setMetadata(entries, segment) {
@@ -1454,7 +1460,11 @@ class NimbusSqliteStore {
1454
1460
  if (cur.type === 'setEntries') {
1455
1461
  if (keys$1(cur.entries).length > 0) {
1456
1462
  const table = this.getTable(cur.segment);
1457
- acc.push(table.entriesToUpsertOperations(cur.entries, cur.segment));
1463
+ const upsertOperation = table.entriesToUpsertOperations(cur.entries, cur.segment);
1464
+ if (cur.entries[GRAPHQL_QUERY_ROOT_KEY]) {
1465
+ this.trackGraphQLQueryRootSize(upsertOperation);
1466
+ }
1467
+ acc.push(upsertOperation);
1458
1468
  }
1459
1469
  }
1460
1470
  else if (cur.type === 'setMetadata') {
@@ -1539,6 +1549,19 @@ class NimbusSqliteStore {
1539
1549
  });
1540
1550
  }).finally(() => tasker.done());
1541
1551
  }
1552
+ trackGraphQLQueryRootSize(upsertOperation) {
1553
+ try {
1554
+ if (upsertOperation.type !== 'upsert') {
1555
+ return;
1556
+ }
1557
+ const row = upsertOperation.rows.find((r) => r[0] === GRAPHQL_QUERY_ROOT_KEY);
1558
+ if (!(row && row[1] && typeof row[1] === 'string')) {
1559
+ return;
1560
+ }
1561
+ instrumentation.trackValue(GRAPHQL_QUERY_ROOT_METRIC_NAME, row[1].length);
1562
+ }
1563
+ catch { }
1564
+ }
1542
1565
  }
1543
1566
 
1544
1567
  let reportObservers = [];
@@ -1986,4 +2009,4 @@ function ldsRuntimeBridge() {
1986
2009
  }
1987
2010
 
1988
2011
  export { ldsRuntimeBridge as default };
1989
- // version: 1.365.0-eec7b6223e
2012
+ // version: 1.366.0-30380c7ed7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-bridge",
3
- "version": "1.365.0",
3
+ "version": "1.366.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS runtime for bridge.app.",
6
6
  "main": "dist/ldsRuntimeBridge.js",
@@ -34,18 +34,18 @@
34
34
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-bridge"
35
35
  },
36
36
  "dependencies": {
37
- "@salesforce/lds-bindings": "^1.365.0",
38
- "@salesforce/lds-durable-records": "^1.365.0",
39
- "@salesforce/lds-instrumentation": "^1.365.0",
40
- "@salesforce/lds-runtime-mobile": "^1.365.0",
37
+ "@salesforce/lds-bindings": "^1.366.0",
38
+ "@salesforce/lds-durable-records": "^1.366.0",
39
+ "@salesforce/lds-instrumentation": "^1.366.0",
40
+ "@salesforce/lds-runtime-mobile": "^1.366.0",
41
41
  "@salesforce/user": "0.0.21",
42
42
  "o11y": "250.7.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@salesforce/lds-network-aura": "^1.365.0",
46
- "@salesforce/lds-runtime-aura": "^1.365.0",
47
- "@salesforce/lds-store-nimbus": "^1.365.0",
48
- "@salesforce/nimbus-plugin-lds": "^1.365.0",
45
+ "@salesforce/lds-network-aura": "^1.366.0",
46
+ "@salesforce/lds-runtime-aura": "^1.366.0",
47
+ "@salesforce/lds-store-nimbus": "^1.366.0",
48
+ "@salesforce/nimbus-plugin-lds": "^1.366.0",
49
49
  "babel-plugin-dynamic-import-node": "^2.3.3"
50
50
  },
51
51
  "luvioBundlesize": [