@salesforce/lds-runtime-aura 1.304.0 → 1.306.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.
@@ -27,12 +27,12 @@ import { serviceBroker } from 'force/luvioServiceBroker5';
27
27
  import oneStoreEnabled from '@salesforce/gate/lds.oneStoreEnabled.ltng';
28
28
  import oneStoreUiapiEnabled from '@salesforce/gate/lds.oneStoreUiapiEnabled.ltng';
29
29
  import { getDefinition, executeGlobalControllerRawResponse } from 'aura';
30
- import { buildJwtNetworkAdapter, setupLexJwtNetworkAdapter } from 'force/ldsNetworkFetchWithJwt';
30
+ import { buildJwtNetworkAdapter, instrument as instrument$2, setupLexJwtNetworkAdapter } from 'force/ldsNetworkFetchWithJwt';
31
31
  import auraNetworkAdapter, { dispatchAuraAction, defaultActionConfig, instrument as instrument$1, forceRecordTransactionsDisabled as forceRecordTransactionsDisabled$1, ldsNetworkAdapterInstrument, CrudEventState, CrudEventType, UIAPI_RECORDS_PATH, UIAPI_RELATED_LIST_RECORDS_BATCH_PATH, UIAPI_RELATED_LIST_RECORDS_PATH } from 'force/ldsNetwork';
32
- import { LRUCache, instrumentAdapter, instrumentLuvio, setupInstrumentation as setupInstrumentation$1, logObjectInfoChanged as logObjectInfoChanged$1, updatePercentileHistogramMetric, incrementCounterMetric, incrementGetRecordNotifyChangeAllowCount, incrementGetRecordNotifyChangeDropCount, incrementNotifyRecordUpdateAvailableAllowCount, incrementNotifyRecordUpdateAvailableDropCount, setLdsAdaptersUiapiInstrumentation, setLdsNetworkAdapterInstrumentation, executeAsyncActivity, METRIC_KEYS, onIdleDetected } from 'force/ldsInstrumentation';
33
- import { REFRESH_ADAPTER_EVENT, ADAPTER_UNFULFILLED_ERROR, instrument as instrument$2 } from 'force/ldsBindings';
32
+ import { LRUCache, instrumentAdapter, instrumentLuvio, setupInstrumentation as setupInstrumentation$1, logObjectInfoChanged as logObjectInfoChanged$1, updatePercentileHistogramMetric, incrementCounterMetric, incrementGetRecordNotifyChangeAllowCount, incrementGetRecordNotifyChangeDropCount, incrementNotifyRecordUpdateAvailableAllowCount, incrementNotifyRecordUpdateAvailableDropCount, setLdsAdaptersUiapiInstrumentation, logError, setLdsNetworkAdapterInstrumentation, executeAsyncActivity, METRIC_KEYS, onIdleDetected } from 'force/ldsInstrumentation';
33
+ import { REFRESH_ADAPTER_EVENT, ADAPTER_UNFULFILLED_ERROR, instrument as instrument$3 } from 'force/ldsBindings';
34
34
  import { counter, registerCacheStats, perfStart, perfEnd, registerPeriodicLogger, interaction, timer } from 'instrumentation/service';
35
- import { instrument as instrument$3 } from 'force/adsBridge';
35
+ import { instrument as instrument$4 } from 'force/adsBridge';
36
36
  import { withRegistration, register, setDefaultLuvio } from 'force/ldsEngine';
37
37
  import { createStorage, clearStorages } from 'force/ldsStorage';
38
38
  import useHttpInsteadAuraTransport from '@salesforce/gate/lds.useHttpInsteadAuraTransport';
@@ -1698,9 +1698,15 @@ class LexDefaultPage extends PredictivePrefetchPage {
1698
1698
  getAlwaysRunRequests() {
1699
1699
  return [];
1700
1700
  }
1701
+ shouldReduceAlwaysRequestsWithPredictions() {
1702
+ return true;
1703
+ }
1704
+ shouldExecuteAlwaysRequestByThemself() {
1705
+ return false;
1706
+ }
1701
1707
  }
1702
1708
 
1703
- class RecordHomePage extends PredictivePrefetchPage {
1709
+ class RecordHomePage extends LexDefaultPage {
1704
1710
  constructor(context, requestStrategies, options) {
1705
1711
  super(context);
1706
1712
  this.requestStrategies = requestStrategies;
@@ -1755,6 +1761,23 @@ class RecordHomePage extends PredictivePrefetchPage {
1755
1761
  },
1756
1762
  ];
1757
1763
  }
1764
+ /**
1765
+ * In RH, we know that there will be predictions, and we want to reduce the always requests (getRecord(id, type))
1766
+ * with one of the predictions in case some request containing the fields was missed in the predictions.
1767
+ *
1768
+ * @returns true
1769
+ */
1770
+ shouldReduceAlwaysRequestsWithPredictions() {
1771
+ return true;
1772
+ }
1773
+ /**
1774
+ * In RH, we should execute the getRecord(id, type) by itself as we want the result asap, so
1775
+ * it does not stop rendering.
1776
+ * @returns true
1777
+ */
1778
+ shouldExecuteAlwaysRequestByThemself() {
1779
+ return true;
1780
+ }
1758
1781
  static handlesContext(context) {
1759
1782
  const maybeRecordHomePageContext = context;
1760
1783
  return (maybeRecordHomePageContext !== undefined &&
@@ -1765,7 +1788,7 @@ class RecordHomePage extends PredictivePrefetchPage {
1765
1788
  }
1766
1789
  }
1767
1790
 
1768
- class ObjectHomePage extends PredictivePrefetchPage {
1791
+ class ObjectHomePage extends LexDefaultPage {
1769
1792
  constructor(context, requestStrategies, options) {
1770
1793
  super(context);
1771
1794
  this.requestStrategies = requestStrategies;
@@ -1834,6 +1857,24 @@ class ObjectHomePage extends PredictivePrefetchPage {
1834
1857
  },
1835
1858
  ];
1836
1859
  }
1860
+ /**
1861
+ * AlwaysRequests must be reduced with predictions.
1862
+ *
1863
+ * @returns true
1864
+ */
1865
+ shouldReduceAlwaysRequestsWithPredictions() {
1866
+ return true;
1867
+ }
1868
+ /**
1869
+ * In OH, the always requests are reduced with predictions, and because they
1870
+ * can't be merged with other predictions, they will always run by themself.
1871
+ * This value must be `false`, otherwise we may see repeated requests.
1872
+ *
1873
+ * @returns false
1874
+ */
1875
+ shouldExecuteAlwaysRequestByThemself() {
1876
+ return false;
1877
+ }
1837
1878
  // Identifies a valid ObjectHomeContext
1838
1879
  static handlesContext(context) {
1839
1880
  const maybeObjectHomePageContext = context;
@@ -2367,10 +2408,13 @@ function setAuraInstrumentationHooks() {
2367
2408
  networkResponse: incrementRequestResponseCount,
2368
2409
  });
2369
2410
  instrument$2({
2411
+ error: logError,
2412
+ });
2413
+ instrument$3({
2370
2414
  refreshCalled: instrumentation.handleRefreshApiCall.bind(instrumentation),
2371
2415
  instrumentAdapter: instrumentation.instrumentAdapter.bind(instrumentation),
2372
2416
  });
2373
- instrument$3({
2417
+ instrument$4({
2374
2418
  timerMetricAddDuration: updateTimerMetric,
2375
2419
  });
2376
2420
  // Our getRecord through aggregate-ui CRUD logging has moved
@@ -2588,17 +2632,13 @@ class LexPredictivePrefetcher extends ApplicationPredictivePrefetcher {
2588
2632
  return [...exactPageRequests, ...similarPageRequests];
2589
2633
  }
2590
2634
  async predict() {
2635
+ const alwaysRequests = this.page.getAlwaysRunRequests();
2591
2636
  const pageRequests = this.getAllPageRequests();
2592
2637
  // IMPORTANT: Because there's no way to diferentiate a cmpDef prediction from the page
2593
2638
  // requesting the cmpDef, we need to predict cmpDefs before we start watching
2594
2639
  // for predictions in the page. Having this code after an
2595
2640
  // await will make the predictions to be saved as predictions too.
2596
2641
  predictComponentDefs(pageRequests.filter(isCmpDefsRequest), this.requestRunner);
2597
- // IMPORTANT: The `await` has no effect on this operation because `getAlwaysRunRequests`
2598
- // is sync; however if removed, it will have a negative effect when used with
2599
- // Aura Network: predictions will be boxcar'd, which likely will result in a
2600
- // perf regression.
2601
- const alwaysRequests = await this.page.getAlwaysRunRequests();
2602
2642
  const alwaysRequestEntries = alwaysRequests.map((request) => {
2603
2643
  return {
2604
2644
  request,
@@ -2606,18 +2646,19 @@ class LexPredictivePrefetcher extends ApplicationPredictivePrefetcher {
2606
2646
  };
2607
2647
  });
2608
2648
  const nonCmpDefPredictions = pageRequests.filter((r) => !isCmpDefsRequest(r));
2609
- const reducedPredictions = this.requestRunner.reduceRequests([
2610
- ...nonCmpDefPredictions,
2611
- ...alwaysRequestEntries,
2612
- ]); // In future - remove alwaysRequestEntries when on OneStore
2613
- // Always requests must go by themself - Some of them are essential to keep the page rendering at the beginning.
2614
- const predictedRequestsWithLimit = [...alwaysRequestEntries, ...reducedPredictions].sort((a, b) => a.requestMetadata.requestTime - b.requestMetadata.requestTime); // In future - choose sort algorithm via Gate?;
2649
+ const reducedPredictions = this.page.shouldReduceAlwaysRequestsWithPredictions()
2650
+ ? this.requestRunner.reduceRequests([...nonCmpDefPredictions, ...alwaysRequestEntries])
2651
+ : this.requestRunner.reduceRequests(nonCmpDefPredictions);
2652
+ const predictedRequestsWithLimit = (this.page.shouldExecuteAlwaysRequestByThemself()
2653
+ ? [...alwaysRequestEntries, ...reducedPredictions]
2654
+ : reducedPredictions)
2655
+ // Sorting in order requested
2656
+ .sort((a, b) => a.requestMetadata.requestTime - b.requestMetadata.requestTime);
2615
2657
  await runRequestsWithLimit(predictedRequestsWithLimit, this.requestRunner, this.options.inflightRequestLimit,
2616
- // `this.repository.pageStartTime` would be the correct here, but because
2617
- // the await hack (see W-16139321), there's some delta by the time this executed,
2618
- // on the other hand, when W-16139321 is fixed,
2619
- // when doing predict+watch, it could be (set in watch) repository.startTime is not set yet,
2620
- // Date.now() is a better alternative, that is correct, and works on both cases.
2658
+ // `this.repository.pageStartTime` would be the correct here,
2659
+ // but when doing predict+watch, it could be (set in watch)
2660
+ // repository.startTime is not set yet, Date.now() is a better alternative,
2661
+ // that is correct, and works on both cases.
2621
2662
  Date.now());
2622
2663
  }
2623
2664
  }
@@ -2710,8 +2751,9 @@ function deepEquals(objA, objB) {
2710
2751
  }
2711
2752
 
2712
2753
  class PrefetchRepository {
2713
- constructor(storage) {
2754
+ constructor(storage, options = {}) {
2714
2755
  this.storage = storage;
2756
+ this.options = options;
2715
2757
  this.requestBuffer = new Map();
2716
2758
  this.pageStartTime = Date.now();
2717
2759
  }
@@ -2739,6 +2781,10 @@ class PrefetchRepository {
2739
2781
  existingRequestEntry.requestMetadata.requestTime = requestTime;
2740
2782
  }
2741
2783
  });
2784
+ const { modifyBeforeSaveHook } = this.options;
2785
+ if (modifyBeforeSaveHook !== undefined) {
2786
+ page.requests = modifyBeforeSaveHook(page.requests);
2787
+ }
2742
2788
  setPromises.push(this.storage.set(id, page));
2743
2789
  }
2744
2790
  this.clearRequestBuffer();
@@ -2886,6 +2932,10 @@ const onePreloads = new Set([
2886
2932
  'markup://force:relatedListQuickLinksContainer',
2887
2933
  'markup://lst:relatedListQuickLinksContainer',
2888
2934
  'markup://lst:secondDegreeRelatedListSingleContainer',
2935
+ 'markup://lst:bundle_act_coreListViewManagerDesktop',
2936
+ 'markup://lst:bundle_act_coreListViewManagerDesktop_generatedTemplates',
2937
+ 'markup://lst:baseFilterPanel',
2938
+ 'markup://lst:chartPanel',
2889
2939
  'markup://force:socialPhotoWrapper',
2890
2940
  'markup://forceContent:contentVersionsEditWizard',
2891
2941
  'markup://forceContent:outputTitle',
@@ -2995,7 +3045,16 @@ class GetComponentsDefStrategy extends RequestStrategy {
2995
3045
  combineRequests(reqA, reqB) {
2996
3046
  const result = new Set(reqA);
2997
3047
  reqB.forEach((c) => result.add(c));
2998
- return [...result];
3048
+ // remove the ones that can't be preloaded.
3049
+ return [...result].filter((def) => {
3050
+ return (def.startsWith('markup://') &&
3051
+ !(
3052
+ // any generated template
3053
+ (def.includes('forceGenerated') ||
3054
+ // part of onePreload
3055
+ def.includes('one:onePreloads') ||
3056
+ onePreloads.has(def))));
3057
+ });
2999
3058
  }
3000
3059
  isContextDependent(_context, _request) {
3001
3060
  return true;
@@ -3004,7 +3063,14 @@ class GetComponentsDefStrategy extends RequestStrategy {
3004
3063
 
3005
3064
  const LDS_PDL_CMP_IDENTIFIER = 'lds:pdl';
3006
3065
  const DEFAULT_RESOURCE_CONTEXT = {
3007
- sourceContext: { tagName: LDS_PDL_CMP_IDENTIFIER },
3066
+ sourceContext: {
3067
+ tagName: LDS_PDL_CMP_IDENTIFIER,
3068
+ actionConfig: {
3069
+ background: false,
3070
+ hotspot: true,
3071
+ longRunning: false,
3072
+ },
3073
+ },
3008
3074
  };
3009
3075
  class LuvioAdapterRequestStrategy extends RequestStrategy {
3010
3076
  constructor(luvio) {
@@ -3556,9 +3622,18 @@ class GetRelatedListRecordsRequestStrategy extends LuvioAdapterRequestStrategy {
3556
3622
  }
3557
3623
  }
3558
3624
 
3625
+ const APEX_RESOURCE_CONTEXT = {
3626
+ ...DEFAULT_RESOURCE_CONTEXT,
3627
+ sourceContext: {
3628
+ ...DEFAULT_RESOURCE_CONTEXT.sourceContext,
3629
+ // We don't want to override anything for Apex, it is not part
3630
+ // of UiApi, and it can cause undesired behavior.
3631
+ actionConfig: undefined,
3632
+ },
3633
+ };
3559
3634
  function getApexPdlFactory(luvio) {
3560
- return ({ invokerParams, config }) => {
3561
- return GetApexWireAdapterFactory(luvio, invokerParams)(config);
3635
+ return ({ invokerParams, config }, requestContext) => {
3636
+ return GetApexWireAdapterFactory(luvio, invokerParams)(config, requestContext);
3562
3637
  };
3563
3638
  }
3564
3639
  class GetApexRequestStrategy extends LuvioAdapterRequestStrategy {
@@ -3570,6 +3645,9 @@ class GetApexRequestStrategy extends LuvioAdapterRequestStrategy {
3570
3645
  buildConcreteRequest(similarRequest) {
3571
3646
  return similarRequest;
3572
3647
  }
3648
+ execute(config, _requestContext) {
3649
+ return super.execute(config, APEX_RESOURCE_CONTEXT);
3650
+ }
3573
3651
  }
3574
3652
 
3575
3653
  const GET_LIST_INFO_BY_NAME_ADAPTER_NAME = 'getListInfoByName';
@@ -3846,7 +3924,7 @@ function getEnvironmentSetting(name) {
3846
3924
  }
3847
3925
  return undefined;
3848
3926
  }
3849
- // version: 1.304.0-d87b57badb
3927
+ // version: 1.306.0-c047984840
3850
3928
 
3851
3929
  const forceRecordTransactionsDisabled = getEnvironmentSetting(EnvironmentSettings.ForceRecordTransactionsDisabled);
3852
3930
  //TODO: Some duplication here that can be most likely moved to a util class
@@ -4179,8 +4257,10 @@ function getInflightRequestLimit() {
4179
4257
  }
4180
4258
  function setupPredictivePrefetcher(luvio) {
4181
4259
  const storage = buildAuraPrefetchStorage();
4182
- const repository = new PrefetchRepository(storage);
4183
4260
  const requestRunner = new LexRequestRunner(luvio);
4261
+ const repository = new PrefetchRepository(storage, {
4262
+ modifyBeforeSaveHook: (requests) => requestRunner.reduceRequests(requests),
4263
+ });
4184
4264
  const inflightRequestLimit = applyPredictionRequestLimit.isOpen({ fallback: false })
4185
4265
  ? getInflightRequestLimit()
4186
4266
  : 1000;
@@ -4397,4 +4477,4 @@ function ldsEngineCreator() {
4397
4477
  }
4398
4478
 
4399
4479
  export { buildPredictorForContext, ldsEngineCreator as default, initializeLDS, initializeOneStore };
4400
- // version: 1.304.0-aa3e5f9550
4480
+ // version: 1.306.0-66359b439e
@@ -1,2 +1,3 @@
1
1
  export declare function buildJwtNetworkAdapter(): void;
2
2
  export declare function setupLexJwtNetworkAdapter(): void;
3
+ export declare function instrument(): void;
@@ -1,12 +1,14 @@
1
1
  import type { LexRequest } from '../prefetcher';
2
2
  import { PredictivePrefetchPage } from './predictive-prefetch-page';
3
3
  export type DefaultPageContext = Record<string, any>;
4
- export declare class LexDefaultPage extends PredictivePrefetchPage<LexRequest, DefaultPageContext> {
5
- constructor(context: DefaultPageContext);
6
- buildSaveRequestData(request: LexRequest): {
7
- context: DefaultPageContext;
8
- request: LexRequest;
4
+ export declare class LexDefaultPage<Request extends LexRequest, Context extends DefaultPageContext> extends PredictivePrefetchPage<Request, Context> {
5
+ constructor(context: Context);
6
+ buildSaveRequestData(request: Request): {
7
+ context: Context;
8
+ request: Request;
9
9
  }[];
10
- resolveSimilarRequest(similarRequest: LexRequest): LexRequest;
11
- getAlwaysRunRequests(): LexRequest[];
10
+ resolveSimilarRequest(similarRequest: Request): Request;
11
+ getAlwaysRunRequests(): Request[];
12
+ shouldReduceAlwaysRequestsWithPredictions(): boolean;
13
+ shouldExecuteAlwaysRequestByThemself(): boolean;
12
14
  }
@@ -1,13 +1,13 @@
1
1
  import type { LexContext, LexPrefetcherOptions } from '../prefetcher';
2
2
  import type { GetListInfoByNameRequestStrategy, GetListInfoByNameRequest, GetListRecordsByNameRequestStrategy, GetListRecordsByNameRequest, GetListInfosByObjectNameRequestStrategy, GetListInfosByObjectNameRequest, GetObjectInfosRequest, GetObjectInfosRequestStrategy, GetListObjectInfoRequest, GetListObjectInfoRequestStrategy } from '../request-strategy';
3
- import { PredictivePrefetchPage } from './predictive-prefetch-page';
3
+ import { LexDefaultPage } from './lex-default-page';
4
4
  export type ObjectHomePageContext = {
5
5
  objectApiName: string;
6
6
  listViewApiName: string;
7
7
  type: 'objectHomePage';
8
8
  };
9
9
  export type ObjectHomePageRequest = GetListInfoByNameRequest | GetListObjectInfoRequest | GetListRecordsByNameRequest | GetListInfosByObjectNameRequest | GetObjectInfosRequest;
10
- export declare class ObjectHomePage extends PredictivePrefetchPage<ObjectHomePageRequest, ObjectHomePageContext> {
10
+ export declare class ObjectHomePage extends LexDefaultPage<ObjectHomePageRequest, ObjectHomePageContext> {
11
11
  private requestStrategies;
12
12
  private options;
13
13
  similarContext: ObjectHomePageContext;
@@ -24,5 +24,19 @@ export declare class ObjectHomePage extends PredictivePrefetchPage<ObjectHomePag
24
24
  }[];
25
25
  resolveSimilarRequest(similarRequest: ObjectHomePageRequest): ObjectHomePageRequest;
26
26
  getAlwaysRunRequests(): ObjectHomePageRequest[];
27
+ /**
28
+ * AlwaysRequests must be reduced with predictions.
29
+ *
30
+ * @returns true
31
+ */
32
+ shouldReduceAlwaysRequestsWithPredictions(): boolean;
33
+ /**
34
+ * In OH, the always requests are reduced with predictions, and because they
35
+ * can't be merged with other predictions, they will always run by themself.
36
+ * This value must be `false`, otherwise we may see repeated requests.
37
+ *
38
+ * @returns false
39
+ */
40
+ shouldExecuteAlwaysRequestByThemself(): boolean;
27
41
  static handlesContext(context: LexContext): context is ObjectHomePageContext;
28
42
  }
@@ -1,6 +1,6 @@
1
1
  import type { LexContext, LexPrefetcherOptions } from '../prefetcher';
2
2
  import type { GetRecordRequest, GetRecordsRequest, GetRecordRequestStrategy, GetRecordsRequestStrategy, GetRecordActionsRequestStrategy, GetRecordActionsRequest, GetRecordAvatarsRequest, GetRecordAvatarsRequestStrategy, GetObjectInfoRequest, GetObjectInfosRequest, GetObjectInfoRequestStrategy, GetObjectInfosRequestStrategy, GetRelatedListsActionsRequestStrategy, GetRelatedListsActionsRequest, GetRelatedListInfoBatchRequestStrategy, GetRelatedListInfoBatchRequest, GetRelatedListRecordsRequestStrategy, GetRelatedListRecordsRequest, GetRelatedListRecordsBatchRequestStrategy, GetRelatedListRecordsBatchRequest, GetApexRequest, GetComponentsRequest, GetApexRequestStrategy, GetComponentsDefStrategy } from '../request-strategy';
3
- import { PredictivePrefetchPage } from './predictive-prefetch-page';
3
+ import { LexDefaultPage } from './lex-default-page';
4
4
  export type RecordHomePageContext = {
5
5
  objectApiName: string;
6
6
  recordId: string;
@@ -22,7 +22,7 @@ type RecordHomePageRequestStrategies = {
22
22
  getApex: GetApexRequestStrategy;
23
23
  getComponentsDef: GetComponentsDefStrategy;
24
24
  };
25
- export declare class RecordHomePage extends PredictivePrefetchPage<RecordHomePageRequest, RecordHomePageContext> {
25
+ export declare class RecordHomePage extends LexDefaultPage<RecordHomePageRequest, RecordHomePageContext> {
26
26
  private requestStrategies;
27
27
  private options;
28
28
  similarContext: RecordHomePageContext;
@@ -33,6 +33,19 @@ export declare class RecordHomePage extends PredictivePrefetchPage<RecordHomePag
33
33
  }[];
34
34
  resolveSimilarRequest(similarRequest: RecordHomePageRequest): RecordHomePageRequest;
35
35
  getAlwaysRunRequests(): RecordHomePageRequest[];
36
+ /**
37
+ * In RH, we know that there will be predictions, and we want to reduce the always requests (getRecord(id, type))
38
+ * with one of the predictions in case some request containing the fields was missed in the predictions.
39
+ *
40
+ * @returns true
41
+ */
42
+ shouldReduceAlwaysRequestsWithPredictions(): boolean;
43
+ /**
44
+ * In RH, we should execute the getRecord(id, type) by itself as we want the result asap, so
45
+ * it does not stop rendering.
46
+ * @returns true
47
+ */
48
+ shouldExecuteAlwaysRequestByThemself(): boolean;
36
49
  static handlesContext(context: LexContext): context is RecordHomePageContext;
37
50
  }
38
51
  export {};
@@ -1,5 +1,6 @@
1
1
  import { ApplicationPredictivePrefetcher } from './predictive-prefetcher';
2
- import type { DefaultPageContext, PredictivePrefetchPage } from '../pages';
2
+ import { LexDefaultPage } from '../pages/lex-default-page';
3
+ import type { DefaultPageContext } from '../pages';
3
4
  import type { GetRecordActionsRequestStrategy, GetRecordAvatarsRequestStrategy, GetRecordRequestStrategy, GetRecordsRequestStrategy, GetObjectInfoRequestStrategy, GetObjectInfosRequestStrategy, GetRelatedListsActionsRequestStrategy, GetRelatedListInfoBatchRequestStrategy, GetRelatedListRecordsRequestStrategy, GetRelatedListRecordsBatchRequestStrategy, GetListInfoByNameRequestStrategy, GetListRecordsByNameRequestStrategy, GetApexRequestStrategy, GetComponentsDefStrategy, GetListInfosByObjectNameRequestStrategy, GetListObjectInfoRequestStrategy } from '../request-strategy';
4
5
  import type { RequestRunner } from '../request-runner';
5
6
  import type { PrefetchRepository } from '../repository/prefetch-repository';
@@ -25,6 +26,7 @@ export type LexPrefetcherOptions = {
25
26
  export declare class LexPredictivePrefetcher extends ApplicationPredictivePrefetcher<LexRequest, LexContext> {
26
27
  private requestStrategies;
27
28
  protected options: LexPrefetcherOptions;
29
+ page: LexDefaultPage<LexRequest, LexContext>;
28
30
  constructor(context: LexContext, repository: PrefetchRepository, requestRunner: RequestRunner<LexRequest>, requestStrategies: {
29
31
  getRecord: GetRecordRequestStrategy;
30
32
  getRecords: GetRecordsRequestStrategy;
@@ -43,7 +45,7 @@ export declare class LexPredictivePrefetcher extends ApplicationPredictivePrefet
43
45
  getApex: GetApexRequestStrategy;
44
46
  getComponentsDef: GetComponentsDefStrategy;
45
47
  }, options: LexPrefetcherOptions);
46
- getPage(): PredictivePrefetchPage<LexRequest, LexContext>;
48
+ getPage(): LexDefaultPage<LexRequest, LexContext>;
47
49
  getAllPageRequests(): RequestEntry<LexRequest>[];
48
50
  predict(): Promise<void>;
49
51
  }
@@ -9,10 +9,14 @@ export type PageEntry<Request> = {
9
9
  id: string;
10
10
  requests: RequestEntry<Request>[];
11
11
  };
12
+ export type PrefetchRepositoryOptions = {
13
+ modifyBeforeSaveHook?: (requests: RequestEntry<any>[]) => RequestEntry<any>[];
14
+ };
12
15
  export declare class PrefetchRepository {
13
16
  private storage;
17
+ private options;
14
18
  private requestBuffer;
15
- constructor(storage: PrefetchStorage);
19
+ constructor(storage: PrefetchStorage, options?: PrefetchRepositoryOptions);
16
20
  clearRequestBuffer(): void;
17
21
  pageStartTime: number;
18
22
  markPageStart(): void;
@@ -1,5 +1,5 @@
1
1
  import type { ApexInvokerParams } from '@salesforce/lds-adapters-apex';
2
- import type { Luvio } from '@luvio/engine';
2
+ import type { AdapterRequestContext, Luvio, Snapshot } from '@luvio/engine';
3
3
  import { LuvioAdapterRequestStrategy } from './luvio-adapter-request-strategy';
4
4
  export type GetApexConfig = {
5
5
  name: string;
@@ -10,11 +10,12 @@ export type GetApexRequest = {
10
10
  adapterName: 'getApex';
11
11
  config: GetApexConfig;
12
12
  };
13
- export declare function getApexPdlFactory(luvio: Luvio): ({ invokerParams, config }: GetApexConfig) => import("@luvio/engine").Snapshot<any> | Promise<import("@luvio/engine").Snapshot<any>> | null;
13
+ export declare function getApexPdlFactory(luvio: Luvio): ({ invokerParams, config }: GetApexConfig, requestContext?: AdapterRequestContext) => Snapshot<any> | Promise<Snapshot<any>> | null;
14
14
  type GetApexContext = Record<string, unknown>;
15
15
  export declare class GetApexRequestStrategy extends LuvioAdapterRequestStrategy<GetApexConfig, GetApexRequest, GetApexContext> {
16
16
  adapterName: string;
17
17
  adapterFactory: typeof getApexPdlFactory;
18
18
  buildConcreteRequest(similarRequest: GetApexRequest): GetApexRequest;
19
+ execute(config: GetApexConfig, _requestContext?: AdapterRequestContext | undefined): Snapshot<any> | Promise<Snapshot<any>> | null;
19
20
  }
20
21
  export {};
@@ -1,6 +1,16 @@
1
1
  import type { AdapterFactory, AdapterRequestContext, Luvio, Snapshot } from '@luvio/engine';
2
2
  import type { BaseAdapterRequest } from './request-strategy';
3
3
  import { RequestStrategy } from './request-strategy';
4
+ export declare const DEFAULT_RESOURCE_CONTEXT: {
5
+ sourceContext: {
6
+ tagName: string;
7
+ actionConfig: {
8
+ background: boolean;
9
+ hotspot: boolean;
10
+ longRunning: boolean;
11
+ };
12
+ };
13
+ };
4
14
  export declare abstract class LuvioAdapterRequestStrategy<AdapterConfig, Request extends BaseAdapterRequest<AdapterConfig>, Context> extends RequestStrategy<AdapterConfig, Request, Context> {
5
15
  private luvio;
6
16
  constructor(luvio: Luvio);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-runtime-aura",
3
- "version": "1.304.0",
3
+ "version": "1.306.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "LDS engine for Aura runtime",
6
6
  "main": "dist/ldsEngineCreator.js",
@@ -35,15 +35,15 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "@luvio/service-broker": "5.3.1",
38
- "@salesforce/lds-adapters-apex": "^1.304.0",
39
- "@salesforce/lds-adapters-uiapi": "^1.304.0",
38
+ "@salesforce/lds-adapters-apex": "^1.306.0",
39
+ "@salesforce/lds-adapters-uiapi": "^1.306.0",
40
40
  "@salesforce/lds-adapters-uiapi-lex": "^1.302.0",
41
- "@salesforce/lds-ads-bridge": "^1.304.0",
42
- "@salesforce/lds-aura-storage": "^1.304.0",
43
- "@salesforce/lds-bindings": "^1.304.0",
44
- "@salesforce/lds-instrumentation": "^1.304.0",
45
- "@salesforce/lds-network-aura": "^1.304.0",
46
- "@salesforce/lds-network-fetch-with-jwt": "^1.304.0"
41
+ "@salesforce/lds-ads-bridge": "^1.306.0",
42
+ "@salesforce/lds-aura-storage": "^1.306.0",
43
+ "@salesforce/lds-bindings": "^1.306.0",
44
+ "@salesforce/lds-instrumentation": "^1.306.0",
45
+ "@salesforce/lds-network-aura": "^1.306.0",
46
+ "@salesforce/lds-network-fetch-with-jwt": "^1.306.0"
47
47
  },
48
48
  "dependencies": {
49
49
  "@luvio/command-aura-network": "5.3.1",
@@ -64,15 +64,15 @@
64
64
  "@luvio/service-subscription": "5.3.1",
65
65
  "@luvio/service-type-registry": "5.3.1",
66
66
  "@luvio/utils": "5.3.1",
67
- "@salesforce/lds-adapters-uiapi-lex": "^1.304.0"
67
+ "@salesforce/lds-adapters-uiapi-lex": "^1.306.0"
68
68
  },
69
69
  "luvioBundlesize": [
70
70
  {
71
71
  "path": "./dist/ldsEngineCreator.js",
72
72
  "maxSize": {
73
- "none": "165 kB",
74
- "min": "68 kB",
75
- "compressed": "30 kB"
73
+ "none": "170 kB",
74
+ "min": "70 kB",
75
+ "compressed": "31 kB"
76
76
  }
77
77
  }
78
78
  ],