@salesforce/lds-worker-api 1.115.0 → 1.116.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.
@@ -751,4 +751,4 @@ if (process.env.NODE_ENV !== 'production') {
751
751
  }
752
752
 
753
753
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
754
- // version: 1.115.0-d56477e9a
754
+ // version: 1.116.0-0424bdf67
@@ -3776,7 +3776,7 @@ function withDefaultLuvio(callback) {
3776
3776
  }
3777
3777
  callbacks.push(callback);
3778
3778
  }
3779
- // version: 1.115.0-d56477e9a
3779
+ // version: 1.116.0-0424bdf67
3780
3780
 
3781
3781
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3782
3782
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15200,7 +15200,7 @@ function parseAndVisit(source) {
15200
15200
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15201
15201
  return luvioDocumentNode;
15202
15202
  }
15203
- // version: 1.115.0-d56477e9a
15203
+ // version: 1.116.0-0424bdf67
15204
15204
 
15205
15205
  function unwrap(data) {
15206
15206
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16113,7 +16113,7 @@ function createGraphQLWireAdapterConstructor(luvio, adapter, metadata, astResolv
16113
16113
  const { apiFamily, name } = metadata;
16114
16114
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16115
16115
  }
16116
- // version: 1.115.0-d56477e9a
16116
+ // version: 1.116.0-0424bdf67
16117
16117
 
16118
16118
  /**
16119
16119
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -44347,7 +44347,7 @@ withDefaultLuvio((luvio) => {
44347
44347
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44348
44348
  });
44349
44349
  });
44350
- // version: 1.115.0-bbc69ae4e
44350
+ // version: 1.116.0-d3f8ec84e
44351
44351
 
44352
44352
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44353
44353
 
@@ -56507,10 +56507,21 @@ const GRAPHQL_ROOT_KEY$2 = `GraphQL::graphql`;
56507
56507
  function isLocalEvalSnapshot(snapshot) {
56508
56508
  return 'rebuildWithLocalEval' in snapshot;
56509
56509
  }
56510
- function createSeenRecords(ids) {
56511
- return ids
56510
+ function createSeenRecords(ids, currentSnapshot) {
56511
+ let seenRecords = ids
56512
56512
  .map((id) => `UiApi::RecordRepresentation:${id}`)
56513
56513
  .reduce((acc, curr) => (acc.add(curr), acc), new StoreKeySet());
56514
+ if (currentSnapshot.state !== 'Error') {
56515
+ currentSnapshot.seenRecords.forEach((record) => {
56516
+ let keyString = typeof record !== 'string' ? serializeStructuredKey(record) : record;
56517
+ if (keyString !== 'UiApi::GraphQLRepresentation__uiapi' &&
56518
+ keyString !== 'UiApi::GraphQLRepresentation__uiapi__query' &&
56519
+ seenRecords.has(record) === false) {
56520
+ seenRecords.add(record);
56521
+ }
56522
+ });
56523
+ }
56524
+ return seenRecords;
56514
56525
  }
56515
56526
  function createErrorSnapshot(result, snapshot) {
56516
56527
  return {
@@ -56695,7 +56706,7 @@ function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio
56695
56706
  if (!gqlResult.errors) {
56696
56707
  gqlResult = removeSyntheticFields(gqlResult, config.query);
56697
56708
  }
56698
- const seenRecords = createSeenRecords(seenRecordIds);
56709
+ const seenRecords = createSeenRecords(seenRecordIds, nonEvaluatedSnapshot);
56699
56710
  const recordId = generateUniqueRecordId();
56700
56711
  const rebuildWithLocalEval = async (originalSnapshot) => {
56701
56712
  let { result: rebuildResult, seenRecordIds } = await evaluate({
@@ -56709,7 +56720,7 @@ function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio
56709
56720
  ...nonEvaluatedSnapshot,
56710
56721
  data: rebuildResult,
56711
56722
  recordId,
56712
- seenRecords: createSeenRecords(seenRecordIds),
56723
+ seenRecords: createSeenRecords(seenRecordIds, nonEvaluatedSnapshot),
56713
56724
  rebuildWithLocalEval,
56714
56725
  };
56715
56726
  };
@@ -59839,7 +59850,7 @@ register({
59839
59850
  id: '@salesforce/lds-network-adapter',
59840
59851
  instrument: instrument$1,
59841
59852
  });
59842
- // version: 1.115.0-d56477e9a
59853
+ // version: 1.116.0-0424bdf67
59843
59854
 
59844
59855
  const { create: create$2, keys: keys$2 } = Object;
59845
59856
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -75014,7 +75025,7 @@ register({
75014
75025
  configuration: { ...configurationForGraphQLAdapters },
75015
75026
  instrument,
75016
75027
  });
75017
- // version: 1.115.0-bbc69ae4e
75028
+ // version: 1.116.0-d3f8ec84e
75018
75029
 
75019
75030
  // On core the unstable adapters are re-exported with different names,
75020
75031
 
@@ -77143,7 +77154,7 @@ withDefaultLuvio((luvio) => {
77143
77154
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
77144
77155
  graphQLImperative = ldsAdapter;
77145
77156
  });
77146
- // version: 1.115.0-bbc69ae4e
77157
+ // version: 1.116.0-d3f8ec84e
77147
77158
 
77148
77159
  var gqlApi = /*#__PURE__*/Object.freeze({
77149
77160
  __proto__: null,
@@ -77825,4 +77836,4 @@ const { luvio } = getRuntime();
77825
77836
  setDefaultLuvio({ luvio });
77826
77837
 
77827
77838
  export { createPrimingSession, draftManager, draftQueue, executeAdapter, executeMutatingAdapter, getImperativeAdapterNames, invokeAdapter, invokeAdapterWithDraftToReplace, invokeAdapterWithMetadata, nimbusDraftQueue, registerReportObserver, setMetadataTTL, setUiApiRecordTTL, subscribeToAdapter };
77828
- // version: 1.115.0-d56477e9a
77839
+ // version: 1.116.0-0424bdf67
@@ -3782,7 +3782,7 @@
3782
3782
  }
3783
3783
  callbacks.push(callback);
3784
3784
  }
3785
- // version: 1.115.0-d56477e9a
3785
+ // version: 1.116.0-0424bdf67
3786
3786
 
3787
3787
  // TODO [TD-0081508]: once that TD is fulfilled we can probably change this file
3788
3788
  function instrumentAdapter$1(createFunction, _metadata) {
@@ -15206,7 +15206,7 @@
15206
15206
  updateReferenceMapWithKnownKey(ast, luvioDocumentNode);
15207
15207
  return luvioDocumentNode;
15208
15208
  }
15209
- // version: 1.115.0-d56477e9a
15209
+ // version: 1.116.0-0424bdf67
15210
15210
 
15211
15211
  function unwrap(data) {
15212
15212
  // The lwc-luvio bindings import a function from lwc called "unwrap".
@@ -16119,7 +16119,7 @@
16119
16119
  const { apiFamily, name } = metadata;
16120
16120
  return createGraphQLWireAdapterConstructor$1(adapter, `${apiFamily}.${name}`, luvio, astResolver);
16121
16121
  }
16122
- // version: 1.115.0-d56477e9a
16122
+ // version: 1.116.0-0424bdf67
16123
16123
 
16124
16124
  /**
16125
16125
  * Copyright (c) 2022, Salesforce, Inc.,
@@ -44353,7 +44353,7 @@
44353
44353
  dropFunction: instrumentation$2.notifyRecordUpdateAvailableDropped,
44354
44354
  });
44355
44355
  });
44356
- // version: 1.115.0-bbc69ae4e
44356
+ // version: 1.116.0-d3f8ec84e
44357
44357
 
44358
44358
  var caseSensitiveUserId = '005B0000000GR4OIAW';
44359
44359
 
@@ -56513,10 +56513,21 @@
56513
56513
  function isLocalEvalSnapshot(snapshot) {
56514
56514
  return 'rebuildWithLocalEval' in snapshot;
56515
56515
  }
56516
- function createSeenRecords(ids) {
56517
- return ids
56516
+ function createSeenRecords(ids, currentSnapshot) {
56517
+ let seenRecords = ids
56518
56518
  .map((id) => `UiApi::RecordRepresentation:${id}`)
56519
56519
  .reduce((acc, curr) => (acc.add(curr), acc), new StoreKeySet());
56520
+ if (currentSnapshot.state !== 'Error') {
56521
+ currentSnapshot.seenRecords.forEach((record) => {
56522
+ let keyString = typeof record !== 'string' ? serializeStructuredKey(record) : record;
56523
+ if (keyString !== 'UiApi::GraphQLRepresentation__uiapi' &&
56524
+ keyString !== 'UiApi::GraphQLRepresentation__uiapi__query' &&
56525
+ seenRecords.has(record) === false) {
56526
+ seenRecords.add(record);
56527
+ }
56528
+ });
56529
+ }
56530
+ return seenRecords;
56520
56531
  }
56521
56532
  function createErrorSnapshot(result, snapshot) {
56522
56533
  return {
@@ -56701,7 +56712,7 @@
56701
56712
  if (!gqlResult.errors) {
56702
56713
  gqlResult = removeSyntheticFields(gqlResult, config.query);
56703
56714
  }
56704
- const seenRecords = createSeenRecords(seenRecordIds);
56715
+ const seenRecords = createSeenRecords(seenRecordIds, nonEvaluatedSnapshot);
56705
56716
  const recordId = generateUniqueRecordId();
56706
56717
  const rebuildWithLocalEval = async (originalSnapshot) => {
56707
56718
  let { result: rebuildResult, seenRecordIds } = await evaluate({
@@ -56715,7 +56726,7 @@
56715
56726
  ...nonEvaluatedSnapshot,
56716
56727
  data: rebuildResult,
56717
56728
  recordId,
56718
- seenRecords: createSeenRecords(seenRecordIds),
56729
+ seenRecords: createSeenRecords(seenRecordIds, nonEvaluatedSnapshot),
56719
56730
  rebuildWithLocalEval,
56720
56731
  };
56721
56732
  };
@@ -59845,7 +59856,7 @@
59845
59856
  id: '@salesforce/lds-network-adapter',
59846
59857
  instrument: instrument$1,
59847
59858
  });
59848
- // version: 1.115.0-d56477e9a
59859
+ // version: 1.116.0-0424bdf67
59849
59860
 
59850
59861
  const { create: create$2, keys: keys$2 } = Object;
59851
59862
  const { stringify: stringify$1, parse: parse$1 } = JSON;
@@ -75020,7 +75031,7 @@
75020
75031
  configuration: { ...configurationForGraphQLAdapters },
75021
75032
  instrument,
75022
75033
  });
75023
- // version: 1.115.0-bbc69ae4e
75034
+ // version: 1.116.0-d3f8ec84e
75024
75035
 
75025
75036
  // On core the unstable adapters are re-exported with different names,
75026
75037
 
@@ -77149,7 +77160,7 @@
77149
77160
  unstable_graphQL_imperative = createImperativeAdapter(luvio, createInstrumentedAdapter(ldsAdapter, adapterMetadata), adapterMetadata);
77150
77161
  graphQLImperative = ldsAdapter;
77151
77162
  });
77152
- // version: 1.115.0-bbc69ae4e
77163
+ // version: 1.116.0-d3f8ec84e
77153
77164
 
77154
77165
  var gqlApi = /*#__PURE__*/Object.freeze({
77155
77166
  __proto__: null,
@@ -77848,4 +77859,4 @@
77848
77859
  Object.defineProperty(exports, '__esModule', { value: true });
77849
77860
 
77850
77861
  }));
77851
- // version: 1.115.0-d56477e9a
77862
+ // version: 1.116.0-0424bdf67
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-worker-api",
3
- "version": "1.115.0",
3
+ "version": "1.116.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "description": "",
6
6
  "main": "dist/standalone/umd/lds-worker-api.js",
@@ -28,7 +28,7 @@
28
28
  "prepare": "yarn build",
29
29
  "build": "rollup --config rollup.config.js",
30
30
  "test:unit": "NODE_ENV=production jest",
31
- "test:size": "bundlesize",
31
+ "test:size": "luvioBundlesize",
32
32
  "clean": "rm -rf dist",
33
33
  "release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-worker-api"
34
34
  },
@@ -49,11 +49,14 @@
49
49
  "o11y": "244.0.0",
50
50
  "wait-for-expect": "^3.0.2"
51
51
  },
52
- "bundlesize": [
52
+ "luvioBundlesize": [
53
53
  {
54
54
  "path": "./dist/sfdc/es/ldsWorkerApi.js",
55
- "maxSize": "7.5 kB",
56
- "compression": "brotli"
55
+ "maxSize": {
56
+ "none": "33 kB",
57
+ "min": "13 kB",
58
+ "compressed": "6 kB"
59
+ }
57
60
  }
58
61
  ],
59
62
  "sfdc": {