@salesforce/lds-runtime-aura 1.280.0 → 1.282.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/ldsEngineCreator.js +40 -16
- package/dist/types/main.d.ts +1 -1
- package/dist/types/predictive-loading/common/index.d.ts +3 -0
- package/dist/types/predictive-loading/index.d.ts +1 -0
- package/dist/types/predictive-loading/request-strategy/get-object-info-request-strategy.d.ts +8 -0
- package/dist/types/predictive-loading/request-strategy/get-object-infos-request-strategy.d.ts +1 -0
- package/package.json +12 -12
package/dist/ldsEngineCreator.js
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
import { HttpStatusCode, InMemoryStore as InMemoryStore$1, Environment, Luvio, InMemoryStoreQueryEvaluator } from 'force/luvioEngine';
|
|
16
16
|
import ldsTrackedFieldsBehaviorGate from '@salesforce/gate/lds.useNewTrackedFieldBehavior';
|
|
17
17
|
import usePredictiveLoading from '@salesforce/gate/lds.usePredictiveLoading';
|
|
18
|
-
import { instrument, getRecordAvatarsAdapterFactory, getRecordAdapterFactory, coerceFieldIdArray, getRecordsAdapterFactory, getRecordActionsAdapterFactory,
|
|
18
|
+
import { instrument, getRecordAvatarsAdapterFactory, getRecordAdapterFactory, coerceFieldIdArray, getRecordsAdapterFactory, getRecordActionsAdapterFactory, getObjectInfosAdapterFactory, getObjectInfoAdapterFactory, getRelatedListsActionsAdapterFactory, getRelatedListInfoBatchAdapterFactory, getRelatedListRecordsBatchAdapterFactory, getRelatedListRecordsAdapterFactory, configuration, InMemoryRecordRepresentationQueryEvaluator, UiApiNamespace, RecordRepresentationRepresentationType, registerPrefetcher } from 'force/ldsAdaptersUiapi';
|
|
19
19
|
import oneStoreEnabled from '@salesforce/gate/lds.oneStoreEnabled.ltng';
|
|
20
20
|
import { executeGlobalControllerRawResponse } from 'aura';
|
|
21
|
+
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';
|
|
21
22
|
import { REFRESH_ADAPTER_EVENT, ADAPTER_UNFULFILLED_ERROR, instrument as instrument$2 } from 'force/ldsBindings';
|
|
22
23
|
import { counter, registerCacheStats, perfStart, perfEnd, registerPeriodicLogger, interaction, timer } from 'instrumentation/service';
|
|
23
|
-
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';
|
|
24
24
|
import auraNetworkAdapter, { instrument as instrument$1, forceRecordTransactionsDisabled, ldsNetworkAdapterInstrument, dispatchAuraAction, defaultActionConfig } from 'force/ldsNetwork';
|
|
25
25
|
import { instrument as instrument$3 } from 'force/adsBridge';
|
|
26
26
|
import { withRegistration as withRegistration$1, register, setDefaultLuvio } from 'force/ldsEngine';
|
|
@@ -369,6 +369,10 @@ function satisfies(provided, requested) {
|
|
|
369
369
|
return providedN[0] === requestedN[0] && providedN[1] >= requestedN[1];
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
+
const PDL_EXECUTE_ASYNC_OPTIONS = {
|
|
373
|
+
LOG_ERROR_ONLY: true,
|
|
374
|
+
};
|
|
375
|
+
|
|
372
376
|
class PredictivePrefetchPage {
|
|
373
377
|
constructor(context) {
|
|
374
378
|
this.context = context;
|
|
@@ -1084,7 +1088,7 @@ class ApplicationPredictivePrefetcher {
|
|
|
1084
1088
|
// No need to differentiate from predictions requests because these
|
|
1085
1089
|
// are made from the adapters factory, which are not prediction aware.
|
|
1086
1090
|
return this.repository.saveRequest(context, requestToSave);
|
|
1087
|
-
});
|
|
1091
|
+
}, PDL_EXECUTE_ASYNC_OPTIONS);
|
|
1088
1092
|
}
|
|
1089
1093
|
async predict() {
|
|
1090
1094
|
const exactPageRequests = (await this.repository.getPageRequests(this.context)) || [];
|
|
@@ -1650,6 +1654,18 @@ class GetRecordActionsRequestStrategy extends LuvioAdapterRequestStrategy {
|
|
|
1650
1654
|
}
|
|
1651
1655
|
}
|
|
1652
1656
|
|
|
1657
|
+
const GET_OBJECT_INFO_BATCH_ADAPTER_NAME = 'getObjectInfos';
|
|
1658
|
+
class GetObjectInfosRequestStrategy extends LuvioAdapterRequestStrategy {
|
|
1659
|
+
constructor() {
|
|
1660
|
+
super(...arguments);
|
|
1661
|
+
this.adapterName = GET_OBJECT_INFO_BATCH_ADAPTER_NAME;
|
|
1662
|
+
this.adapterFactory = getObjectInfosAdapterFactory;
|
|
1663
|
+
}
|
|
1664
|
+
buildConcreteRequest(similarRequest) {
|
|
1665
|
+
return similarRequest;
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1653
1669
|
class GetObjectInfoRequestStrategy extends LuvioAdapterRequestStrategy {
|
|
1654
1670
|
constructor() {
|
|
1655
1671
|
super(...arguments);
|
|
@@ -1681,16 +1697,21 @@ class GetObjectInfoRequestStrategy extends LuvioAdapterRequestStrategy {
|
|
|
1681
1697
|
return (request.config.objectApiName !== undefined &&
|
|
1682
1698
|
context.objectApiName === request.config.objectApiName);
|
|
1683
1699
|
}
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1700
|
+
/**
|
|
1701
|
+
* This method returns GetObjectInfoRequest[] that won't be part of a batch (getObjectInfos) request.
|
|
1702
|
+
*
|
|
1703
|
+
* @param unfilteredRequests all prediction requests
|
|
1704
|
+
* @returns
|
|
1705
|
+
*/
|
|
1706
|
+
reduce(unfilteredRequests) {
|
|
1707
|
+
const objectApiNamesInBatchRequest = unfilteredRequests.filter((request) => request.adapterName === GET_OBJECT_INFO_BATCH_ADAPTER_NAME).reduce((acc, { config }) => {
|
|
1708
|
+
config.objectApiNames.forEach((apiName) => acc.add(apiName));
|
|
1709
|
+
return acc;
|
|
1710
|
+
}, new Set());
|
|
1711
|
+
const singleRequests = this.filterRequests(unfilteredRequests);
|
|
1712
|
+
return singleRequests.filter((request) => {
|
|
1713
|
+
return !objectApiNamesInBatchRequest.has(request.config.objectApiName);
|
|
1714
|
+
});
|
|
1694
1715
|
}
|
|
1695
1716
|
}
|
|
1696
1717
|
|
|
@@ -1929,6 +1950,7 @@ class GetRelatedListRecordsRequestStrategy extends LuvioAdapterRequestStrategy {
|
|
|
1929
1950
|
}
|
|
1930
1951
|
}
|
|
1931
1952
|
|
|
1953
|
+
const LDS_PDL_CMP_IDENTIFIER = 'lds:pdl';
|
|
1932
1954
|
class LexRequestRunner {
|
|
1933
1955
|
constructor(luvio) {
|
|
1934
1956
|
this.luvio = luvio;
|
|
@@ -1953,7 +1975,9 @@ class LexRequestRunner {
|
|
|
1953
1975
|
runRequest(request) {
|
|
1954
1976
|
if (request.adapterName in this.requestStrategies) {
|
|
1955
1977
|
const adapterFactory = this.requestStrategies[request.adapterName].adapterFactory;
|
|
1956
|
-
return Promise.resolve(adapterFactory(this.luvio)(request.config
|
|
1978
|
+
return Promise.resolve(adapterFactory(this.luvio)(request.config, {
|
|
1979
|
+
sourceContext: { tagName: LDS_PDL_CMP_IDENTIFIER },
|
|
1980
|
+
})).then();
|
|
1957
1981
|
}
|
|
1958
1982
|
return Promise.resolve(undefined);
|
|
1959
1983
|
}
|
|
@@ -2246,7 +2270,7 @@ function buildPredictorForContext(context) {
|
|
|
2246
2270
|
});
|
|
2247
2271
|
},
|
|
2248
2272
|
runPredictions() {
|
|
2249
|
-
return executeAsyncActivity(METRIC_KEYS.PREDICTIVE_DATA_LOADING_PREDICT, (_act) => __lexPrefetcher.predict());
|
|
2273
|
+
return executeAsyncActivity(METRIC_KEYS.PREDICTIVE_DATA_LOADING_PREDICT, (_act) => __lexPrefetcher.predict(), PDL_EXECUTE_ASYNC_OPTIONS);
|
|
2250
2274
|
},
|
|
2251
2275
|
getPredictionSummary() {
|
|
2252
2276
|
return __lexPrefetcher.getPredictionSummary();
|
|
@@ -2314,4 +2338,4 @@ function ldsEngineCreator() {
|
|
|
2314
2338
|
}
|
|
2315
2339
|
|
|
2316
2340
|
export { buildPredictorForContext, ldsEngineCreator as default, initializeLDS, initializeOneStore };
|
|
2317
|
-
// version: 1.
|
|
2341
|
+
// version: 1.282.0-f3e0ca0c7
|
package/dist/types/main.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ import { type RecordHomePageContext } from './predictive-loading';
|
|
|
27
27
|
export declare function buildPredictorForContext(context: RecordHomePageContext): {
|
|
28
28
|
hasPredictions(): boolean;
|
|
29
29
|
watchPageLoadForPredictions(): void;
|
|
30
|
-
runPredictions(): Promise<
|
|
30
|
+
runPredictions(): Promise<void | undefined>;
|
|
31
31
|
getPredictionSummary(): {
|
|
32
32
|
exact: number;
|
|
33
33
|
similar: number;
|
package/dist/types/predictive-loading/request-strategy/get-object-info-request-strategy.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GetObjectInfoConfig } from '@salesforce/lds-adapters-uiapi';
|
|
2
|
+
import type { LuvioAdapterRequest } from './luvio-adapter-request';
|
|
2
3
|
import { LuvioAdapterRequestStrategy } from './luvio-adapter-request-strategy';
|
|
3
4
|
export type GetObjectInfoRequest = {
|
|
4
5
|
adapterName: 'getObjectInfo';
|
|
@@ -16,4 +17,11 @@ export declare class GetObjectInfoRequestStrategy extends LuvioAdapterRequestStr
|
|
|
16
17
|
context: C;
|
|
17
18
|
};
|
|
18
19
|
isContextDependent(context: GetObjectInfoContext, request: GetObjectInfoRequest): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* This method returns GetObjectInfoRequest[] that won't be part of a batch (getObjectInfos) request.
|
|
22
|
+
*
|
|
23
|
+
* @param unfilteredRequests all prediction requests
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
reduce(unfilteredRequests: LuvioAdapterRequest<unknown>[]): GetObjectInfoRequest[];
|
|
19
27
|
}
|
package/dist/types/predictive-loading/request-strategy/get-object-infos-request-strategy.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type GetObjectInfosRequest = {
|
|
|
4
4
|
adapterName: 'getObjectInfos';
|
|
5
5
|
config: GetObjectInfosConfig;
|
|
6
6
|
};
|
|
7
|
+
export declare const GET_OBJECT_INFO_BATCH_ADAPTER_NAME = "getObjectInfos";
|
|
7
8
|
export declare class GetObjectInfosRequestStrategy extends LuvioAdapterRequestStrategy<GetObjectInfosConfig, GetObjectInfosRequest, unknown> {
|
|
8
9
|
adapterName: string;
|
|
9
10
|
adapterFactory: import("@luvio/engine").AdapterFactory<GetObjectInfosConfig, import("@salesforce/lds-adapters-uiapi").SimplifiedBatchRepresentation>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-aura",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.282.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS engine for Aura runtime",
|
|
6
6
|
"main": "dist/ldsEngineCreator.js",
|
|
@@ -36,24 +36,24 @@
|
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@luvio/registry": "^3.0.0",
|
|
38
38
|
"@luvio/runtime": "3.4.3",
|
|
39
|
-
"@salesforce/lds-adapters-uiapi": "^1.
|
|
40
|
-
"@salesforce/lds-ads-bridge": "^1.
|
|
41
|
-
"@salesforce/lds-aura-storage": "^1.
|
|
42
|
-
"@salesforce/lds-bindings": "^1.
|
|
43
|
-
"@salesforce/lds-instrumentation": "^1.
|
|
44
|
-
"@salesforce/lds-network-aura": "^1.
|
|
45
|
-
"@salesforce/lds-network-fetch-with-jwt": "^1.
|
|
39
|
+
"@salesforce/lds-adapters-uiapi": "^1.282.0",
|
|
40
|
+
"@salesforce/lds-ads-bridge": "^1.282.0",
|
|
41
|
+
"@salesforce/lds-aura-storage": "^1.282.0",
|
|
42
|
+
"@salesforce/lds-bindings": "^1.282.0",
|
|
43
|
+
"@salesforce/lds-instrumentation": "^1.282.0",
|
|
44
|
+
"@salesforce/lds-network-aura": "^1.282.0",
|
|
45
|
+
"@salesforce/lds-network-fetch-with-jwt": "^1.282.0"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@luvio/network-adapter-composable": "0.154.
|
|
48
|
+
"@luvio/network-adapter-composable": "0.154.15"
|
|
49
49
|
},
|
|
50
50
|
"luvioBundlesize": [
|
|
51
51
|
{
|
|
52
52
|
"path": "./dist/ldsEngineCreator.js",
|
|
53
53
|
"maxSize": {
|
|
54
|
-
"none": "
|
|
55
|
-
"min": "
|
|
56
|
-
"compressed": "
|
|
54
|
+
"none": "88 kB",
|
|
55
|
+
"min": "37.5 kB",
|
|
56
|
+
"compressed": "17 kB"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
],
|