@lwc/engine-core 8.1.0-alpha.2 → 8.1.0-alpha.4

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/index.cjs.js CHANGED
@@ -367,6 +367,10 @@ function associateReactiveObserverWithVM(reactiveObserver, vm) {
367
367
  */
368
368
  function trackTargetForMutationLogging(key, target) {
369
369
  assertNotProd();
370
+ if (targetsToPropertyKeys.has(target)) {
371
+ // Guard against recursive objects - don't traverse forever
372
+ return;
373
+ }
370
374
  if (shared.isObject(target) && !shared.isNull(target)) {
371
375
  // only track non-primitives; others are invalid as WeakMap keys
372
376
  targetsToPropertyKeys.set(target, key);
@@ -380,10 +384,13 @@ function trackTargetForMutationLogging(key, target) {
380
384
  // Track only own property names and symbols (including non-enumerated)
381
385
  // This is consistent with what observable-membrane does:
382
386
  // https://github.com/salesforce/observable-membrane/blob/b85417f/src/base-handler.ts#L142-L143
383
- const props = [...shared.getOwnPropertyNames(target), ...shared.getOwnPropertySymbols(target)];
384
- for (const prop of props) {
387
+ // Note this code path is very hot, hence doing two separate for-loops rather than creating a new array.
388
+ for (const prop of shared.getOwnPropertyNames(target)) {
385
389
  trackTargetForMutationLogging(`${shared.toString(key)}.${shared.toString(prop)}`, target[prop]);
386
390
  }
391
+ for (const prop of shared.getOwnPropertySymbols(target)) {
392
+ trackTargetForMutationLogging(`${shared.toString(key)}[${shared.toString(prop)}]`, target[prop]);
393
+ }
387
394
  }
388
395
  }
389
396
  }
@@ -5933,7 +5940,7 @@ function getMutationProperties(mutationLogs) {
5933
5940
  const usePlural = tagNames.length > 1 || tagNamesToIdsAndProps.get(tagNames[0]).ids.size > 1;
5934
5941
  const result = [
5935
5942
  [
5936
- `Re-rendered Component${usePlural ? 's' : ''}`,
5943
+ `Component${usePlural ? 's' : ''}`,
5937
5944
  shared.ArrayJoin.call(shared.ArrayMap.call(tagNames, (_) => tagNamesToDisplayTagNames.get(_)), ', '),
5938
5945
  ],
5939
5946
  ];
@@ -6017,8 +6024,7 @@ function logGlobalOperationEnd(opId, mutationLogs) {
6017
6024
  const opName = getOperationName(opId);
6018
6025
  const markName = opName;
6019
6026
  end(opName, markName, {
6020
- // not really an error, but we want to draw attention to re-renders since folks may want to debug it
6021
- color: 'error',
6027
+ color: 'tertiary',
6022
6028
  tooltipText: getTooltipText(opName, opId),
6023
6029
  properties: getMutationProperties(mutationLogs),
6024
6030
  });
@@ -8390,5 +8396,5 @@ exports.swapTemplate = swapTemplate;
8390
8396
  exports.track = track;
8391
8397
  exports.unwrap = unwrap;
8392
8398
  exports.wire = wire;
8393
- /** version: 8.1.0-alpha.2 */
8399
+ /** version: 8.1.0-alpha.4 */
8394
8400
  //# sourceMappingURL=index.cjs.js.map