@lwc/engine-core 8.1.0-alpha.1 → 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.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (c) 2024 Salesforce, Inc.
3
3
  */
4
- import { noop, StringToLowerCase, isNull, ArrayPush as ArrayPush$1, ArrayJoin, isFrozen, isUndefined as isUndefined$1, defineProperty, seal, create, isAPIFeatureEnabled, isArray as isArray$1, isFunction as isFunction$1, keys, ArrayFilter, isObject, toString as toString$1, ArrayIndexOf, ArrayPop, isFalse, hasOwnProperty as hasOwnProperty$1, entries, AriaPropNameToAttrNameMap, getPropertyDescriptor, forEach, defineProperties, getPrototypeOf as getPrototypeOf$1, setPrototypeOf, assign, assert, freeze, KEY__SYNTHETIC_MODE, getOwnPropertyDescriptor as getOwnPropertyDescriptor$1, LWC_VERSION_COMMENT_REGEX, LWC_VERSION, getOwnPropertyNames as getOwnPropertyNames$1, getOwnPropertyDescriptors, htmlPropertyToAttribute, ArraySlice, ArrayMap, KEY__SCOPED_CSS, ArraySplice, kebabCaseToCamelCase, StringCharCodeAt, XML_NAMESPACE, XLINK_NAMESPACE, isString, StringSlice, isTrue, SVG_NAMESPACE, KEY__SHADOW_STATIC, KEY__SHADOW_RESOLVER, ArraySome, isNumber, StringReplace, StringTrim, ArraySort, ArrayFrom, htmlEscape, StringCharAt, ArrayUnshift, LOWEST_API_VERSION, KEY__NATIVE_GET_ELEMENT_BY_ID, KEY__NATIVE_QUERY_SELECTOR_ALL, ID_REFERENCING_ATTRIBUTES_SET, KEY__SHADOW_TOKEN, StringSplit, arrayEvery, ArrayIncludes, ArrayCopyWithin, ArrayFill, ArrayReverse, ArrayShift } from '@lwc/shared';
4
+ import { noop, StringToLowerCase, isNull, ArrayPush as ArrayPush$1, ArrayJoin, isFrozen, isUndefined as isUndefined$1, defineProperty, seal, create, isAPIFeatureEnabled, isArray as isArray$1, isFunction as isFunction$1, keys, ArrayFilter, isObject, toString as toString$1, getOwnPropertyNames as getOwnPropertyNames$1, getOwnPropertySymbols as getOwnPropertySymbols$1, isString, ArrayIndexOf, ArrayPop, isFalse, hasOwnProperty as hasOwnProperty$1, entries, AriaPropNameToAttrNameMap, getPropertyDescriptor, forEach, defineProperties, getPrototypeOf as getPrototypeOf$1, setPrototypeOf, assign, assert, freeze, KEY__SYNTHETIC_MODE, getOwnPropertyDescriptor as getOwnPropertyDescriptor$1, LWC_VERSION_COMMENT_REGEX, LWC_VERSION, getOwnPropertyDescriptors, htmlPropertyToAttribute, ArraySlice, ArrayMap, KEY__SCOPED_CSS, ArraySplice, kebabCaseToCamelCase, StringCharCodeAt, XML_NAMESPACE, XLINK_NAMESPACE, StringSlice, isTrue, SVG_NAMESPACE, KEY__SHADOW_STATIC, KEY__SHADOW_RESOLVER, ArraySome, isNumber, StringReplace, StringTrim, ArraySort, ArrayFrom, htmlEscape, StringCharAt, ArrayUnshift, LOWEST_API_VERSION, KEY__NATIVE_GET_ELEMENT_BY_ID, KEY__NATIVE_QUERY_SELECTOR_ALL, ID_REFERENCING_ATTRIBUTES_SET, KEY__SHADOW_TOKEN, StringSplit, arrayEvery, ArrayIncludes, ArrayCopyWithin, ArrayFill, ArrayReverse, ArrayShift } from '@lwc/shared';
5
5
  export { setFeatureFlag, setFeatureFlagForTest } from '@lwc/features';
6
6
 
7
7
  /*
@@ -324,6 +324,10 @@ function logMutation(reactiveObserver, target, key) {
324
324
  if (isUndefined$1(parentKey)) {
325
325
  prop = stringKey;
326
326
  }
327
+ else if (!isString(key)) {
328
+ // symbol/number, e.g. `obj[Symbol("foo")]` or `obj[1234]`
329
+ prop = `${toString$1(parentKey)}[${stringKey}]`;
330
+ }
327
331
  else if (/^\w+$/.test(stringKey)) {
328
332
  // Human-readable prop like `items[0].name` on a deep object/array
329
333
  prop = `${toString$1(parentKey)}.${stringKey}`;
@@ -369,8 +373,12 @@ function trackTargetForMutationLogging(key, target) {
369
373
  }
370
374
  }
371
375
  else {
372
- for (const prop of keys(target)) {
373
- trackTargetForMutationLogging(`${toString$1(key)}.${prop}`, target[prop]);
376
+ // Track only own property names and symbols (including non-enumerated)
377
+ // This is consistent with what observable-membrane does:
378
+ // https://github.com/salesforce/observable-membrane/blob/b85417f/src/base-handler.ts#L142-L143
379
+ const props = [...getOwnPropertyNames$1(target), ...getOwnPropertySymbols$1(target)];
380
+ for (const prop of props) {
381
+ trackTargetForMutationLogging(`${toString$1(key)}.${toString$1(prop)}`, target[prop]);
374
382
  }
375
383
  }
376
384
  }
@@ -6940,7 +6948,7 @@ let rehydrateQueue = [];
6940
6948
  function flushRehydrationQueue() {
6941
6949
  // Gather the logs before rehydration starts so they can be reported at the end of rehydration.
6942
6950
  // Note that we also clear all existing logs at this point so that subsequent re-renders start from a clean slate.
6943
- const mutationLogs = process.env.NODE_ENV !== 'production' ? getAndFlushMutationLogs() : undefined;
6951
+ const mutationLogs = process.env.NODE_ENV === 'production' ? undefined : getAndFlushMutationLogs();
6944
6952
  logGlobalOperationStart(8 /* OperationId.GlobalRehydrate */);
6945
6953
  if (process.env.NODE_ENV !== 'production') {
6946
6954
  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}.`);
@@ -8335,5 +8343,5 @@ function readonly(obj) {
8335
8343
  }
8336
8344
 
8337
8345
  export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, computeShadowAndRenderMode, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentAPIVersion, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, runFormAssociatedCallback, runFormDisabledCallback, runFormResetCallback, runFormStateRestoreCallback, sanitizeAttribute, setHooks, shouldBeFormAssociated, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
8338
- /** version: 8.1.0-alpha.1 */
8346
+ /** version: 8.1.0-alpha.2 */
8339
8347
  //# sourceMappingURL=index.js.map