@lwc/engine-core 2.45.2 → 2.45.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.
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 -38
  4. package/dist/index.cjs.js.map +1 -0
  5. package/dist/{engine-core.js → index.js} +29 -38
  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
@@ -0,0 +1 @@
1
+ export declare const defaultDefHTMLPropertyNames: string[];
@@ -10,7 +10,9 @@ export interface WireAdapter {
10
10
  disconnect(): void;
11
11
  }
12
12
  export interface WireAdapterConstructor {
13
- new (callback: DataCallback): WireAdapter;
13
+ new (callback: DataCallback, sourceContext?: {
14
+ tagName: string;
15
+ }): WireAdapter;
14
16
  configSchema?: Record<string, WireAdapterSchemaValue>;
15
17
  contextSchema?: Record<string, WireAdapterSchemaValue>;
16
18
  }
@@ -1,6 +1,11 @@
1
1
  /* proxy-compat-disable */
2
+ /**
3
+ * Copyright (C) 2023 salesforce.com, inc.
4
+ */
2
5
  'use strict';
3
6
 
7
+ Object.defineProperty(exports, '__esModule', { value: true });
8
+
4
9
  var shared = require('@lwc/shared');
5
10
  var ariaReflection = require('@lwc/aria-reflection');
6
11
  var features = require('@lwc/features');
@@ -446,19 +451,6 @@ const defaultDefHTMLPropertyNames = [
446
451
  'tabIndex',
447
452
  'title',
448
453
  ];
449
- let controlledElement = null;
450
- let controlledAttributeName;
451
- function isAttributeLocked(elm, attrName) {
452
- return elm !== controlledElement || attrName !== controlledAttributeName;
453
- }
454
- function lockAttribute(_elm, _key) {
455
- controlledElement = null;
456
- controlledAttributeName = undefined;
457
- }
458
- function unlockAttribute(elm, key) {
459
- controlledElement = elm;
460
- controlledAttributeName = key;
461
- }
462
454
 
463
455
  /*
464
456
  * Copyright (c) 2018, salesforce.com, inc.
@@ -497,6 +489,7 @@ shared.forEach.call(defaultDefHTMLPropertyNames, (propName) => {
497
489
  * SPDX-License-Identifier: MIT
498
490
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
499
491
  */
492
+ /* eslint @lwc/lwc-internal/no-production-assert: "off" */
500
493
  function generateDataDescriptor(options) {
501
494
  return shared.assign({
502
495
  configurable: true,
@@ -1326,6 +1319,14 @@ function markLockerLiveObject(obj) {
1326
1319
  * SPDX-License-Identifier: MIT
1327
1320
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1328
1321
  */
1322
+ /**
1323
+ * This module is responsible for producing the ComponentDef object that is always
1324
+ * accessible via `vm.def`. This is lazily created during the creation of the first
1325
+ * instance of a component class, and shared across all instances.
1326
+ *
1327
+ * This structure can be used to synthetically create proxies, and understand the
1328
+ * shape of a component. It is also used internally to apply extra optimizations.
1329
+ */
1329
1330
  /**
1330
1331
  * This operation is called with a descriptor of an standard html property
1331
1332
  * that a Custom Element can support (including AOM properties), which
@@ -1489,15 +1490,11 @@ LightningElement.prototype = {
1489
1490
  removeAttribute(name) {
1490
1491
  const vm = getAssociatedVM(this);
1491
1492
  const { elm, renderer: { removeAttribute }, } = vm;
1492
- unlockAttribute(elm, name);
1493
1493
  removeAttribute(elm, name);
1494
- lockAttribute();
1495
1494
  },
1496
1495
  removeAttributeNS(namespace, name) {
1497
1496
  const { elm, renderer: { removeAttribute }, } = getAssociatedVM(this);
1498
- unlockAttribute(elm, name);
1499
1497
  removeAttribute(elm, name, namespace);
1500
- lockAttribute();
1501
1498
  },
1502
1499
  getAttribute(name) {
1503
1500
  const vm = getAssociatedVM(this);
@@ -1519,9 +1516,7 @@ LightningElement.prototype = {
1519
1516
  logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
1520
1517
  }
1521
1518
  }
1522
- unlockAttribute(elm, name);
1523
1519
  setAttribute(elm, name, value);
1524
- lockAttribute();
1525
1520
  },
1526
1521
  setAttributeNS(namespace, name, value) {
1527
1522
  const vm = getAssociatedVM(this);
@@ -1531,9 +1526,7 @@ LightningElement.prototype = {
1531
1526
  logError(`Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
1532
1527
  }
1533
1528
  }
1534
- unlockAttribute(elm, name);
1535
1529
  setAttribute(elm, name, value, namespace);
1536
- lockAttribute();
1537
1530
  },
1538
1531
  getBoundingClientRect() {
1539
1532
  const vm = getAssociatedVM(this);
@@ -1915,7 +1908,7 @@ function createConnector(vm, name, wireDef) {
1915
1908
  });
1916
1909
  runWithBoundaryProtection(vm, vm, shared.noop, () => {
1917
1910
  // job
1918
- connector = new adapter(dataCallback);
1911
+ connector = new adapter(dataCallback, { tagName: vm.tagName });
1919
1912
  }, shared.noop);
1920
1913
  const updateConnectorConfig = (config) => {
1921
1914
  // every time the config is recomputed due to tracking,
@@ -2483,6 +2476,10 @@ function sanitizeAttribute(tagName, namespaceUri, attrName, attrValue) {
2483
2476
  * SPDX-License-Identifier: MIT
2484
2477
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2485
2478
  */
2479
+ /**
2480
+ * This module is responsible for creating the base bridge class BaseBridgeElement
2481
+ * that represents the HTMLElement extension used for any LWC inserted in the DOM.
2482
+ */
2486
2483
  // A bridge descriptor is a descriptor whose job is just to get the component instance
2487
2484
  // from the element instance, and get the value or set a new value on the component.
2488
2485
  // This means that across different elements, similar names can get the exact same
@@ -2536,14 +2533,6 @@ function createAttributeChangedCallback(attributeToPropMap, superAttributeChange
2536
2533
  }
2537
2534
  return;
2538
2535
  }
2539
- if (!isAttributeLocked(this, attrName)) {
2540
- // Ignore changes triggered by the engine itself during:
2541
- // * diffing when public props are attempting to reflect to the DOM
2542
- // * component via `this.setAttribute()`, should never update the prop
2543
- // Both cases, the setAttribute call is always wrapped by the unlocking of the
2544
- // attribute to be changed
2545
- return;
2546
- }
2547
2536
  // Reflect attribute change to the corresponding property when changed from outside.
2548
2537
  this[propName] = newValue;
2549
2538
  };
@@ -2888,6 +2877,14 @@ function swapStyle(oldStyle, newStyle) {
2888
2877
  * SPDX-License-Identifier: MIT
2889
2878
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
2890
2879
  */
2880
+ /**
2881
+ * This module is responsible for producing the ComponentDef object that is always
2882
+ * accessible via `vm.def`. This is lazily created during the creation of the first
2883
+ * instance of a component class, and shared across all instances.
2884
+ *
2885
+ * This structure can be used to synthetically create proxies, and understand the
2886
+ * shape of a component. It is also used internally to apply extra optimizations.
2887
+ */
2891
2888
  const CtorToDefMap = new WeakMap();
2892
2889
  function getCtorProto(Ctor) {
2893
2890
  let proto = shared.getPrototypeOf(Ctor);
@@ -3329,7 +3326,6 @@ function patchAttributes(oldVnode, vnode, renderer) {
3329
3326
  const cur = attrs[key];
3330
3327
  const old = oldAttrs[key];
3331
3328
  if (old !== cur) {
3332
- unlockAttribute(elm, key);
3333
3329
  if (shared.StringCharCodeAt.call(key, 3) === ColonCharCode$1) {
3334
3330
  // Assume xml namespace
3335
3331
  setAttribute(elm, key, cur, shared.XML_NAMESPACE);
@@ -3344,7 +3340,6 @@ function patchAttributes(oldVnode, vnode, renderer) {
3344
3340
  else {
3345
3341
  setAttribute(elm, key, cur);
3346
3342
  }
3347
- lockAttribute();
3348
3343
  }
3349
3344
  }
3350
3345
  }
@@ -6382,14 +6377,12 @@ function hydrateCustomElement(elm, vnode, renderer) {
6382
6377
  function hydrateChildren(node, children, parentNode, owner) {
6383
6378
  let hasWarned = false;
6384
6379
  let nextNode = node;
6385
- let anchor = null;
6386
6380
  const { renderer } = owner;
6387
6381
  for (let i = 0; i < children.length; i++) {
6388
6382
  const childVnode = children[i];
6389
6383
  if (!shared.isNull(childVnode)) {
6390
6384
  if (nextNode) {
6391
6385
  nextNode = hydrateNode(nextNode, childVnode, renderer);
6392
- anchor = childVnode.elm;
6393
6386
  }
6394
6387
  else {
6395
6388
  hasMismatch = true;
@@ -6399,8 +6392,8 @@ function hydrateChildren(node, children, parentNode, owner) {
6399
6392
  logError(`Hydration mismatch: incorrect number of rendered nodes. Client produced more nodes than the server.`, owner);
6400
6393
  }
6401
6394
  }
6402
- mount(childVnode, parentNode, renderer, anchor);
6403
- anchor = childVnode.elm;
6395
+ mount(childVnode, parentNode, renderer, nextNode);
6396
+ nextNode = renderer.nextSibling(childVnode.elm);
6404
6397
  }
6405
6398
  }
6406
6399
  }
@@ -6946,5 +6939,5 @@ exports.swapTemplate = swapTemplate;
6946
6939
  exports.track = track;
6947
6940
  exports.unwrap = unwrap;
6948
6941
  exports.wire = wire;
6949
- /* version: 2.45.2 */
6950
- //# sourceMappingURL=engine-core.cjs.js.map
6942
+ /** version: 2.45.4 */
6943
+ //# sourceMappingURL=index.cjs.js.map