lwc 2.30.1 → 2.30.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 (39) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +207 -75
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +207 -75
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +204 -72
  5. package/dist/engine-dom/iife/es5/engine-dom.js +254 -118
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +251 -115
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +207 -75
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +204 -72
  11. package/dist/engine-dom/umd/es5/engine-dom.js +254 -118
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +251 -115
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +128 -48
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +128 -48
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +7 -4
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +7 -4
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +7 -4
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +7 -4
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +7 -4
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +7 -4
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +7 -4
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +7 -4
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +7 -4
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  34. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  35. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  36. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  37. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  39. package/package.json +7 -7
@@ -243,32 +243,57 @@
243
243
  const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
244
244
  const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
245
245
  const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
246
- /**
247
- * Map composed of properties to attributes not following the HTML property to attribute mapping
248
- * convention.
246
+
247
+ /*
248
+ * Copyright (c) 2020, salesforce.com, inc.
249
+ * All rights reserved.
250
+ * SPDX-License-Identifier: MIT
251
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
249
252
  */
250
- const NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING = new Map([
251
- ['accessKey', 'accesskey'],
252
- ['readOnly', 'readonly'],
253
- ['tabIndex', 'tabindex'],
254
- ['bgColor', 'bgcolor'],
255
- ['colSpan', 'colspan'],
256
- ['rowSpan', 'rowspan'],
257
- ['contentEditable', 'contenteditable'],
258
- ['crossOrigin', 'crossorigin'],
259
- ['dateTime', 'datetime'],
260
- ['formAction', 'formaction'],
261
- ['isMap', 'ismap'],
262
- ['maxLength', 'maxlength'],
263
- ['minLength', 'minlength'],
264
- ['noValidate', 'novalidate'],
265
- ['useMap', 'usemap'],
266
- ['htmlFor', 'for'],
267
- ]);
253
+ const CAMEL_REGEX = /-([a-z])/g;
254
+ // Convoluted map generation so that @lwc/shared remains fully tree-shakable (verify-treeshakable)
255
+ const { NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING, NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING } =
256
+ /*#__PURE__*/ (() => {
257
+ /**
258
+ * Map composed of properties to attributes not following the HTML property to attribute mapping
259
+ * convention.
260
+ */
261
+ const NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING = new Map([
262
+ ['accessKey', 'accesskey'],
263
+ ['readOnly', 'readonly'],
264
+ ['tabIndex', 'tabindex'],
265
+ ['bgColor', 'bgcolor'],
266
+ ['colSpan', 'colspan'],
267
+ ['rowSpan', 'rowspan'],
268
+ ['contentEditable', 'contenteditable'],
269
+ ['crossOrigin', 'crossorigin'],
270
+ ['dateTime', 'datetime'],
271
+ ['formAction', 'formaction'],
272
+ ['isMap', 'ismap'],
273
+ ['maxLength', 'maxlength'],
274
+ ['minLength', 'minlength'],
275
+ ['noValidate', 'novalidate'],
276
+ ['useMap', 'usemap'],
277
+ ['htmlFor', 'for'],
278
+ ]);
279
+ /**
280
+ * Inverted map with attribute name key and property name value.
281
+ */
282
+ const NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING = new Map();
283
+ NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING.forEach((value, key) => NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING.set(value, key));
284
+ return {
285
+ NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING,
286
+ NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING,
287
+ };
288
+ })();
268
289
  /**
269
290
  * Map associating previously transformed HTML property into HTML attribute.
270
291
  */
271
292
  const CACHED_PROPERTY_ATTRIBUTE_MAPPING = new Map();
293
+ /**
294
+ * Map associating previously transformed HTML attribute into HTML property.
295
+ */
296
+ const CACHED_ATTRIBUTE_PROPERTY_MAPPING = new Map();
272
297
  function htmlPropertyToAttribute(propName) {
273
298
  const ariaAttributeName = AriaPropNameToAttrNameMap[propName];
274
299
  if (!isUndefined$1(ariaAttributeName)) {
@@ -297,6 +322,23 @@
297
322
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
298
323
  return attributeName;
299
324
  }
325
+ function htmlAttributeToProperty(attrName) {
326
+ const ariaPropertyName = AriaAttrNameToPropNameMap[attrName];
327
+ if (!isUndefined$1(ariaPropertyName)) {
328
+ return ariaPropertyName;
329
+ }
330
+ const specialPropertyName = NO_STANDARD_ATTRIBUTE_PROPERTY_MAPPING.get(attrName);
331
+ if (!isUndefined$1(specialPropertyName)) {
332
+ return specialPropertyName;
333
+ }
334
+ const cachedPropertyName = CACHED_ATTRIBUTE_PROPERTY_MAPPING.get(attrName);
335
+ if (!isUndefined$1(cachedPropertyName)) {
336
+ return cachedPropertyName;
337
+ }
338
+ const propertyName = StringReplace.call(attrName, CAMEL_REGEX, (g) => g[1].toUpperCase());
339
+ CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
340
+ return propertyName;
341
+ }
300
342
 
301
343
  /*
302
344
  * Copyright (c) 2018, salesforce.com, inc.
@@ -305,9 +347,9 @@
305
347
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
306
348
  */
307
349
  // Increment whenever the LWC template compiler changes
308
- const LWC_VERSION = "2.30.1";
350
+ const LWC_VERSION = "2.30.3";
309
351
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
310
- /** version: 2.30.1 */
352
+ /** version: 2.30.3 */
311
353
 
312
354
  /**
313
355
  * Copyright (C) 2018 salesforce.com, inc.
@@ -389,7 +431,7 @@
389
431
  patch$1(propName);
390
432
  }
391
433
  }
392
- /** version: 2.30.1 */
434
+ /** version: 2.30.3 */
393
435
 
394
436
  /**
395
437
  * Copyright (C) 2018 salesforce.com, inc.
@@ -469,7 +511,7 @@
469
511
  setFeatureFlag(name, value);
470
512
  }
471
513
  }
472
- /** version: 2.30.1 */
514
+ /** version: 2.30.3 */
473
515
 
474
516
  /*
475
517
  * Copyright (c) 2018, salesforce.com, inc.
@@ -3621,7 +3663,7 @@
3621
3663
  * SPDX-License-Identifier: MIT
3622
3664
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3623
3665
  */
3624
- const ColonCharCode = 58;
3666
+ const ColonCharCode$1 = 58;
3625
3667
  function patchAttributes(oldVnode, vnode, renderer) {
3626
3668
  const { attrs } = vnode.data;
3627
3669
  if (isUndefined$1(attrs)) {
@@ -3638,11 +3680,11 @@
3638
3680
  const old = oldAttrs[key];
3639
3681
  if (old !== cur) {
3640
3682
  unlockAttribute(elm, key);
3641
- if (StringCharCodeAt.call(key, 3) === ColonCharCode) {
3683
+ if (StringCharCodeAt.call(key, 3) === ColonCharCode$1) {
3642
3684
  // Assume xml namespace
3643
3685
  setAttribute(elm, key, cur, XML_NAMESPACE);
3644
3686
  }
3645
- else if (StringCharCodeAt.call(key, 5) === ColonCharCode) {
3687
+ else if (StringCharCodeAt.call(key, 5) === ColonCharCode$1) {
3646
3688
  // Assume xlink namespace
3647
3689
  setAttribute(elm, key, cur, XLINK_NAMESPACE);
3648
3690
  }
@@ -3657,6 +3699,46 @@
3657
3699
  }
3658
3700
  }
3659
3701
 
3702
+ /*
3703
+ * Copyright (c) 2018, salesforce.com, inc.
3704
+ * All rights reserved.
3705
+ * SPDX-License-Identifier: MIT
3706
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3707
+ */
3708
+ const ColonCharCode = 58;
3709
+ function patchAttrUnlessProp(oldVnode, vnode, renderer) {
3710
+ const { data: { attrs }, elm, } = vnode;
3711
+ if (isUndefined$1(attrs)) {
3712
+ return;
3713
+ }
3714
+ const { removeAttribute, setAttribute, setProperty } = renderer;
3715
+ const oldAttrs = isNull(oldVnode) ? EmptyObject : oldVnode.data.attrs;
3716
+ for (const name in attrs) {
3717
+ const cur = attrs[name];
3718
+ const old = oldAttrs[name];
3719
+ if (old !== cur) {
3720
+ const propName = htmlAttributeToProperty(name);
3721
+ if (propName in elm) {
3722
+ setProperty(elm, name, cur);
3723
+ }
3724
+ else if (StringCharCodeAt.call(name, 3) === ColonCharCode) {
3725
+ // Assume xml namespace
3726
+ setAttribute(elm, name, cur, XML_NAMESPACE);
3727
+ }
3728
+ else if (StringCharCodeAt.call(name, 5) === ColonCharCode) {
3729
+ // Assume xlink namespace
3730
+ setAttribute(elm, name, cur, XLINK_NAMESPACE);
3731
+ }
3732
+ else if (isNull(cur) || isUndefined$1(cur)) {
3733
+ removeAttribute(elm, name);
3734
+ }
3735
+ else {
3736
+ setAttribute(elm, name, cur);
3737
+ }
3738
+ }
3739
+ }
3740
+ }
3741
+
3660
3742
  /*
3661
3743
  * Copyright (c) 2018, salesforce.com, inc.
3662
3744
  * All rights reserved.
@@ -4066,16 +4148,16 @@
4066
4148
  // the custom element from the registry is expecting an upgrade callback
4067
4149
  vm = createViewModelHook(elm, vnode, renderer);
4068
4150
  };
4069
- const connectedCallback = elm => {
4070
- if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
4151
+ let connectedCallback;
4152
+ let disconnectedCallback;
4153
+ if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
4154
+ connectedCallback = elm => {
4071
4155
  connectRootElement(elm);
4072
- }
4073
- };
4074
- const disconnectedCallback = elm => {
4075
- if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
4156
+ };
4157
+ disconnectedCallback = elm => {
4076
4158
  disconnectRootElement(elm);
4077
- }
4078
- };
4159
+ };
4160
+ }
4079
4161
  // Should never get a tag with upper case letter at this point; the compiler
4080
4162
  // should produce only tags with lowercase letters. However, the Java
4081
4163
  // compiler may generate tagnames with uppercase letters so - for backwards
@@ -4253,7 +4335,11 @@
4253
4335
  // value is set before type=radio.
4254
4336
  patchClassAttribute(oldVnode, vnode, renderer);
4255
4337
  patchStyleAttribute(oldVnode, vnode, renderer);
4256
- patchAttributes(oldVnode, vnode, renderer);
4338
+ if (vnode.data.external) {
4339
+ patchAttrUnlessProp(oldVnode, vnode, renderer);
4340
+ } else {
4341
+ patchAttributes(oldVnode, vnode, renderer);
4342
+ }
4257
4343
  patchProps(oldVnode, vnode, renderer);
4258
4344
  }
4259
4345
  function applyStyleScoping(elm, owner, renderer) {
@@ -4686,8 +4772,11 @@
4686
4772
  !isUndefined$1(slotset.slotAssignments) &&
4687
4773
  !isUndefined$1(slotset.slotAssignments[slotName]) &&
4688
4774
  slotset.slotAssignments[slotName].length !== 0) {
4689
- children = slotset.slotAssignments[slotName].reduce((accumulator, vnode) => {
4690
- if (vnode) {
4775
+ const newChildren = [];
4776
+ const slotAssignments = slotset.slotAssignments[slotName];
4777
+ for (let i = 0; i < slotAssignments.length; i++) {
4778
+ const vnode = slotAssignments[i];
4779
+ if (!isNull(vnode)) {
4691
4780
  const assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
4692
4781
  // The only sniff test for a scoped <slot> element is the presence of `slotData`
4693
4782
  const isScopedSlotElement = !isUndefined$1(data.slotData);
@@ -4697,32 +4786,30 @@
4697
4786
  logError(`Mismatched slot types for ${slotName === '' ? '(default)' : slotName} slot. Both parent and child component must use standard type or scoped type for a given slot.`, slotset.owner);
4698
4787
  }
4699
4788
  // Ignore slot content from parent
4700
- return accumulator;
4789
+ continue;
4701
4790
  }
4702
4791
  // If the passed slot content is factory, evaluate it and add the produced vnodes
4703
4792
  if (assignedNodeIsScopedSlot) {
4704
4793
  const vmBeingRenderedInception = getVMBeingRendered();
4705
- let scopedSlotChildren = [];
4706
4794
  // Evaluate in the scope of the slot content's owner
4707
4795
  // if a slotset is provided, there will always be an owner. The only case where owner is
4708
4796
  // undefined is for root components, but root components cannot accept slotted content
4709
4797
  setVMBeingRendered(slotset.owner);
4710
4798
  try {
4711
- scopedSlotChildren = vnode.factory(data.slotData);
4799
+ ArrayPush$1.apply(newChildren, vnode.factory(data.slotData));
4712
4800
  }
4713
4801
  finally {
4714
4802
  setVMBeingRendered(vmBeingRenderedInception);
4715
4803
  }
4716
- return ArrayConcat$1.call(accumulator, scopedSlotChildren);
4717
4804
  }
4718
4805
  else {
4719
4806
  // If the slot content is standard type, the content is static, no additional
4720
4807
  // processing needed on the vnode
4721
- return ArrayConcat$1.call(accumulator, vnode);
4808
+ ArrayPush$1.call(newChildren, vnode);
4722
4809
  }
4723
4810
  }
4724
- return accumulator;
4725
- }, []);
4811
+ }
4812
+ children = newChildren;
4726
4813
  }
4727
4814
  const vmBeingRendered = getVMBeingRendered();
4728
4815
  const { renderMode, shadowMode } = vmBeingRendered;
@@ -6943,7 +7030,7 @@
6943
7030
  }
6944
7031
  return ctor;
6945
7032
  }
6946
- /* version: 2.30.1 */
7033
+ /* version: 2.30.3 */
6947
7034
 
6948
7035
  /*
6949
7036
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7226,8 +7313,10 @@
7226
7313
  // `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
7227
7314
  // This class should be created once per tag name.
7228
7315
  const createUpgradableConstructor = (connectedCallback, disconnectedCallback) => {
7316
+ const hasConnectedCallback = !isUndefined$1(connectedCallback);
7317
+ const hasDisconnectedCallback = !isUndefined$1(disconnectedCallback);
7229
7318
  // TODO [#2972]: this class should expose observedAttributes as necessary
7230
- return class UpgradableConstructor extends HTMLElement {
7319
+ class UpgradableConstructor extends HTMLElement {
7231
7320
  constructor(upgradeCallback) {
7232
7321
  super();
7233
7322
  // If the element is not created using lwc.createElement(), e.g. `document.createElement('x-foo')`,
@@ -7235,25 +7324,33 @@
7235
7324
  if (elementBeingUpgradedByLWC) {
7236
7325
  upgradeCallback(this);
7237
7326
  }
7238
- else {
7239
- // keep track of elements that were not created by lwc.createElement,
7240
- // so we can ignore their lifecycle hooks
7327
+ else if (hasConnectedCallback || hasDisconnectedCallback) {
7328
+ // If this element has connected or disconnected callbacks, then we need to keep track of
7329
+ // instances that were created outside LWC (i.e. not created by `lwc.createElement()`).
7330
+ // If the element has no connected or disconnected callbacks, then we don't need to track this.
7241
7331
  elementsUpgradedOutsideLWC.add(this);
7242
7332
  // TODO [#2970]: LWC elements cannot be upgraded via new Ctor()
7243
7333
  // Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
7244
7334
  }
7245
7335
  }
7246
- connectedCallback() {
7336
+ }
7337
+ // Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
7338
+ // See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
7339
+ if (hasConnectedCallback) {
7340
+ UpgradableConstructor.prototype.connectedCallback = function () {
7247
7341
  if (!elementsUpgradedOutsideLWC.has(this)) {
7248
7342
  connectedCallback(this);
7249
7343
  }
7250
- }
7251
- disconnectedCallback() {
7344
+ };
7345
+ }
7346
+ if (hasDisconnectedCallback) {
7347
+ UpgradableConstructor.prototype.disconnectedCallback = function () {
7252
7348
  if (!elementsUpgradedOutsideLWC.has(this)) {
7253
7349
  disconnectedCallback(this);
7254
7350
  }
7255
- }
7256
- };
7351
+ };
7352
+ }
7353
+ return UpgradableConstructor;
7257
7354
  };
7258
7355
  const createCustomElementVanilla = (tagName, upgradeCallback, connectedCallback, disconnectedCallback) => {
7259
7356
  // use global custom elements registry
@@ -7306,16 +7403,22 @@
7306
7403
  const EMPTY_SET = new Set();
7307
7404
  function createDefinitionRecord(constructor) {
7308
7405
  var _a;
7309
- const { connectedCallback, disconnectedCallback, adoptedCallback, attributeChangedCallback, } = constructor.prototype;
7406
+ const { connectedCallback, disconnectedCallback, formAssociatedCallback, formDisabledCallback, formResetCallback, formStateRestoreCallback, adoptedCallback, attributeChangedCallback, } = constructor.prototype;
7407
+ const formAssociated = Boolean(constructor.formAssociated);
7310
7408
  const observedAttributes = new Set((_a = constructor.observedAttributes) !== null && _a !== void 0 ? _a : []);
7311
7409
  return {
7312
7410
  UserCtor: constructor,
7313
7411
  PivotCtor: undefined,
7314
7412
  connectedCallback,
7315
7413
  disconnectedCallback,
7414
+ formAssociatedCallback,
7415
+ formDisabledCallback,
7416
+ formResetCallback,
7417
+ formStateRestoreCallback,
7316
7418
  adoptedCallback,
7317
7419
  attributeChangedCallback,
7318
7420
  observedAttributes,
7421
+ formAssociated,
7319
7422
  };
7320
7423
  }
7321
7424
  // Helper to create stand-in element for each tagName registered that delegates out to the registry for the given
@@ -7390,6 +7493,26 @@
7390
7493
  }
7391
7494
  }
7392
7495
  }
7496
+ formAssociatedCallback(form) {
7497
+ var _a;
7498
+ const definition = definitionForElement.get(this);
7499
+ (_a = definition === null || definition === void 0 ? void 0 : definition.formAssociatedCallback) === null || _a === void 0 ? void 0 : _a.call(this, form);
7500
+ }
7501
+ formDisabledCallback(disabled) {
7502
+ var _a;
7503
+ const definition = definitionForElement.get(this);
7504
+ (_a = definition === null || definition === void 0 ? void 0 : definition.formDisabledCallback) === null || _a === void 0 ? void 0 : _a.call(this, disabled);
7505
+ }
7506
+ formResetCallback() {
7507
+ var _a;
7508
+ const definition = definitionForElement.get(this);
7509
+ (_a = definition === null || definition === void 0 ? void 0 : definition.formResetCallback) === null || _a === void 0 ? void 0 : _a.call(this);
7510
+ }
7511
+ formStateRestoreCallback(state, mode) {
7512
+ var _a;
7513
+ const definition = definitionForElement.get(this);
7514
+ (_a = definition === null || definition === void 0 ? void 0 : definition.formStateRestoreCallback) === null || _a === void 0 ? void 0 : _a.call(this, state, mode);
7515
+ }
7393
7516
  adoptedCallback() {
7394
7517
  var _a;
7395
7518
  const definition = definitionForElement.get(this);
@@ -7408,6 +7531,8 @@
7408
7531
  }
7409
7532
  }
7410
7533
  PivotCtor.observedAttributes = [...registeredDefinition.observedAttributes];
7534
+ // TODO [#3000]: support case where registeredDefinition is not form-associated, but later definition is.
7535
+ PivotCtor.formAssociated = registeredDefinition.formAssociated;
7411
7536
  registeredPivotCtors.add(PivotCtor);
7412
7537
  return PivotCtor;
7413
7538
  }
@@ -7754,27 +7879,34 @@
7754
7879
  // Creates a constructor that is intended to be used as the UserConstructor in a scoped (pivots) registry.
7755
7880
  // In this case, the upgradeCallback only needs to be defined once because we create these on-demand,
7756
7881
  // multiple times per tag name.
7757
- const createUserConstructor = (upgradeCallback, connectedCallback, disconnectedCallback, HTMLElementToExtend) => {
7882
+ const createUserConstructor = (HTMLElementToExtend, upgradeCallback, connectedCallback, disconnectedCallback) => {
7758
7883
  // TODO [#2972]: this class should expose observedAttributes as necessary
7759
- return class UserConstructor extends HTMLElementToExtend {
7884
+ class UserConstructor extends HTMLElementToExtend {
7760
7885
  constructor() {
7761
7886
  super();
7762
7887
  upgradeCallback(this);
7763
7888
  }
7764
- connectedCallback() {
7889
+ }
7890
+ // Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
7891
+ // See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
7892
+ if (!isUndefined$1(connectedCallback)) {
7893
+ UserConstructor.prototype.connectedCallback = function () {
7765
7894
  connectedCallback(this);
7766
- }
7767
- disconnectedCallback() {
7895
+ };
7896
+ }
7897
+ if (!isUndefined$1(disconnectedCallback)) {
7898
+ UserConstructor.prototype.disconnectedCallback = function () {
7768
7899
  disconnectedCallback(this);
7769
- }
7770
- };
7900
+ };
7901
+ }
7902
+ return UserConstructor;
7771
7903
  };
7772
7904
  function createCustomElementScoped(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
7773
7905
  if (isUndefined$1(createScopedConstructor) || isUndefined$1(CachedHTMLElement)) {
7774
7906
  // This error should be impossible to hit
7775
7907
  throw new Error('The flag ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY must be set to true to use this feature');
7776
7908
  }
7777
- const UserConstructor = createUserConstructor(upgradeCallback, connectedCallback, disconnectedCallback, CachedHTMLElement);
7909
+ const UserConstructor = createUserConstructor(CachedHTMLElement, upgradeCallback, connectedCallback, disconnectedCallback);
7778
7910
  const ScopedConstructor = createScopedConstructor(tagName, UserConstructor);
7779
7911
  return new ScopedConstructor(UserConstructor);
7780
7912
  }
@@ -7871,7 +8003,7 @@
7871
8003
  function isNull(obj) {
7872
8004
  return obj === null;
7873
8005
  }
7874
- /** version: 2.30.1 */
8006
+ /** version: 2.30.3 */
7875
8007
 
7876
8008
  /*
7877
8009
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8350,16 +8482,16 @@
8350
8482
  DisconnectingSlot.set(elm, disconnectRootElement);
8351
8483
  }
8352
8484
  };
8353
- const connectedCallback = elm => {
8354
- if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
8485
+ let connectedCallback;
8486
+ let disconnectedCallback;
8487
+ if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
8488
+ connectedCallback = elm => {
8355
8489
  connectRootElement(elm);
8356
- }
8357
- };
8358
- const disconnectedCallback = elm => {
8359
- if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
8490
+ };
8491
+ disconnectedCallback = elm => {
8360
8492
  disconnectRootElement(elm);
8361
- }
8362
- };
8493
+ };
8494
+ }
8363
8495
  const element = createCustomElement(tagName, upgradeCallback, connectedCallback, disconnectedCallback);
8364
8496
  return element;
8365
8497
  }
@@ -8432,7 +8564,7 @@
8432
8564
  });
8433
8565
  freeze(LightningElement);
8434
8566
  seal(LightningElement.prototype);
8435
- /* version: 2.30.1 */
8567
+ /* version: 2.30.3 */
8436
8568
 
8437
8569
  exports.LightningElement = LightningElement;
8438
8570
  exports.__unstable__ProfilerControl = profilerControl;