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

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
@@ -328,6 +328,10 @@ function logMutation(reactiveObserver, target, key) {
328
328
  if (shared.isUndefined(parentKey)) {
329
329
  prop = stringKey;
330
330
  }
331
+ else if (!shared.isString(key)) {
332
+ // symbol/number, e.g. `obj[Symbol("foo")]` or `obj[1234]`
333
+ prop = `${shared.toString(parentKey)}[${stringKey}]`;
334
+ }
331
335
  else if (/^\w+$/.test(stringKey)) {
332
336
  // Human-readable prop like `items[0].name` on a deep object/array
333
337
  prop = `${shared.toString(parentKey)}.${stringKey}`;
@@ -373,8 +377,12 @@ function trackTargetForMutationLogging(key, target) {
373
377
  }
374
378
  }
375
379
  else {
376
- for (const prop of shared.keys(target)) {
377
- trackTargetForMutationLogging(`${shared.toString(key)}.${prop}`, target[prop]);
380
+ // Track only own property names and symbols (including non-enumerated)
381
+ // This is consistent with what observable-membrane does:
382
+ // 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) {
385
+ trackTargetForMutationLogging(`${shared.toString(key)}.${shared.toString(prop)}`, target[prop]);
378
386
  }
379
387
  }
380
388
  }
@@ -6944,7 +6952,7 @@ let rehydrateQueue = [];
6944
6952
  function flushRehydrationQueue() {
6945
6953
  // Gather the logs before rehydration starts so they can be reported at the end of rehydration.
6946
6954
  // Note that we also clear all existing logs at this point so that subsequent re-renders start from a clean slate.
6947
- const mutationLogs = process.env.NODE_ENV !== 'production' ? getAndFlushMutationLogs() : undefined;
6955
+ const mutationLogs = process.env.NODE_ENV === 'production' ? undefined : getAndFlushMutationLogs();
6948
6956
  logGlobalOperationStart(8 /* OperationId.GlobalRehydrate */);
6949
6957
  if (process.env.NODE_ENV !== 'production') {
6950
6958
  shared.assert.invariant(rehydrateQueue.length, `If rehydrateQueue was scheduled, it is because there must be at least one VM on this pending queue instead of ${rehydrateQueue}.`);
@@ -8382,5 +8390,5 @@ exports.swapTemplate = swapTemplate;
8382
8390
  exports.track = track;
8383
8391
  exports.unwrap = unwrap;
8384
8392
  exports.wire = wire;
8385
- /** version: 8.0.0 */
8393
+ /** version: 8.1.0-alpha.2 */
8386
8394
  //# sourceMappingURL=index.cjs.js.map