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