@lwc/engine-core 2.45.2 → 2.45.3

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.
Files changed (66) hide show
  1. package/dist/framework/attributes.d.ts +1 -0
  2. package/{types → dist}/framework/wiring/types.d.ts +3 -1
  3. package/dist/{engine-core.cjs.js → index.cjs.js} +31 -39
  4. package/dist/index.cjs.js.map +1 -0
  5. package/dist/{engine-core.js → index.js} +29 -39
  6. package/dist/index.js.map +1 -0
  7. package/package.json +27 -22
  8. package/dist/engine-core.cjs.js.map +0 -1
  9. package/dist/engine-core.js.map +0 -1
  10. package/types/framework/attributes.d.ts +0 -4
  11. /package/{types → dist}/framework/api.d.ts +0 -0
  12. /package/{types → dist}/framework/base-bridge-element.d.ts +0 -0
  13. /package/{types → dist}/framework/base-lightning-element.d.ts +0 -0
  14. /package/{types → dist}/framework/check-version-mismatch.d.ts +0 -0
  15. /package/{types → dist}/framework/component.d.ts +0 -0
  16. /package/{types → dist}/framework/decorators/api.d.ts +0 -0
  17. /package/{types → dist}/framework/decorators/register.d.ts +0 -0
  18. /package/{types → dist}/framework/decorators/track.d.ts +0 -0
  19. /package/{types → dist}/framework/decorators/wire.d.ts +0 -0
  20. /package/{types → dist}/framework/def.d.ts +0 -0
  21. /package/{types → dist}/framework/freeze-template.d.ts +0 -0
  22. /package/{types → dist}/framework/get-component-constructor.d.ts +0 -0
  23. /package/{types → dist}/framework/hot-swaps.d.ts +0 -0
  24. /package/{types → dist}/framework/html-element.d.ts +0 -0
  25. /package/{types → dist}/framework/html-properties.d.ts +0 -0
  26. /package/{types → dist}/framework/hydration.d.ts +0 -0
  27. /package/{types → dist}/framework/invoker.d.ts +0 -0
  28. /package/{types → dist}/framework/main.d.ts +0 -0
  29. /package/{types → dist}/framework/membrane.d.ts +0 -0
  30. /package/{types → dist}/framework/modules/attr-unless-prop.d.ts +0 -0
  31. /package/{types → dist}/framework/modules/attrs.d.ts +0 -0
  32. /package/{types → dist}/framework/modules/computed-class-attr.d.ts +0 -0
  33. /package/{types → dist}/framework/modules/computed-style-attr.d.ts +0 -0
  34. /package/{types → dist}/framework/modules/events.d.ts +0 -0
  35. /package/{types → dist}/framework/modules/props.d.ts +0 -0
  36. /package/{types → dist}/framework/modules/static-class-attr.d.ts +0 -0
  37. /package/{types → dist}/framework/modules/static-style-attr.d.ts +0 -0
  38. /package/{types → dist}/framework/mutation-tracker.d.ts +0 -0
  39. /package/{types → dist}/framework/observed-fields.d.ts +0 -0
  40. /package/{types → dist}/framework/overridable-hooks.d.ts +0 -0
  41. /package/{types → dist}/framework/profiler.d.ts +0 -0
  42. /package/{types → dist}/framework/readonly.d.ts +0 -0
  43. /package/{types → dist}/framework/renderer.d.ts +0 -0
  44. /package/{types → dist}/framework/rendering.d.ts +0 -0
  45. /package/{types → dist}/framework/reporting.d.ts +0 -0
  46. /package/{types → dist}/framework/restrictions.d.ts +0 -0
  47. /package/{types → dist}/framework/secure-template.d.ts +0 -0
  48. /package/{types → dist}/framework/services.d.ts +0 -0
  49. /package/{types → dist}/framework/stylesheet.d.ts +0 -0
  50. /package/{types → dist}/framework/template.d.ts +0 -0
  51. /package/{types → dist}/framework/update-component-value.d.ts +0 -0
  52. /package/{types → dist}/framework/utils.d.ts +0 -0
  53. /package/{types → dist}/framework/vm.d.ts +0 -0
  54. /package/{types → dist}/framework/vnodes.d.ts +0 -0
  55. /package/{types → dist}/framework/weak-multimap.d.ts +0 -0
  56. /package/{types → dist}/framework/wiring/context.d.ts +0 -0
  57. /package/{types → dist}/framework/wiring/index.d.ts +0 -0
  58. /package/{types → dist}/framework/wiring/wiring.d.ts +0 -0
  59. /package/{types → dist}/index.d.ts +0 -0
  60. /package/{types → dist}/libs/mutation-tracker/index.d.ts +0 -0
  61. /package/{types → dist}/patches/detect-non-standard-aria.d.ts +0 -0
  62. /package/{types → dist}/patches/detect-synthetic-cross-root-aria.d.ts +0 -0
  63. /package/{types → dist}/shared/circular-module-dependencies.d.ts +0 -0
  64. /package/{types → dist}/shared/error.d.ts +0 -0
  65. /package/{types → dist}/shared/format.d.ts +0 -0
  66. /package/{types → dist}/shared/logger.d.ts +0 -0
@@ -1,4 +1,6 @@
1
- /* proxy-compat-disable */
1
+ /**
2
+ * Copyright (C) 2023 salesforce.com, inc.
3
+ */
2
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, StringCharCodeAt, XML_NAMESPACE, XLINK_NAMESPACE, htmlAttributeToProperty, isString, StringSlice, isTrue, SVG_NAMESPACE, KEY__SHADOW_STATIC, KEY__SHADOW_RESOLVER, ArraySome, ArrayPop, isNumber, StringReplace, ArrayUnshift, 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';
3
5
  import { applyAriaReflection } from '@lwc/aria-reflection';
4
6
  export { setFeatureFlag, setFeatureFlagForTest } from '@lwc/features';
@@ -444,19 +446,6 @@ const defaultDefHTMLPropertyNames = [
444
446
  'tabIndex',
445
447
  'title',
446
448
  ];
447
- let controlledElement = null;
448
- let controlledAttributeName;
449
- function isAttributeLocked(elm, attrName) {
450
- return elm !== controlledElement || attrName !== controlledAttributeName;
451
- }
452
- function lockAttribute(_elm, _key) {
453
- controlledElement = null;
454
- controlledAttributeName = undefined;
455
- }
456
- function unlockAttribute(elm, key) {
457
- controlledElement = elm;
458
- controlledAttributeName = key;
459
- }
460
449
 
461
450
  /*
462
451
  * Copyright (c) 2018, salesforce.com, inc.
@@ -495,6 +484,7 @@ forEach.call(defaultDefHTMLPropertyNames, (propName) => {
495
484
  * SPDX-License-Identifier: MIT
496
485
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
497
486
  */
487
+ /* eslint @lwc/lwc-internal/no-production-assert: "off" */
498
488
  function generateDataDescriptor(options) {
499
489
  return assign({
500
490
  configurable: true,
@@ -1324,6 +1314,14 @@ function markLockerLiveObject(obj) {
1324
1314
  * SPDX-License-Identifier: MIT
1325
1315
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1326
1316
  */
1317
+ /**
1318
+ * This module is responsible for producing the ComponentDef object that is always
1319
+ * accessible via `vm.def`. This is lazily created during the creation of the first
1320
+ * instance of a component class, and shared across all instances.
1321
+ *
1322
+ * This structure can be used to synthetically create proxies, and understand the
1323
+ * shape of a component. It is also used internally to apply extra optimizations.
1324
+ */
1327
1325
  /**
1328
1326
  * This operation is called with a descriptor of an standard html property
1329
1327
  * that a Custom Element can support (including AOM properties), which
@@ -1487,15 +1485,11 @@ LightningElement.prototype = {
1487
1485
  removeAttribute(name) {
1488
1486
  const vm = getAssociatedVM(this);
1489
1487
  const { elm, renderer: { removeAttribute }, } = vm;
1490
- unlockAttribute(elm, name);
1491
1488
  removeAttribute(elm, name);
1492
- lockAttribute();
1493
1489
  },
1494
1490
  removeAttributeNS(namespace, name) {
1495
1491
  const { elm, renderer: { removeAttribute }, } = getAssociatedVM(this);
1496
- unlockAttribute(elm, name);
1497
1492
  removeAttribute(elm, name, namespace);
1498
- lockAttribute();
1499
1493
  },
1500
1494
  getAttribute(name) {
1501
1495
  const vm = getAssociatedVM(this);
@@ -1517,9 +1511,7 @@ LightningElement.prototype = {
1517
1511
  logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
1518
1512
  }
1519
1513
  }
1520
- unlockAttribute(elm, name);
1521
1514
  setAttribute(elm, name, value);
1522
- lockAttribute();
1523
1515
  },
1524
1516
  setAttributeNS(namespace, name, value) {
1525
1517
  const vm = getAssociatedVM(this);
@@ -1529,9 +1521,7 @@ LightningElement.prototype = {
1529
1521
  logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
1530
1522
  }
1531
1523
  }
1532
- unlockAttribute(elm, name);
1533
1524
  setAttribute(elm, name, value, namespace);
1534
- lockAttribute();
1535
1525
  },
1536
1526
  getBoundingClientRect() {
1537
1527
  const vm = getAssociatedVM(this);
@@ -1913,7 +1903,7 @@ function createConnector(vm, name, wireDef) {
1913
1903
  });
1914
1904
  runWithBoundaryProtection(vm, vm, noop, () => {
1915
1905
  // job
1916
- connector = new adapter(dataCallback);
1906
+ connector = new adapter(dataCallback, { tagName: vm.tagName });
1917
1907
  }, noop);
1918
1908
  const updateConnectorConfig = (config) => {
1919
1909
  // every time the config is recomputed due to tracking,
@@ -2481,6 +2471,10 @@ function sanitizeAttribute(tagName, namespaceUri, attrName, attrValue) {
2481
2471
  * SPDX-License-Identifier: MIT
2482
2472
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2483
2473
  */
2474
+ /**
2475
+ * This module is responsible for creating the base bridge class BaseBridgeElement
2476
+ * that represents the HTMLElement extension used for any LWC inserted in the DOM.
2477
+ */
2484
2478
  // A bridge descriptor is a descriptor whose job is just to get the component instance
2485
2479
  // from the element instance, and get the value or set a new value on the component.
2486
2480
  // This means that across different elements, similar names can get the exact same
@@ -2534,14 +2528,6 @@ function createAttributeChangedCallback(attributeToPropMap, superAttributeChange
2534
2528
  }
2535
2529
  return;
2536
2530
  }
2537
- if (!isAttributeLocked(this, attrName)) {
2538
- // Ignore changes triggered by the engine itself during:
2539
- // * diffing when public props are attempting to reflect to the DOM
2540
- // * component via `this.setAttribute()`, should never update the prop
2541
- // Both cases, the setAttribute call is always wrapped by the unlocking of the
2542
- // attribute to be changed
2543
- return;
2544
- }
2545
2531
  // Reflect attribute change to the corresponding property when changed from outside.
2546
2532
  this[propName] = newValue;
2547
2533
  };
@@ -2886,6 +2872,14 @@ function swapStyle(oldStyle, newStyle) {
2886
2872
  * SPDX-License-Identifier: MIT
2887
2873
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2888
2874
  */
2875
+ /**
2876
+ * This module is responsible for producing the ComponentDef object that is always
2877
+ * accessible via `vm.def`. This is lazily created during the creation of the first
2878
+ * instance of a component class, and shared across all instances.
2879
+ *
2880
+ * This structure can be used to synthetically create proxies, and understand the
2881
+ * shape of a component. It is also used internally to apply extra optimizations.
2882
+ */
2889
2883
  const CtorToDefMap = new WeakMap();
2890
2884
  function getCtorProto(Ctor) {
2891
2885
  let proto = getPrototypeOf$1(Ctor);
@@ -3327,7 +3321,6 @@ function patchAttributes(oldVnode, vnode, renderer) {
3327
3321
  const cur = attrs[key];
3328
3322
  const old = oldAttrs[key];
3329
3323
  if (old !== cur) {
3330
- unlockAttribute(elm, key);
3331
3324
  if (StringCharCodeAt.call(key, 3) === ColonCharCode$1) {
3332
3325
  // Assume xml namespace
3333
3326
  setAttribute(elm, key, cur, XML_NAMESPACE);
@@ -3342,7 +3335,6 @@ function patchAttributes(oldVnode, vnode, renderer) {
3342
3335
  else {
3343
3336
  setAttribute(elm, key, cur);
3344
3337
  }
3345
- lockAttribute();
3346
3338
  }
3347
3339
  }
3348
3340
  }
@@ -6380,14 +6372,12 @@ function hydrateCustomElement(elm, vnode, renderer) {
6380
6372
  function hydrateChildren(node, children, parentNode, owner) {
6381
6373
  let hasWarned = false;
6382
6374
  let nextNode = node;
6383
- let anchor = null;
6384
6375
  const { renderer } = owner;
6385
6376
  for (let i = 0; i < children.length; i++) {
6386
6377
  const childVnode = children[i];
6387
6378
  if (!isNull(childVnode)) {
6388
6379
  if (nextNode) {
6389
6380
  nextNode = hydrateNode(nextNode, childVnode, renderer);
6390
- anchor = childVnode.elm;
6391
6381
  }
6392
6382
  else {
6393
6383
  hasMismatch = true;
@@ -6397,8 +6387,8 @@ function hydrateChildren(node, children, parentNode, owner) {
6397
6387
  logError(`Hydration mismatch: incorrect number of rendered nodes. Client produced more nodes than the server.`, owner);
6398
6388
  }
6399
6389
  }
6400
- mount(childVnode, parentNode, renderer, anchor);
6401
- anchor = childVnode.elm;
6390
+ mount(childVnode, parentNode, renderer, nextNode);
6391
+ nextNode = renderer.nextSibling(childVnode.elm);
6402
6392
  }
6403
6393
  }
6404
6394
  }
@@ -6907,5 +6897,5 @@ function readonly(obj) {
6907
6897
  }
6908
6898
 
6909
6899
  export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
6910
- /* version: 2.45.2 */
6911
- //# sourceMappingURL=engine-core.js.map
6900
+ /** version: 2.45.3 */
6901
+ //# sourceMappingURL=index.js.map