@lwc/engine-core 3.0.1 → 3.1.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/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Copyright (C) 2023 salesforce.com, inc.
3
3
  */
4
- import { noop, StringToLowerCase, isNull, ArrayPush as ArrayPush$1, ArrayJoin, isFrozen, isUndefined as isUndefined$1, defineProperty, ArrayIndexOf, ArraySplice, create, seal, isArray as isArray$1, isFunction as isFunction$1, keys, hasOwnProperty as hasOwnProperty$1, forEach, AriaPropNameToAttrNameMap, getPropertyDescriptor, defineProperties, getPrototypeOf as getPrototypeOf$1, setPrototypeOf, assign, isObject, freeze, KEY__SYNTHETIC_MODE, assert, toString as toString$1, getOwnPropertyDescriptor as getOwnPropertyDescriptor$1, isFalse, LWC_VERSION_COMMENT_REGEX, LWC_VERSION, getOwnPropertyNames as getOwnPropertyNames$1, htmlPropertyToAttribute, ArraySlice, ArrayMap, KEY__SCOPED_CSS, kebabCaseToCamelCase, StringCharCodeAt, XML_NAMESPACE, XLINK_NAMESPACE, isString, StringSlice, isTrue, SVG_NAMESPACE, KEY__SHADOW_STATIC, KEY__SHADOW_RESOLVER, ArraySome, ArrayPop, isNumber, StringReplace, ArrayUnshift, LOWEST_API_VERSION, globalThis as globalThis$1, KEY__NATIVE_GET_ELEMENT_BY_ID, KEY__NATIVE_QUERY_SELECTOR_ALL, ID_REFERENCING_ATTRIBUTES_SET, KEY__SHADOW_TOKEN, ArrayFilter, StringSplit, arrayEvery, ArrayIncludes, ArrayCopyWithin, ArrayFill, ArraySort, ArrayReverse, ArrayShift } from '@lwc/shared';
4
+ import { noop, StringToLowerCase, isNull, ArrayPush as ArrayPush$1, ArrayJoin, isFrozen, isUndefined as isUndefined$1, defineProperty, ArrayIndexOf, ArraySplice, create, seal, isArray as isArray$1, isFunction as isFunction$1, keys, hasOwnProperty as hasOwnProperty$1, globalThis as globalThis$1, forEach, AriaPropNameToAttrNameMap, getPropertyDescriptor, defineProperties, getPrototypeOf as getPrototypeOf$1, setPrototypeOf, assign, isObject, freeze, KEY__SYNTHETIC_MODE, assert, toString as toString$1, getOwnPropertyDescriptor as getOwnPropertyDescriptor$1, isFalse, LWC_VERSION_COMMENT_REGEX, LWC_VERSION, getOwnPropertyNames as getOwnPropertyNames$1, htmlPropertyToAttribute, ArraySlice, ArrayMap, KEY__SCOPED_CSS, kebabCaseToCamelCase, StringCharCodeAt, XML_NAMESPACE, XLINK_NAMESPACE, isString, StringSlice, isTrue, SVG_NAMESPACE, KEY__SHADOW_STATIC, KEY__SHADOW_RESOLVER, ArraySome, ArrayPop, isNumber, StringReplace, ArrayUnshift, LOWEST_API_VERSION, KEY__NATIVE_GET_ELEMENT_BY_ID, KEY__NATIVE_QUERY_SELECTOR_ALL, ID_REFERENCING_ATTRIBUTES_SET, KEY__SHADOW_TOKEN, ArrayFilter, StringSplit, arrayEvery, ArrayIncludes, ArrayCopyWithin, ArrayFill, ArraySort, ArrayReverse, ArrayShift } from '@lwc/shared';
5
5
  import { applyAriaReflection } from '@lwc/aria-reflection';
6
6
  export { setFeatureFlag, setFeatureFlagForTest } from '@lwc/features';
7
7
 
@@ -425,6 +425,10 @@ function isCircularModuleDependency(obj) {
425
425
  return isFunction$1(obj) && hasOwnProperty$1.call(obj, '__circular__');
426
426
  }
427
427
 
428
+ var _a, _b;
429
+ const instrumentDef = (_a = globalThis$1.__lwc_instrument_cmp_def) !== null && _a !== void 0 ? _a : noop;
430
+ const instrumentInstance = (_b = globalThis$1.__lwc_instrument_cmp_instance) !== null && _b !== void 0 ? _b : noop;
431
+
428
432
  /*
429
433
  * Copyright (c) 2018, salesforce.com, inc.
430
434
  * All rights reserved.
@@ -1393,6 +1397,8 @@ const LightningElement = function () {
1393
1397
  // `class Foo extends LightningElement {}; new Foo()`
1394
1398
  throw new TypeError('Illegal constructor');
1395
1399
  }
1400
+ // This is a no-op unless Lightning DevTools are enabled.
1401
+ instrumentInstance(this, vmBeingConstructed);
1396
1402
  const vm = vmBeingConstructed;
1397
1403
  const { def, elm } = vm;
1398
1404
  const { bridge } = def;
@@ -2541,35 +2547,8 @@ function createAttributeChangedCallback(attributeToPropMap, superAttributeChange
2541
2547
  };
2542
2548
  }
2543
2549
  function HTMLBridgeElementFactory(SuperClass, props, methods) {
2544
- let HTMLBridgeElement;
2545
- /**
2546
- * Modern browsers will have all Native Constructors as regular Classes
2547
- * and must be instantiated with the new keyword. In older browsers,
2548
- * specifically IE11, those are objects with a prototype property defined,
2549
- * since they are not supposed to be extended or instantiated with the
2550
- * new keyword. This forking logic supports both cases, specifically because
2551
- * wc.ts relies on the construction path of the bridges to create new
2552
- * fully qualifying web components.
2553
- */
2554
- if (isFunction$1(SuperClass)) {
2555
- HTMLBridgeElement = class extends SuperClass {
2556
- };
2557
- }
2558
- else {
2559
- HTMLBridgeElement = function () {
2560
- // Bridge classes are not supposed to be instantiated directly in
2561
- // browsers that do not support web components.
2562
- throw new TypeError('Illegal constructor');
2563
- };
2564
- // prototype inheritance dance
2565
- setPrototypeOf(HTMLBridgeElement, SuperClass);
2566
- setPrototypeOf(HTMLBridgeElement.prototype, SuperClass.prototype);
2567
- defineProperty(HTMLBridgeElement.prototype, 'constructor', {
2568
- writable: true,
2569
- configurable: true,
2570
- value: HTMLBridgeElement,
2571
- });
2572
- }
2550
+ const HTMLBridgeElement = class extends SuperClass {
2551
+ };
2573
2552
  // generating the hash table for attributes to avoid duplicate fields and facilitate validation
2574
2553
  // and false positives in case of inheritance.
2575
2554
  const attributeToPropMap = create(null);
@@ -2977,6 +2956,8 @@ function createComponentDef(Ctor) {
2977
2956
  errorCallback,
2978
2957
  render,
2979
2958
  };
2959
+ // This is a no-op unless Lightning DevTools are enabled.
2960
+ instrumentDef(def);
2980
2961
  if (process.env.NODE_ENV !== 'production') {
2981
2962
  freeze(Ctor.prototype);
2982
2963
  }
@@ -4144,12 +4125,11 @@ function allocateInSlot(vm, children, owner) {
4144
4125
  }
4145
4126
  }
4146
4127
  }
4147
- // Using a WeakMap instead of a WeakSet because this one works in IE11 :(
4148
- const DynamicChildren = new WeakMap();
4128
+ const DynamicChildren = new WeakSet();
4149
4129
  // dynamic children means it was either generated by an iteration in a template
4150
4130
  // or part of an unstable fragment, and will require a more complex diffing algo.
4151
4131
  function markAsDynamicChildren(children) {
4152
- DynamicChildren.set(children, 1);
4132
+ DynamicChildren.add(children);
4153
4133
  }
4154
4134
  function hasDynamicChildren(children) {
4155
4135
  return DynamicChildren.has(children);
@@ -6903,5 +6883,5 @@ function readonly(obj) {
6903
6883
  }
6904
6884
 
6905
6885
  export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentAPIVersion, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
6906
- /** version: 3.0.1 */
6886
+ /** version: 3.1.0 */
6907
6887
  //# sourceMappingURL=index.js.map