@salesforce/lds-runtime-aura 1.421.0 → 1.421.1

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.
@@ -2706,7 +2706,7 @@ function buildServiceDescriptor$d(luvio) {
2706
2706
  },
2707
2707
  };
2708
2708
  }
2709
- // version: 1.421.0-45320a2742
2709
+ // version: 1.421.1-00b4791b5e
2710
2710
 
2711
2711
  /*!
2712
2712
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -3059,7 +3059,7 @@ function buildServiceDescriptor$9(notifyRecordUpdateAvailable, getNormalizedLuvi
3059
3059
  },
3060
3060
  };
3061
3061
  }
3062
- // version: 1.421.0-45320a2742
3062
+ // version: 1.421.1-00b4791b5e
3063
3063
 
3064
3064
  /*!
3065
3065
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -5695,7 +5695,7 @@ function getEnvironmentSetting(name) {
5695
5695
  }
5696
5696
  return undefined;
5697
5697
  }
5698
- // version: 1.421.0-45320a2742
5698
+ // version: 1.421.1-00b4791b5e
5699
5699
 
5700
5700
  const environmentHasAura = typeof window !== 'undefined' && typeof window.$A !== 'undefined';
5701
5701
  const defaultConfig = {
@@ -6397,11 +6397,12 @@ function createActionEndMark(responseStatus, responseStatusText, serverTiming, u
6397
6397
  mark('actions', 'finishStart', ctx);
6398
6398
  mark('actions', 'finishEnd', ctx);
6399
6399
  }
6400
+ const seenResources = new WeakSet();
6400
6401
  function createTransportEndMark(responseStatus, responseStatusText, url, context, errorMessage) {
6401
6402
  if (context && context.instrumentationId) {
6402
6403
  const endMark = markEnd('transport', 'request', { auraXHRId: context.instrumentationId });
6403
- if (performance && performance.getEntriesByName) {
6404
- const resources = performance.getEntriesByName(url);
6404
+ if (performance) {
6405
+ const resources = getFetchResourcesByUrlPrefix(url);
6405
6406
  let resource;
6406
6407
  if (resources.length) {
6407
6408
  if (resources.length === 1) {
@@ -6410,10 +6411,11 @@ function createTransportEndMark(responseStatus, responseStatusText, url, context
6410
6411
  }
6411
6412
  else {
6412
6413
  // otherwise we need to guess based on the start time
6413
- resource = findCorrectResource(resources, context);
6414
+ resource = findCorrectResource(resources, url, context);
6414
6415
  }
6415
6416
  if (resource) {
6416
6417
  setResourceTimings(context.instrumentationId, responseStatus, responseStatusText, endMark, resource);
6418
+ seenResources.add(resource);
6417
6419
  }
6418
6420
  }
6419
6421
  else if (errorMessage) {
@@ -6478,7 +6480,38 @@ function getServerTiming(serverTiming) {
6478
6480
  }
6479
6481
  return 0;
6480
6482
  }
6481
- function findCorrectResource(resources, context) {
6483
+ function getFetchResourcesByUrlPrefix(url) {
6484
+ const exactMatches = performance.getEntriesByName(url);
6485
+ // first check for exact url matches, otherwise match based on base url
6486
+ if (exactMatches.length) {
6487
+ return exactMatches;
6488
+ }
6489
+ return performance
6490
+ .getEntriesByType('resource')
6491
+ .filter((entry) => entry.initiatorType === 'fetch')
6492
+ .filter((entry) => entry.name === url || entry.name.startsWith(url + '?'));
6493
+ }
6494
+ function findCorrectResource(resources, url, context) {
6495
+ // first check params, then check time
6496
+ const matchingResources = [];
6497
+ if (context.queryParams) {
6498
+ const urlWithParams = buildUrlWithParams(url, context.queryParams);
6499
+ for (let entry in resources) {
6500
+ const resource = resources[entry];
6501
+ if (resource.name === urlWithParams && !seenResources.has(resource)) {
6502
+ matchingResources.push(resource);
6503
+ }
6504
+ }
6505
+ }
6506
+ if (matchingResources.length === 1) {
6507
+ return matchingResources[0];
6508
+ }
6509
+ else if (matchingResources.length > 1) {
6510
+ resources = matchingResources;
6511
+ }
6512
+ // this means that we have multiple of the same request, and so we will fall back to timing. But this is only a best estimate,
6513
+ // since the urls are the only real way to differentiate between resources. This could also mean that there was an issue finding
6514
+ // the params, in which case we might as well fall back to timing as well.
6482
6515
  if (context && context.startTime) {
6483
6516
  let likelyResource = {
6484
6517
  index: 0,
@@ -6494,6 +6527,15 @@ function findCorrectResource(resources, context) {
6494
6527
  }
6495
6528
  return undefined;
6496
6529
  }
6530
+ function buildUrlWithParams(baseUrl, queryParams) {
6531
+ const parts = [];
6532
+ for (const [key, value] of Object.entries(queryParams)) {
6533
+ const values = Array.isArray(value) ? value : [value];
6534
+ const serialized = values.map((v) => encodeURIComponent(String(v))).join(',');
6535
+ parts.push(`${key}=${serialized}`);
6536
+ }
6537
+ return parts.length ? `${baseUrl}?${parts.join('&')}` : baseUrl;
6538
+ }
6497
6539
  function getResponseStatusText(responseCode) {
6498
6540
  if (responseCode.startsWith('2')) {
6499
6541
  return 'SUCCESS';
@@ -10606,4 +10648,4 @@ function ldsEngineCreator() {
10606
10648
  }
10607
10649
 
10608
10650
  export { LexRequestStrategy, PdlPrefetcherEventType, PdlRequestPriority, buildPredictorForContext, configService, ldsEngineCreator as default, initializeLDS, initializeOneStore, notifyUpdateAvailableFactory, registerRequestStrategy, saveRequestAsPrediction, subscribeToPrefetcherEvents, unregisterRequestStrategy, whenPredictionsReady };
10609
- // version: 1.421.0-2828c95aef
10651
+ // version: 1.421.1-4ac91ce6d0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-aura",
3
- "version": "1.421.0",
3
+ "version": "1.421.1",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Aura runtime",
6
6
  "main": "dist/ldsEngineCreator.js",
@@ -36,15 +36,15 @@
36
36
  "devDependencies": {
37
37
  "@conduit-client/service-provisioner": "3.15.1",
38
38
  "@conduit-client/tools-core": "3.15.1",
39
- "@salesforce/lds-adapters-apex": "^1.421.0",
40
- "@salesforce/lds-adapters-uiapi": "^1.421.0",
41
- "@salesforce/lds-ads-bridge": "^1.421.0",
42
- "@salesforce/lds-aura-storage": "^1.421.0",
43
- "@salesforce/lds-bindings": "^1.421.0",
39
+ "@salesforce/lds-adapters-apex": "^1.421.1",
40
+ "@salesforce/lds-adapters-uiapi": "^1.421.1",
41
+ "@salesforce/lds-ads-bridge": "^1.421.1",
42
+ "@salesforce/lds-aura-storage": "^1.421.1",
43
+ "@salesforce/lds-bindings": "^1.421.1",
44
44
  "@salesforce/lds-durable-storage": "^1.420.0",
45
- "@salesforce/lds-instrumentation": "^1.421.0",
46
- "@salesforce/lds-network-aura": "^1.421.0",
47
- "@salesforce/lds-network-fetch": "^1.421.0",
45
+ "@salesforce/lds-instrumentation": "^1.421.1",
46
+ "@salesforce/lds-network-aura": "^1.421.1",
47
+ "@salesforce/lds-network-fetch": "^1.421.1",
48
48
  "jwt-encode": "1.0.1"
49
49
  },
50
50
  "dependencies": {
@@ -75,11 +75,11 @@
75
75
  "@luvio/network-adapter-composable": "0.160.3",
76
76
  "@luvio/network-adapter-fetch": "0.160.3",
77
77
  "@lwc/state": "^0.28.0",
78
- "@salesforce/lds-adapters-onestore-graphql": "^1.421.0",
78
+ "@salesforce/lds-adapters-onestore-graphql": "^1.421.1",
79
79
  "@salesforce/lds-adapters-uiapi-lex": "^1.415.0",
80
- "@salesforce/lds-durable-storage": "^1.421.0",
81
- "@salesforce/lds-luvio-service": "^1.421.0",
82
- "@salesforce/lds-luvio-uiapi-records-service": "^1.421.0"
80
+ "@salesforce/lds-durable-storage": "^1.421.1",
81
+ "@salesforce/lds-luvio-service": "^1.421.1",
82
+ "@salesforce/lds-luvio-uiapi-records-service": "^1.421.1"
83
83
  },
84
84
  "luvioBundlesize": [
85
85
  {
@@ -87,7 +87,7 @@
87
87
  "maxSize": {
88
88
  "none": "370 kB",
89
89
  "min": "190 kB",
90
- "compressed": "60.8 kB"
90
+ "compressed": "60.9 kB"
91
91
  }
92
92
  }
93
93
  ],