lwc 2.23.0 → 2.23.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 (35) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +1208 -877
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +1208 -876
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +1115 -812
  5. package/dist/engine-dom/iife/es5/engine-dom.js +473 -386
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +424 -344
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +1208 -876
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +1115 -812
  11. package/dist/engine-dom/umd/es5/engine-dom.js +473 -386
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +424 -344
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +803 -537
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +803 -537
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +20 -20
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +20 -20
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +19 -19
  20. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +20 -20
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +19 -19
  22. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +20 -20
  23. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +19 -19
  24. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +20 -20
  25. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +19 -19
  26. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  27. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  28. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  29. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  30. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  31. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  34. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  35. package/package.json +17 -9
@@ -349,7 +349,11 @@
349
349
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
350
350
  return attributeName;
351
351
  }
352
- /** version: 2.23.0 */
352
+ /** version: 2.23.3 */
353
+
354
+ /**
355
+ * Copyright (C) 2018 salesforce.com, inc.
356
+ */
353
357
 
354
358
  /*
355
359
  * Copyright (c) 2018, salesforce.com, inc.
@@ -359,7 +363,7 @@
359
363
  */
360
364
 
361
365
  function detect(propName) {
362
- return Object.getOwnPropertyDescriptor(Element.prototype, propName) === undefined;
366
+ return getOwnPropertyDescriptor$1(Element.prototype, propName) === undefined;
363
367
  }
364
368
  /*
365
369
  * Copyright (c) 2018, salesforce.com, inc.
@@ -439,6 +443,8 @@
439
443
  patch$1(propName);
440
444
  }
441
445
  }
446
+ /** version: 2.23.3 */
447
+
442
448
  /**
443
449
  * Copyright (C) 2018 salesforce.com, inc.
444
450
  */
@@ -459,6 +465,7 @@
459
465
  ENABLE_HTML_COLLECTIONS_PATCH: null,
460
466
  ENABLE_INNER_OUTER_TEXT_PATCH: null,
461
467
  ENABLE_MIXED_SHADOW_MODE: null,
468
+ ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null,
462
469
  ENABLE_NODE_LIST_PATCH: null,
463
470
  ENABLE_NODE_PATCH: null,
464
471
  ENABLE_REACTIVE_SETTER: null,
@@ -471,7 +478,7 @@
471
478
  });
472
479
  }
473
480
 
474
- var runtimeFlags = _globalThis.lwcRuntimeFlags;
481
+ var lwcRuntimeFlags = _globalThis.lwcRuntimeFlags;
475
482
  /**
476
483
  * Set the value at runtime of a given feature flag. This method only be invoked once per feature
477
484
  * flag. It is meant to be used during the app initialization.
@@ -499,7 +506,7 @@
499
506
 
500
507
  {
501
508
  // Disallow the same flag to be set more than once in production
502
- var runtimeValue = runtimeFlags[name];
509
+ var runtimeValue = lwcRuntimeFlags[name];
503
510
 
504
511
  if (!isUndefined$1(runtimeValue)) {
505
512
  // eslint-disable-next-line no-console
@@ -507,7 +514,7 @@
507
514
  return;
508
515
  }
509
516
 
510
- defineProperty(runtimeFlags, name, {
517
+ defineProperty(lwcRuntimeFlags, name, {
511
518
  value: value
512
519
  });
513
520
  }
@@ -863,8 +870,8 @@
863
870
  // to inject at runtime.
864
871
 
865
872
 
866
- var HTMLElementConstructor$1 = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
867
- var HTMLElementPrototype = HTMLElementConstructor$1.prototype;
873
+ var HTMLElementConstructor = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
874
+ var HTMLElementPrototype = HTMLElementConstructor.prototype;
868
875
  /*
869
876
  * Copyright (c) 2018, salesforce.com, inc.
870
877
  * All rights reserved.
@@ -2173,7 +2180,7 @@
2173
2180
  var vm = getAssociatedVM(this);
2174
2181
 
2175
2182
  if (_set2) {
2176
- if (runtimeFlags.ENABLE_REACTIVE_SETTER) {
2183
+ if (lwcRuntimeFlags.ENABLE_REACTIVE_SETTER) {
2177
2184
  var ro = vm.oar[key];
2178
2185
 
2179
2186
  if (isUndefined$1(ro)) {
@@ -2666,7 +2673,7 @@
2666
2673
  return HTMLBridgeElement;
2667
2674
  }
2668
2675
 
2669
- var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor$1, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
2676
+ var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
2670
2677
  freeze(BaseBridgeElement);
2671
2678
  seal(BaseBridgeElement.prototype);
2672
2679
 
@@ -2679,7 +2686,7 @@
2679
2686
 
2680
2687
  function swapTemplate(oldTpl, newTpl) {
2681
2688
 
2682
- if (!runtimeFlags.ENABLE_HMR) {
2689
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
2683
2690
  throw new Error('HMR is not enabled');
2684
2691
  }
2685
2692
 
@@ -2688,7 +2695,7 @@
2688
2695
 
2689
2696
  function swapComponent(oldComponent, newComponent) {
2690
2697
 
2691
- if (!runtimeFlags.ENABLE_HMR) {
2698
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
2692
2699
  throw new Error('HMR is not enabled');
2693
2700
  }
2694
2701
 
@@ -2697,7 +2704,7 @@
2697
2704
 
2698
2705
  function swapStyle(oldStyle, newStyle) {
2699
2706
 
2700
- if (!runtimeFlags.ENABLE_HMR) {
2707
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
2701
2708
  throw new Error('HMR is not enabled');
2702
2709
  }
2703
2710
 
@@ -3168,6 +3175,12 @@
3168
3175
  */
3169
3176
 
3170
3177
 
3178
+ function checkHasVM(elm) {
3179
+ var hasVM = !isUndefined$1(getAssociatedVMIfPresent(elm));
3180
+
3181
+ return hasVM;
3182
+ }
3183
+
3171
3184
  function getUpgradableConstructor(tagName, renderer) {
3172
3185
  var getCustomElement = renderer.getCustomElement,
3173
3186
  RendererHTMLElement = renderer.HTMLElementExported,
@@ -3209,6 +3222,20 @@
3209
3222
  return _createClass(LWCUpgradableElement);
3210
3223
  }(RendererHTMLElement);
3211
3224
 
3225
+ if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
3226
+ CE.prototype.connectedCallback = function () {
3227
+ if (checkHasVM(this)) {
3228
+ connectRootElement(this);
3229
+ }
3230
+ };
3231
+
3232
+ CE.prototype.disconnectedCallback = function () {
3233
+ if (checkHasVM(this)) {
3234
+ disconnectRootElement(this);
3235
+ }
3236
+ };
3237
+ }
3238
+
3212
3239
  defineCustomElement(tagName, CE);
3213
3240
  return CE;
3214
3241
  }
@@ -3320,6 +3347,7 @@
3320
3347
  // different than the one previously set.
3321
3348
 
3322
3349
  if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
3350
+
3323
3351
  setProperty(elm, key, cur);
3324
3352
  }
3325
3353
  }
@@ -3713,8 +3741,12 @@
3713
3741
  insertNode(elm, parent, anchor, renderer);
3714
3742
 
3715
3743
  if (vm) {
3744
+ {
3745
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
3716
3746
 
3717
- runConnectedCallback(vm);
3747
+ runConnectedCallback(vm);
3748
+ }
3749
+ }
3718
3750
  }
3719
3751
 
3720
3752
  mountVNodes(vnode.children, elm, renderer, null);
@@ -3882,10 +3914,10 @@
3882
3914
  var scopeToken = getScopeTokenClass(owner);
3883
3915
 
3884
3916
  if (!isNull(scopeToken)) {
3885
- var _getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
3917
+ var getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
3886
3918
  // probably we should have a renderer api for just the add operation
3887
3919
 
3888
- _getClassList(elm).add(scopeToken);
3920
+ getClassList(elm).add(scopeToken);
3889
3921
  } // Set property element for synthetic shadow DOM style scoping.
3890
3922
 
3891
3923
 
@@ -5231,7 +5263,7 @@
5231
5263
  } else if (isNativeShadowDefined) {
5232
5264
  // Not combined with above condition because @lwc/features only supports identifiers in
5233
5265
  // the if-condition.
5234
- if (runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
5266
+ if (lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE) {
5235
5267
  if (def.shadowSupportMode === "any"
5236
5268
  /* ShadowSupportMode.Any */
5237
5269
  ) {
@@ -5876,7 +5908,7 @@
5876
5908
  ArrayPush$1.call(wiredConnecting, function () {
5877
5909
  connector.connect();
5878
5910
 
5879
- if (!runtimeFlags.ENABLE_WIRE_SYNC_EMIT) {
5911
+ if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
5880
5912
  if (hasDynamicParams) {
5881
5913
  Promise.resolve().then(computeConfigAndUpdate);
5882
5914
  return;
@@ -6050,6 +6082,8 @@
6050
6082
  return renderer.nextSibling(hydratedNode);
6051
6083
  }
6052
6084
 
6085
+ var NODE_VALUE_PROP = 'nodeValue';
6086
+
6053
6087
  function hydrateText(node, vnode, renderer) {
6054
6088
  var _a;
6055
6089
 
@@ -6075,7 +6109,7 @@
6075
6109
  }
6076
6110
 
6077
6111
  var setProperty = renderer.setProperty;
6078
- setProperty(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6112
+ setProperty(node, NODE_VALUE_PROP, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
6079
6113
  vnode.elm = node;
6080
6114
  return node;
6081
6115
  }
@@ -6107,10 +6141,10 @@
6107
6141
  // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
6108
6142
  // remove the innerHTML from props so it reuses the existing dom elements.
6109
6143
  var props = vnode.data.props;
6110
- var _getProperty3 = renderer.getProperty;
6144
+ var getProperty = renderer.getProperty;
6111
6145
 
6112
6146
  if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
6113
- if (_getProperty3(elm, 'innerHTML') === props.innerHTML) {
6147
+ if (getProperty(elm, 'innerHTML') === props.innerHTML) {
6114
6148
  // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
6115
6149
  vnode.data = Object.assign(Object.assign({}, vnode.data), {
6116
6150
  props: cloneAndOmitKey(props, 'innerHTML')
@@ -6122,8 +6156,8 @@
6122
6156
  patchElementPropsAndAttrs(vnode, renderer);
6123
6157
 
6124
6158
  if (!isDomManual) {
6125
- var _getFirstChild = renderer.getFirstChild;
6126
- hydrateChildren(_getFirstChild(elm), vnode.children, elm, owner);
6159
+ var getFirstChild = renderer.getFirstChild;
6160
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
6127
6161
  }
6128
6162
 
6129
6163
  return elm;
@@ -6156,10 +6190,10 @@
6156
6190
  if (vm.renderMode !== 0
6157
6191
  /* RenderMode.Light */
6158
6192
  ) {
6159
- var _getFirstChild2 = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
6193
+ var getFirstChild = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
6160
6194
  // Note: for Light DOM, this is handled while hydrating the VM
6161
6195
 
6162
- hydrateChildren(_getFirstChild2(elm), vnode.children, elm, vm);
6196
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
6163
6197
  }
6164
6198
 
6165
6199
  hydrateVM(vm);
@@ -6194,11 +6228,11 @@
6194
6228
  // next node in the list to be hydrated.
6195
6229
 
6196
6230
 
6197
- var _nextSibling = renderer.nextSibling;
6231
+ var nextSibling = renderer.nextSibling;
6198
6232
 
6199
6233
  do {
6200
6234
  var current = nextNode;
6201
- nextNode = _nextSibling(nextNode);
6235
+ nextNode = nextSibling(nextNode);
6202
6236
  removeNode(current, parentNode, renderer);
6203
6237
  } while (nextNode);
6204
6238
  }
@@ -6255,9 +6289,8 @@
6255
6289
  attrValue = _Object$entries$_i[1];
6256
6290
 
6257
6291
  vnode.owner;
6258
- var _getAttribute = renderer.getAttribute;
6259
-
6260
- var elmAttrValue = _getAttribute(elm, attrName);
6292
+ var getAttribute = renderer.getAttribute;
6293
+ var elmAttrValue = getAttribute(elm, attrName);
6261
6294
 
6262
6295
  if (String(attrValue) !== elmAttrValue) {
6263
6296
 
@@ -6373,7 +6406,7 @@
6373
6406
  return false;
6374
6407
  }
6375
6408
 
6376
- return getProperty(client, 'nodeValue') === getProperty(ssr, 'nodeValue');
6409
+ return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
6377
6410
  }
6378
6411
 
6379
6412
  if (getProperty(client, 'nodeType') === 8
@@ -6385,7 +6418,7 @@
6385
6418
  return false;
6386
6419
  }
6387
6420
 
6388
- return getProperty(client, 'nodeValue') === getProperty(ssr, 'nodeValue');
6421
+ return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
6389
6422
  }
6390
6423
 
6391
6424
  if (!hasCorrectNodeType(vnode, ssr, 1
@@ -6457,7 +6490,7 @@
6457
6490
 
6458
6491
  return ctor;
6459
6492
  }
6460
- /* version: 2.23.0 */
6493
+ /* version: 2.23.3 */
6461
6494
 
6462
6495
  /*
6463
6496
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6615,355 +6648,395 @@
6615
6648
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6616
6649
  */
6617
6650
 
6651
+ /**
6652
+ * A factory function that produces a renderer.
6653
+ * Renderer encapsulates operations that are required to render an LWC component into the underlying
6654
+ * runtime environment. In the case of @lwc/enigne-dom, it is meant to be used in a DOM environment.
6655
+ * Example usage:
6656
+ * import { renderer, rendererFactory } from 'lwc';
6657
+ * const customRenderer = rendererFactory(renderer);
6658
+ *
6659
+ * @param baseRenderer Either null or the base renderer imported from 'lwc'.
6660
+ */
6618
6661
 
6619
- var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
6620
- var createFragment;
6621
6662
 
6622
- if (SUPPORTS_TEMPLATE) {
6623
- // Parse the fragment HTML string into DOM
6624
- createFragment = function createFragment(html) {
6625
- var template = document.createElement('template');
6626
- template.innerHTML = html;
6627
- return template.content.firstChild;
6628
- };
6629
- } else {
6630
- // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
6631
- // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
6632
- // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
6633
- // With other elements added from:
6634
- // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
6635
- // Using the test:
6636
- // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
6637
- // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
6638
- var topLevelWrappingMap = {
6639
- caption: ['table'],
6640
- col: ['colgroup', 'table'],
6641
- colgroup: ['table'],
6642
- option: ['select'],
6643
- tbody: ['table'],
6644
- td: ['tr', 'tbody', 'table'],
6645
- th: ['tr', 'tbody', 'table'],
6646
- thead: ['table'],
6647
- tfoot: ['table'],
6648
- tr: ['tbody', 'table']
6649
- }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
6650
-
6651
- var getTagName = function getTagName(text) {
6652
- return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
6653
- }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
6654
-
6655
-
6656
- createFragment = function createFragment(html) {
6657
- var wrapperTags = topLevelWrappingMap[getTagName(html)];
6658
-
6659
- if (!isUndefined$1(wrapperTags)) {
6660
- var _iterator5 = _createForOfIteratorHelper(wrapperTags),
6661
- _step5;
6663
+ function rendererFactory(baseRenderer) {
6664
+ // Util functions
6665
+ function assertInvariant(value, msg) {
6666
+ if (!value) {
6667
+ throw new Error("Invariant Violation: ".concat(msg));
6668
+ }
6669
+ }
6662
6670
 
6663
- try {
6664
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
6665
- var wrapperTag = _step5.value;
6666
- html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
6667
- }
6668
- } catch (err) {
6669
- _iterator5.e(err);
6670
- } finally {
6671
- _iterator5.f();
6672
- }
6673
- } // For IE11, the document title must not be undefined, but it can be an empty string
6674
- // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
6671
+ function isNull(obj) {
6672
+ return obj === null;
6673
+ }
6675
6674
 
6675
+ function isUndefined(obj) {
6676
+ return obj === undefined;
6677
+ }
6676
6678
 
6677
- var doc = document.implementation.createHTMLDocument('');
6678
- doc.body.innerHTML = html;
6679
- var content = doc.body;
6679
+ var getCustomElement;
6680
+ var defineCustomElement;
6681
+ var HTMLElementConstructor;
6680
6682
 
6681
- if (!isUndefined$1(wrapperTags)) {
6682
- for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
6683
- content = content.firstChild;
6684
- }
6683
+ function isCustomElementRegistryAvailable() {
6684
+ if (typeof customElements === 'undefined') {
6685
+ return false;
6685
6686
  }
6686
6687
 
6687
- return content.firstChild;
6688
- };
6689
- }
6690
- /*
6691
- * Copyright (c) 2018, salesforce.com, inc.
6692
- * All rights reserved.
6693
- * SPDX-License-Identifier: MIT
6694
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6695
- */
6688
+ try {
6689
+ // dereference HTMLElement global because babel wraps globals in compat mode with a
6690
+ // _wrapNativeSuper()
6691
+ // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
6692
+ // get wrapped by babel.
6693
+ var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
6694
+ // invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
6695
+ // which are not equipped to be initialized that way.
6696
6696
 
6697
+ var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
6698
+ _inherits(clazz, _HTMLElementAlias);
6697
6699
 
6698
- var getCustomElement;
6699
- var defineCustomElement;
6700
- var HTMLElementConstructor;
6700
+ var _super7 = _createSuper(clazz);
6701
6701
 
6702
- function isCustomElementRegistryAvailable() {
6703
- if (typeof customElements === 'undefined') {
6704
- return false;
6702
+ function clazz() {
6703
+ _classCallCheck(this, clazz);
6704
+
6705
+ return _super7.apply(this, arguments);
6706
+ }
6707
+
6708
+ return _createClass(clazz);
6709
+ }(HTMLElementAlias);
6710
+
6711
+ customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
6712
+ new clazz();
6713
+ return true;
6714
+ } catch (_a) {
6715
+ return false;
6716
+ }
6705
6717
  }
6706
6718
 
6707
- try {
6708
- // dereference HTMLElement global because babel wraps globals in compat mode with a
6709
- // _wrapNativeSuper()
6710
- // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
6711
- // get wrapped by babel.
6712
- var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
6713
- // invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
6714
- // which are not equipped to be initialized that way.
6719
+ if (isCustomElementRegistryAvailable()) {
6720
+ getCustomElement = customElements.get.bind(customElements);
6721
+ defineCustomElement = customElements.define.bind(customElements);
6722
+ HTMLElementConstructor = HTMLElement;
6723
+ } else {
6724
+ var registry = Object.create(null);
6725
+ var reverseRegistry = new WeakMap();
6715
6726
 
6716
- var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
6717
- _inherits(clazz, _HTMLElementAlias);
6727
+ defineCustomElement = function define(name, ctor) {
6728
+ if (name !== String.prototype.toLowerCase.call(name) || registry[name]) {
6729
+ throw new TypeError("Invalid Registration");
6730
+ }
6718
6731
 
6719
- var _super7 = _createSuper(clazz);
6732
+ registry[name] = ctor;
6733
+ reverseRegistry.set(ctor, name);
6734
+ };
6720
6735
 
6721
- function clazz() {
6722
- _classCallCheck(this, clazz);
6736
+ getCustomElement = function get(name) {
6737
+ return registry[name];
6738
+ };
6723
6739
 
6724
- return _super7.apply(this, arguments);
6740
+ HTMLElementConstructor = function HTMLElement() {
6741
+ if (!(this instanceof HTMLElement)) {
6742
+ throw new TypeError("Invalid Invocation");
6725
6743
  }
6726
6744
 
6727
- return _createClass(clazz);
6728
- }(HTMLElementAlias);
6745
+ var constructor = this.constructor;
6746
+ var name = reverseRegistry.get(constructor);
6729
6747
 
6730
- customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
6731
- new clazz();
6732
- return true;
6733
- } catch (_a) {
6734
- return false;
6748
+ if (!name) {
6749
+ throw new TypeError("Invalid Construction");
6750
+ }
6751
+
6752
+ var elm = document.createElement(name);
6753
+ Object.setPrototypeOf(elm, constructor.prototype);
6754
+ return elm;
6755
+ };
6756
+
6757
+ HTMLElementConstructor.prototype = HTMLElement.prototype;
6735
6758
  }
6736
- }
6737
6759
 
6738
- if (isCustomElementRegistryAvailable()) {
6739
- getCustomElement = customElements.get.bind(customElements);
6740
- defineCustomElement = customElements.define.bind(customElements);
6741
- HTMLElementConstructor = HTMLElement;
6742
- } else {
6743
- var registry = create(null);
6744
- var reverseRegistry = new WeakMap();
6760
+ function cloneNode(node, deep) {
6761
+ return node.cloneNode(deep);
6762
+ }
6745
6763
 
6746
- defineCustomElement = function define(name, ctor) {
6747
- if (name !== StringToLowerCase.call(name) || registry[name]) {
6748
- throw new TypeError("Invalid Registration");
6749
- }
6764
+ function createElement(tagName, namespace) {
6765
+ return isUndefined(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
6766
+ }
6750
6767
 
6751
- registry[name] = ctor;
6752
- reverseRegistry.set(ctor, name);
6753
- };
6768
+ function createText(content) {
6769
+ return document.createTextNode(content);
6770
+ }
6754
6771
 
6755
- getCustomElement = function get(name) {
6756
- return registry[name];
6757
- };
6772
+ function createComment(content) {
6773
+ return document.createComment(content);
6774
+ }
6758
6775
 
6759
- HTMLElementConstructor = function HTMLElement() {
6760
- if (!(this instanceof HTMLElement)) {
6761
- throw new TypeError("Invalid Invocation");
6762
- }
6776
+ var createFragment; // IE11 lacks support for this feature
6763
6777
 
6764
- var constructor = this.constructor;
6765
- var name = reverseRegistry.get(constructor);
6778
+ var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
6766
6779
 
6767
- if (!name) {
6768
- throw new TypeError("Invalid Construction");
6769
- }
6780
+ if (SUPPORTS_TEMPLATE) {
6781
+ // Parse the fragment HTML string into DOM
6782
+ createFragment = function createFragment(html) {
6783
+ var template = document.createElement('template');
6784
+ template.innerHTML = html;
6785
+ return template.content.firstChild;
6786
+ };
6787
+ } else {
6788
+ // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
6789
+ // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
6790
+ // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
6791
+ // With other elements added from:
6792
+ // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
6793
+ // Using the test:
6794
+ // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
6795
+ // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
6796
+ var topLevelWrappingMap = {
6797
+ caption: ['table'],
6798
+ col: ['colgroup', 'table'],
6799
+ colgroup: ['table'],
6800
+ option: ['select'],
6801
+ tbody: ['table'],
6802
+ td: ['tr', 'tbody', 'table'],
6803
+ th: ['tr', 'tbody', 'table'],
6804
+ thead: ['table'],
6805
+ tfoot: ['table'],
6806
+ tr: ['tbody', 'table']
6807
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
6808
+
6809
+ var getTagName = function getTagName(text) {
6810
+ return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
6811
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
6812
+
6813
+
6814
+ createFragment = function createFragment(html) {
6815
+ var wrapperTags = topLevelWrappingMap[getTagName(html)];
6816
+
6817
+ if (!isUndefined(wrapperTags)) {
6818
+ var _iterator5 = _createForOfIteratorHelper(wrapperTags),
6819
+ _step5;
6820
+
6821
+ try {
6822
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
6823
+ var wrapperTag = _step5.value;
6824
+ html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
6825
+ }
6826
+ } catch (err) {
6827
+ _iterator5.e(err);
6828
+ } finally {
6829
+ _iterator5.f();
6830
+ }
6831
+ } // For IE11, the document title must not be undefined, but it can be an empty string
6832
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
6770
6833
 
6771
- var elm = document.createElement(name);
6772
- setPrototypeOf(elm, constructor.prototype);
6773
- return elm;
6774
- };
6775
6834
 
6776
- HTMLElementConstructor.prototype = HTMLElement.prototype;
6777
- }
6835
+ var doc = document.implementation.createHTMLDocument('');
6836
+ doc.body.innerHTML = html;
6837
+ var content = doc.body;
6778
6838
 
6779
- var isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
6780
- var isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
6839
+ if (!isUndefined(wrapperTags)) {
6840
+ for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
6841
+ content = content.firstChild;
6842
+ }
6843
+ }
6781
6844
 
6782
- function cloneNode(node, deep) {
6783
- return node.cloneNode(deep);
6784
- }
6845
+ return content.firstChild;
6846
+ };
6847
+ }
6785
6848
 
6786
- function createElement$1(tagName, namespace) {
6787
- return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
6788
- }
6849
+ function insert(node, parent, anchor) {
6850
+ parent.insertBefore(node, anchor);
6851
+ }
6789
6852
 
6790
- function createText(content) {
6791
- return document.createTextNode(content);
6792
- }
6853
+ function remove(node, parent) {
6854
+ parent.removeChild(node);
6855
+ }
6793
6856
 
6794
- function createComment(content) {
6795
- return document.createComment(content);
6796
- }
6857
+ function nextSibling(node) {
6858
+ return node.nextSibling;
6859
+ }
6797
6860
 
6798
- function insert(node, parent, anchor) {
6799
- parent.insertBefore(node, anchor);
6800
- }
6861
+ function attachShadow(element, options) {
6862
+ // `shadowRoot` will be non-null in two cases:
6863
+ // 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
6864
+ // 2. when a webapp author places <c-app> in their static HTML and mounts their
6865
+ // root component with customElement.define('c-app', Ctor)
6866
+ if (!isNull(element.shadowRoot)) {
6867
+ return element.shadowRoot;
6868
+ }
6801
6869
 
6802
- function remove(node, parent) {
6803
- parent.removeChild(node);
6804
- }
6870
+ return element.attachShadow(options);
6871
+ }
6805
6872
 
6806
- function nextSibling(node) {
6807
- return node.nextSibling;
6808
- }
6873
+ function setText(node, content) {
6874
+ node.nodeValue = content;
6875
+ }
6809
6876
 
6810
- function attachShadow(element, options) {
6811
- // `shadowRoot` will be non-null in two cases:
6812
- // 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
6813
- // 2. when a webapp author places <c-app> in their static HTML and mounts their
6814
- // root component with customElement.define('c-app', Ctor)
6815
- if (!isNull(element.shadowRoot)) {
6816
- return element.shadowRoot;
6877
+ function getProperty(node, key) {
6878
+ return node[key];
6817
6879
  }
6818
6880
 
6819
- return element.attachShadow(options);
6820
- }
6881
+ function setProperty(node, key, value) {
6882
+ node[key] = value;
6883
+ }
6821
6884
 
6822
- function setText(node, content) {
6823
- node.nodeValue = content;
6824
- }
6885
+ function getAttribute(element, name, namespace) {
6886
+ return isUndefined(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
6887
+ }
6825
6888
 
6826
- function getProperty(node, key) {
6827
- return node[key];
6828
- }
6889
+ function setAttribute(element, name, value, namespace) {
6890
+ return isUndefined(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
6891
+ }
6829
6892
 
6830
- function setProperty(node, key, value) {
6893
+ function removeAttribute(element, name, namespace) {
6894
+ if (isUndefined(namespace)) {
6895
+ element.removeAttribute(name);
6896
+ } else {
6897
+ element.removeAttributeNS(namespace, name);
6898
+ }
6899
+ }
6831
6900
 
6832
- node[key] = value;
6833
- }
6901
+ function addEventListener(target, type, callback, options) {
6902
+ target.addEventListener(type, callback, options);
6903
+ }
6834
6904
 
6835
- function getAttribute(element, name, namespace) {
6836
- return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
6837
- }
6905
+ function removeEventListener(target, type, callback, options) {
6906
+ target.removeEventListener(type, callback, options);
6907
+ }
6838
6908
 
6839
- function setAttribute(element, name, value, namespace) {
6840
- return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
6841
- }
6909
+ function dispatchEvent(target, event) {
6910
+ return target.dispatchEvent(event);
6911
+ }
6842
6912
 
6843
- function removeAttribute(element, name, namespace) {
6844
- if (isUndefined$1(namespace)) {
6845
- element.removeAttribute(name);
6846
- } else {
6847
- element.removeAttributeNS(namespace, name);
6913
+ function getClassList(element) {
6914
+ return element.classList;
6848
6915
  }
6849
- }
6850
6916
 
6851
- function addEventListener(target, type, callback, options) {
6852
- target.addEventListener(type, callback, options);
6853
- }
6917
+ function setCSSStyleProperty(element, name, value, important) {
6918
+ // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
6919
+ // represent elements in the engine?
6920
+ element.style.setProperty(name, value, important ? 'important' : '');
6921
+ }
6854
6922
 
6855
- function removeEventListener(target, type, callback, options) {
6856
- target.removeEventListener(type, callback, options);
6857
- }
6923
+ function getBoundingClientRect(element) {
6924
+ return element.getBoundingClientRect();
6925
+ }
6858
6926
 
6859
- function dispatchEvent(target, event) {
6860
- return target.dispatchEvent(event);
6861
- }
6927
+ function querySelector(element, selectors) {
6928
+ return element.querySelector(selectors);
6929
+ }
6862
6930
 
6863
- function getClassList(element) {
6864
- return element.classList;
6865
- }
6931
+ function querySelectorAll(element, selectors) {
6932
+ return element.querySelectorAll(selectors);
6933
+ }
6866
6934
 
6867
- function setCSSStyleProperty(element, name, value, important) {
6868
- // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
6869
- // represent elements in the engine?
6870
- element.style.setProperty(name, value, important ? 'important' : '');
6871
- }
6935
+ function getElementsByTagName(element, tagNameOrWildCard) {
6936
+ return element.getElementsByTagName(tagNameOrWildCard);
6937
+ }
6872
6938
 
6873
- function getBoundingClientRect(element) {
6874
- return element.getBoundingClientRect();
6875
- }
6939
+ function getElementsByClassName(element, names) {
6940
+ return element.getElementsByClassName(names);
6941
+ }
6876
6942
 
6877
- function querySelector(element, selectors) {
6878
- return element.querySelector(selectors);
6879
- }
6943
+ function getChildren(element) {
6944
+ return element.children;
6945
+ }
6880
6946
 
6881
- function querySelectorAll(element, selectors) {
6882
- return element.querySelectorAll(selectors);
6883
- }
6947
+ function getChildNodes(element) {
6948
+ return element.childNodes;
6949
+ }
6884
6950
 
6885
- function getElementsByTagName(element, tagNameOrWildCard) {
6886
- return element.getElementsByTagName(tagNameOrWildCard);
6887
- }
6951
+ function getFirstChild(element) {
6952
+ return element.firstChild;
6953
+ }
6888
6954
 
6889
- function getElementsByClassName(element, names) {
6890
- return element.getElementsByClassName(names);
6891
- }
6955
+ function getFirstElementChild(element) {
6956
+ return element.firstElementChild;
6957
+ }
6892
6958
 
6893
- function getChildren(element) {
6894
- return element.children;
6895
- }
6959
+ function getLastChild(element) {
6960
+ return element.lastChild;
6961
+ }
6896
6962
 
6897
- function getChildNodes(element) {
6898
- return element.childNodes;
6899
- }
6963
+ function getLastElementChild(element) {
6964
+ return element.lastElementChild;
6965
+ }
6900
6966
 
6901
- function getFirstChild(element) {
6902
- return element.firstChild;
6903
- }
6967
+ function isConnected(node) {
6968
+ return node.isConnected;
6969
+ }
6904
6970
 
6905
- function getFirstElementChild(element) {
6906
- return element.firstElementChild;
6907
- }
6971
+ function assertInstanceOfHTMLElement(elm, msg) {
6972
+ assertInvariant(elm instanceof HTMLElement, msg);
6973
+ }
6908
6974
 
6909
- function getLastChild(element) {
6910
- return element.lastChild;
6911
- }
6975
+ var HTMLElementExported = HTMLElementConstructor;
6976
+ var renderer = {
6977
+ HTMLElementExported: HTMLElementExported,
6978
+ insert: insert,
6979
+ remove: remove,
6980
+ cloneNode: cloneNode,
6981
+ createFragment: createFragment,
6982
+ createElement: createElement,
6983
+ createText: createText,
6984
+ createComment: createComment,
6985
+ nextSibling: nextSibling,
6986
+ attachShadow: attachShadow,
6987
+ getProperty: getProperty,
6988
+ setProperty: setProperty,
6989
+ setText: setText,
6990
+ getAttribute: getAttribute,
6991
+ setAttribute: setAttribute,
6992
+ removeAttribute: removeAttribute,
6993
+ addEventListener: addEventListener,
6994
+ removeEventListener: removeEventListener,
6995
+ dispatchEvent: dispatchEvent,
6996
+ getClassList: getClassList,
6997
+ setCSSStyleProperty: setCSSStyleProperty,
6998
+ getBoundingClientRect: getBoundingClientRect,
6999
+ querySelector: querySelector,
7000
+ querySelectorAll: querySelectorAll,
7001
+ getElementsByTagName: getElementsByTagName,
7002
+ getElementsByClassName: getElementsByClassName,
7003
+ getChildren: getChildren,
7004
+ getChildNodes: getChildNodes,
7005
+ getFirstChild: getFirstChild,
7006
+ getFirstElementChild: getFirstElementChild,
7007
+ getLastChild: getLastChild,
7008
+ getLastElementChild: getLastElementChild,
7009
+ isConnected: isConnected,
7010
+ assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
7011
+ defineCustomElement: defineCustomElement,
7012
+ getCustomElement: getCustomElement
7013
+ }; // Meant to inherit any properties passed via the base renderer as the argument to the factory.
6912
7014
 
6913
- function getLastElementChild(element) {
6914
- return element.lastElementChild;
7015
+ Object.setPrototypeOf(renderer, baseRenderer);
7016
+ return renderer;
6915
7017
  }
7018
+ /*
7019
+ * Copyright (c) 2018, salesforce.com, inc.
7020
+ * All rights reserved.
7021
+ * SPDX-License-Identifier: MIT
7022
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
7023
+ */
6916
7024
 
6917
- function isConnected(node) {
6918
- return node.isConnected;
6919
- }
7025
+ /**
7026
+ * The base renderer that will be used by engine-core.
7027
+ * This will be used for DOM operations when lwc is running in a browser environment.
7028
+ */
6920
7029
 
6921
- function assertInstanceOfHTMLElement(elm, msg) {
6922
- assert.invariant(elm instanceof HTMLElement, msg);
6923
- }
6924
7030
 
6925
- var HTMLElementExported = HTMLElementConstructor;
6926
- var renderer = {
6927
- isNativeShadowDefined: isNativeShadowDefined,
6928
- isSyntheticShadowDefined: isSyntheticShadowDefined,
6929
- HTMLElementExported: HTMLElementExported,
6930
- insert: insert,
6931
- remove: remove,
6932
- cloneNode: cloneNode,
6933
- createFragment: createFragment,
6934
- createElement: createElement$1,
6935
- createText: createText,
6936
- createComment: createComment,
6937
- nextSibling: nextSibling,
6938
- attachShadow: attachShadow,
6939
- getProperty: getProperty,
6940
- setProperty: setProperty,
6941
- setText: setText,
6942
- getAttribute: getAttribute,
6943
- setAttribute: setAttribute,
6944
- removeAttribute: removeAttribute,
6945
- addEventListener: addEventListener,
6946
- removeEventListener: removeEventListener,
6947
- dispatchEvent: dispatchEvent,
6948
- getClassList: getClassList,
6949
- setCSSStyleProperty: setCSSStyleProperty,
6950
- getBoundingClientRect: getBoundingClientRect,
6951
- querySelector: querySelector,
6952
- querySelectorAll: querySelectorAll,
6953
- getElementsByTagName: getElementsByTagName,
6954
- getElementsByClassName: getElementsByClassName,
6955
- getChildren: getChildren,
6956
- getChildNodes: getChildNodes,
6957
- getFirstChild: getFirstChild,
6958
- getFirstElementChild: getFirstElementChild,
6959
- getLastChild: getLastChild,
6960
- getLastElementChild: getLastElementChild,
6961
- isConnected: isConnected,
7031
+ var renderer = assign( // The base renderer will invoke the factory with null and assign additional properties that are
7032
+ // shared across renderers
7033
+ rendererFactory(null), // Properties that are either not required to be sandboxed or rely on a globally shared information
7034
+ {
7035
+ // insertStyleSheet implementation shares a global cache of stylesheet data
6962
7036
  insertStylesheet: insertStylesheet,
6963
- assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
6964
- defineCustomElement: defineCustomElement,
6965
- getCustomElement: getCustomElement
6966
- };
7037
+ isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
7038
+ isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN)
7039
+ });
6967
7040
  /*
6968
7041
  * Copyright (c) 2018, salesforce.com, inc.
6969
7042
  * All rights reserved.
@@ -7131,7 +7204,6 @@
7131
7204
  * SPDX-License-Identifier: MIT
7132
7205
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
7133
7206
  */
7134
- // TODO [#2472]: Remove this workaround when appropriate.
7135
7207
  // eslint-disable-next-line @lwc/lwc-internal/no-global-node
7136
7208
 
7137
7209
 
@@ -7148,39 +7220,41 @@
7148
7220
  }
7149
7221
 
7150
7222
  return node; // for convenience
7151
- } // Monkey patching Node methods to be able to detect the insertions and removal of root elements
7152
- // created via createElement.
7153
-
7223
+ }
7154
7224
 
7155
- var _Node$1$prototype = _Node$1.prototype,
7156
- _appendChild2 = _Node$1$prototype.appendChild,
7157
- _insertBefore2 = _Node$1$prototype.insertBefore,
7158
- _removeChild2 = _Node$1$prototype.removeChild,
7159
- _replaceChild2 = _Node$1$prototype.replaceChild;
7160
- assign(_Node$1.prototype, {
7161
- appendChild: function appendChild(newChild) {
7162
- var appendedNode = _appendChild2.call(this, newChild);
7225
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
7226
+ // Monkey patching Node methods to be able to detect the insertions and removal of root elements
7227
+ // created via createElement.
7228
+ var _Node$1$prototype = _Node$1.prototype,
7229
+ _appendChild = _Node$1$prototype.appendChild,
7230
+ _insertBefore = _Node$1$prototype.insertBefore,
7231
+ _removeChild = _Node$1$prototype.removeChild,
7232
+ _replaceChild = _Node$1$prototype.replaceChild;
7233
+ assign(_Node$1.prototype, {
7234
+ appendChild: function appendChild(newChild) {
7235
+ var appendedNode = _appendChild.call(this, newChild);
7163
7236
 
7164
- return callNodeSlot(appendedNode, ConnectingSlot);
7165
- },
7166
- insertBefore: function insertBefore(newChild, referenceNode) {
7167
- var insertedNode = _insertBefore2.call(this, newChild, referenceNode);
7237
+ return callNodeSlot(appendedNode, ConnectingSlot);
7238
+ },
7239
+ insertBefore: function insertBefore(newChild, referenceNode) {
7240
+ var insertedNode = _insertBefore.call(this, newChild, referenceNode);
7168
7241
 
7169
- return callNodeSlot(insertedNode, ConnectingSlot);
7170
- },
7171
- removeChild: function removeChild(oldChild) {
7172
- var removedNode = _removeChild2.call(this, oldChild);
7242
+ return callNodeSlot(insertedNode, ConnectingSlot);
7243
+ },
7244
+ removeChild: function removeChild(oldChild) {
7245
+ var removedNode = _removeChild.call(this, oldChild);
7173
7246
 
7174
- return callNodeSlot(removedNode, DisconnectingSlot);
7175
- },
7176
- replaceChild: function replaceChild(newChild, oldChild) {
7177
- var replacedNode = _replaceChild2.call(this, newChild, oldChild);
7247
+ return callNodeSlot(removedNode, DisconnectingSlot);
7248
+ },
7249
+ replaceChild: function replaceChild(newChild, oldChild) {
7250
+ var replacedNode = _replaceChild.call(this, newChild, oldChild);
7178
7251
 
7179
- callNodeSlot(replacedNode, DisconnectingSlot);
7180
- callNodeSlot(newChild, ConnectingSlot);
7181
- return replacedNode;
7182
- }
7183
- });
7252
+ callNodeSlot(replacedNode, DisconnectingSlot);
7253
+ callNodeSlot(newChild, ConnectingSlot);
7254
+ return replacedNode;
7255
+ }
7256
+ });
7257
+ }
7184
7258
  /**
7185
7259
  * EXPERIMENTAL: This function is almost identical to document.createElement with the slightly
7186
7260
  * difference that in the options, you can pass the `is` property set to a Constructor instead of
@@ -7193,6 +7267,7 @@
7193
7267
  * ```
7194
7268
  */
7195
7269
 
7270
+
7196
7271
  function createElement(sel, options) {
7197
7272
  if (!isObject(options) || isNull(options)) {
7198
7273
  throw new TypeError("\"createElement\" function expects an object as second parameter but received \"".concat(toString$1(options), "\"."));
@@ -7220,8 +7295,12 @@
7220
7295
  mode: options.mode !== 'closed' ? 'open' : 'closed',
7221
7296
  owner: null
7222
7297
  });
7223
- ConnectingSlot.set(elm, connectRootElement);
7224
- DisconnectingSlot.set(elm, disconnectRootElement);
7298
+
7299
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
7300
+ ConnectingSlot.set(elm, connectRootElement);
7301
+ DisconnectingSlot.set(elm, disconnectRootElement);
7302
+ }
7303
+
7225
7304
  wasComponentUpgraded = true;
7226
7305
  });
7227
7306
 
@@ -7268,7 +7347,7 @@
7268
7347
  // inserted nodes without the `lwc:dom=manual` directive will be considered as global elements.
7269
7348
 
7270
7349
 
7271
- return isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
7350
+ return renderer.isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
7272
7351
  }
7273
7352
  /*
7274
7353
  * Copyright (c) 2018, salesforce.com, inc.
@@ -7312,7 +7391,7 @@
7312
7391
  });
7313
7392
  freeze(LightningElement);
7314
7393
  seal(LightningElement.prototype);
7315
- /* version: 2.23.0 */
7394
+ /* version: 2.23.3 */
7316
7395
 
7317
7396
  exports.LightningElement = LightningElement;
7318
7397
  exports.__unstable__ProfilerControl = profilerControl;
@@ -7334,6 +7413,7 @@
7334
7413
  exports.registerDecorators = registerDecorators;
7335
7414
  exports.registerTemplate = registerTemplate;
7336
7415
  exports.renderer = renderer;
7416
+ exports.rendererFactory = rendererFactory;
7337
7417
  exports.sanitizeAttribute = sanitizeAttribute;
7338
7418
  exports.setFeatureFlag = setFeatureFlag;
7339
7419
  exports.setFeatureFlagForTest = setFeatureFlagForTest;