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
@@ -368,9 +368,13 @@
368
368
  // Increment whenever the LWC template compiler changes
369
369
 
370
370
 
371
- var LWC_VERSION = "2.23.0";
371
+ var LWC_VERSION = "2.23.3";
372
372
  var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
373
- /** version: 2.23.0 */
373
+ /** version: 2.23.3 */
374
+
375
+ /**
376
+ * Copyright (C) 2018 salesforce.com, inc.
377
+ */
374
378
 
375
379
  /*
376
380
  * Copyright (c) 2018, salesforce.com, inc.
@@ -380,7 +384,7 @@
380
384
  */
381
385
 
382
386
  function detect(propName) {
383
- return Object.getOwnPropertyDescriptor(Element.prototype, propName) === undefined;
387
+ return getOwnPropertyDescriptor$1(Element.prototype, propName) === undefined;
384
388
  }
385
389
  /*
386
390
  * Copyright (c) 2018, salesforce.com, inc.
@@ -460,6 +464,8 @@
460
464
  patch$1(propName);
461
465
  }
462
466
  }
467
+ /** version: 2.23.3 */
468
+
463
469
  /**
464
470
  * Copyright (C) 2018 salesforce.com, inc.
465
471
  */
@@ -480,6 +486,7 @@
480
486
  ENABLE_HTML_COLLECTIONS_PATCH: null,
481
487
  ENABLE_INNER_OUTER_TEXT_PATCH: null,
482
488
  ENABLE_MIXED_SHADOW_MODE: null,
489
+ ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null,
483
490
  ENABLE_NODE_LIST_PATCH: null,
484
491
  ENABLE_NODE_PATCH: null,
485
492
  ENABLE_REACTIVE_SETTER: null,
@@ -492,7 +499,7 @@
492
499
  });
493
500
  }
494
501
 
495
- var runtimeFlags = _globalThis.lwcRuntimeFlags;
502
+ var lwcRuntimeFlags = _globalThis.lwcRuntimeFlags;
496
503
  /**
497
504
  * Set the value at runtime of a given feature flag. This method only be invoked once per feature
498
505
  * flag. It is meant to be used during the app initialization.
@@ -522,10 +529,10 @@
522
529
 
523
530
  if (process.env.NODE_ENV !== 'production') {
524
531
  // Allow the same flag to be set more than once outside of production to enable testing
525
- runtimeFlags[name] = value;
532
+ lwcRuntimeFlags[name] = value;
526
533
  } else {
527
534
  // Disallow the same flag to be set more than once in production
528
- var runtimeValue = runtimeFlags[name];
535
+ var runtimeValue = lwcRuntimeFlags[name];
529
536
 
530
537
  if (!isUndefined$1(runtimeValue)) {
531
538
  // eslint-disable-next-line no-console
@@ -533,7 +540,7 @@
533
540
  return;
534
541
  }
535
542
 
536
- defineProperty(runtimeFlags, name, {
543
+ defineProperty(lwcRuntimeFlags, name, {
537
544
  value: value
538
545
  });
539
546
  }
@@ -549,7 +556,7 @@
549
556
  setFeatureFlag(name, value);
550
557
  }
551
558
  }
552
- /** version: 2.23.0 */
559
+ /** version: 2.23.3 */
553
560
 
554
561
  /*
555
562
  * Copyright (c) 2018, salesforce.com, inc.
@@ -564,7 +571,7 @@
564
571
  window.addEventListener('test-dummy-flag', function () {
565
572
  var hasFlag = false;
566
573
 
567
- if (runtimeFlags.DUMMY_TEST_FLAG) {
574
+ if (lwcRuntimeFlags.DUMMY_TEST_FLAG) {
568
575
  hasFlag = true;
569
576
  }
570
577
 
@@ -591,7 +598,7 @@
591
598
  window.addEventListener('test-dummy-flag', function () {
592
599
  var hasFlag = false;
593
600
 
594
- if (runtimeFlags.DUMMY_TEST_FLAG) {
601
+ if (lwcRuntimeFlags.DUMMY_TEST_FLAG) {
595
602
  hasFlag = true;
596
603
  }
597
604
 
@@ -991,8 +998,8 @@
991
998
  // to inject at runtime.
992
999
 
993
1000
 
994
- var HTMLElementConstructor$1 = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
995
- var HTMLElementPrototype = HTMLElementConstructor$1.prototype;
1001
+ var HTMLElementConstructor = typeof HTMLElement !== 'undefined' ? HTMLElement : function () {};
1002
+ var HTMLElementPrototype = HTMLElementConstructor.prototype;
996
1003
  /*
997
1004
  * Copyright (c) 2018, salesforce.com, inc.
998
1005
  * All rights reserved.
@@ -1212,10 +1219,10 @@
1212
1219
  }; // Apply extra restriction related to DOM manipulation if the element is not a portal.
1213
1220
 
1214
1221
  if (!options.isLight && !options.isPortal) {
1215
- var _appendChild = elm.appendChild,
1216
- _insertBefore = elm.insertBefore,
1217
- _removeChild = elm.removeChild,
1218
- _replaceChild = elm.replaceChild;
1222
+ var appendChild = elm.appendChild,
1223
+ insertBefore = elm.insertBefore,
1224
+ removeChild = elm.removeChild,
1225
+ replaceChild = elm.replaceChild;
1219
1226
  var originalNodeValueDescriptor = getPropertyDescriptor(elm, 'nodeValue');
1220
1227
  var originalInnerHTMLDescriptor = getPropertyDescriptor(elm, 'innerHTML');
1221
1228
  var originalTextContentDescriptor = getPropertyDescriptor(elm, 'textContent');
@@ -1223,7 +1230,7 @@
1223
1230
  appendChild: generateDataDescriptor({
1224
1231
  value: function value(aChild) {
1225
1232
  logMissingPortalError('appendChild', 'method');
1226
- return _appendChild.call(this, aChild);
1233
+ return appendChild.call(this, aChild);
1227
1234
  }
1228
1235
  }),
1229
1236
  insertBefore: generateDataDescriptor({
@@ -1232,7 +1239,7 @@
1232
1239
  logMissingPortalError('insertBefore', 'method');
1233
1240
  }
1234
1241
 
1235
- return _insertBefore.call(this, newNode, referenceNode);
1242
+ return insertBefore.call(this, newNode, referenceNode);
1236
1243
  }
1237
1244
  }),
1238
1245
  removeChild: generateDataDescriptor({
@@ -1241,13 +1248,13 @@
1241
1248
  logMissingPortalError('removeChild', 'method');
1242
1249
  }
1243
1250
 
1244
- return _removeChild.call(this, aChild);
1251
+ return removeChild.call(this, aChild);
1245
1252
  }
1246
1253
  }),
1247
1254
  replaceChild: generateDataDescriptor({
1248
1255
  value: function value(newChild, oldChild) {
1249
1256
  logMissingPortalError('replaceChild', 'method');
1250
- return _replaceChild.call(this, newChild, oldChild);
1257
+ return replaceChild.call(this, newChild, oldChild);
1251
1258
  }
1252
1259
  }),
1253
1260
  nodeValue: generateAccessorDescriptor({
@@ -2408,9 +2415,8 @@
2408
2415
  var bridge = def.bridge;
2409
2416
 
2410
2417
  if (process.env.NODE_ENV !== 'production') {
2411
- var _assertInstanceOfHTMLElement = vm.renderer.assertInstanceOfHTMLElement;
2412
-
2413
- _assertInstanceOfHTMLElement(vm.elm, "Component creation requires a DOM element to be associated to ".concat(vm, "."));
2418
+ var assertInstanceOfHTMLElement = vm.renderer.assertInstanceOfHTMLElement;
2419
+ assertInstanceOfHTMLElement(vm.elm, "Component creation requires a DOM element to be associated to ".concat(vm, "."));
2414
2420
  }
2415
2421
 
2416
2422
  var component = this;
@@ -2914,7 +2920,7 @@
2914
2920
  }
2915
2921
 
2916
2922
  if (_set2) {
2917
- if (runtimeFlags.ENABLE_REACTIVE_SETTER) {
2923
+ if (lwcRuntimeFlags.ENABLE_REACTIVE_SETTER) {
2918
2924
  var ro = vm.oar[key];
2919
2925
 
2920
2926
  if (isUndefined$1(ro)) {
@@ -3587,7 +3593,7 @@
3587
3593
  return HTMLBridgeElement;
3588
3594
  }
3589
3595
 
3590
- var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor$1, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
3596
+ var BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
3591
3597
  freeze(BaseBridgeElement);
3592
3598
  seal(BaseBridgeElement.prototype);
3593
3599
  /*
@@ -3679,7 +3685,7 @@
3679
3685
  throw new ReferenceError();
3680
3686
  }
3681
3687
 
3682
- if (runtimeFlags.ENABLE_HMR) {
3688
+ if (lwcRuntimeFlags.ENABLE_HMR) {
3683
3689
  var visited = new Set();
3684
3690
 
3685
3691
  while (swappedTemplateMap.has(tpl) && !visited.has(tpl)) {
@@ -3697,7 +3703,7 @@
3697
3703
  throw new ReferenceError();
3698
3704
  }
3699
3705
 
3700
- if (runtimeFlags.ENABLE_HMR) {
3706
+ if (lwcRuntimeFlags.ENABLE_HMR) {
3701
3707
  var visited = new Set();
3702
3708
 
3703
3709
  while (swappedComponentMap.has(Ctor) && !visited.has(Ctor)) {
@@ -3715,7 +3721,7 @@
3715
3721
  throw new ReferenceError();
3716
3722
  }
3717
3723
 
3718
- if (runtimeFlags.ENABLE_HMR) {
3724
+ if (lwcRuntimeFlags.ENABLE_HMR) {
3719
3725
  var visited = new Set();
3720
3726
 
3721
3727
  while (swappedStyleMap.has(style) && !visited.has(style)) {
@@ -3733,7 +3739,7 @@
3733
3739
  throw new ReferenceError();
3734
3740
  }
3735
3741
 
3736
- if (runtimeFlags.ENABLE_HMR) {
3742
+ if (lwcRuntimeFlags.ENABLE_HMR) {
3737
3743
  // tracking active component
3738
3744
  var Ctor = vm.def.ctor;
3739
3745
  var componentVMs = activeComponents.get(Ctor);
@@ -3791,7 +3797,7 @@
3791
3797
  throw new ReferenceError();
3792
3798
  }
3793
3799
 
3794
- if (runtimeFlags.ENABLE_HMR) {
3800
+ if (lwcRuntimeFlags.ENABLE_HMR) {
3795
3801
  // tracking inactive component
3796
3802
  var Ctor = vm.def.ctor;
3797
3803
  var list = activeComponents.get(Ctor);
@@ -3839,7 +3845,7 @@
3839
3845
  }
3840
3846
  }
3841
3847
 
3842
- if (!runtimeFlags.ENABLE_HMR) {
3848
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
3843
3849
  throw new Error('HMR is not enabled');
3844
3850
  }
3845
3851
 
@@ -3856,7 +3862,7 @@
3856
3862
  }
3857
3863
  }
3858
3864
 
3859
- if (!runtimeFlags.ENABLE_HMR) {
3865
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
3860
3866
  throw new Error('HMR is not enabled');
3861
3867
  }
3862
3868
 
@@ -3871,7 +3877,7 @@
3871
3877
  return rehydrateHotStyle(oldStyle);
3872
3878
  }
3873
3879
 
3874
- if (!runtimeFlags.ENABLE_HMR) {
3880
+ if (!lwcRuntimeFlags.ENABLE_HMR) {
3875
3881
  throw new Error('HMR is not enabled');
3876
3882
  }
3877
3883
 
@@ -4382,6 +4388,18 @@
4382
4388
  */
4383
4389
 
4384
4390
 
4391
+ function checkHasVM(elm) {
4392
+ var hasVM = !isUndefined$1(getAssociatedVMIfPresent(elm));
4393
+
4394
+ if (process.env.NODE_ENV !== 'production' && !hasVM) {
4395
+ // Occurs when an element is manually created with the same tag name as an existing LWC component. In that case,
4396
+ // we skip calling the LWC connectedCallback/disconnectedCallback logic and log an error.
4397
+ logError("VM for tag name \"".concat(elm.tagName.toLowerCase(), "\" is undefined. ") + "This indicates that an element was created with this tag name, " + "which is already reserved by an LWC component. Use lwc.createElement " + "instead to create elements.");
4398
+ }
4399
+
4400
+ return hasVM;
4401
+ }
4402
+
4385
4403
  function getUpgradableConstructor(tagName, renderer) {
4386
4404
  var getCustomElement = renderer.getCustomElement,
4387
4405
  RendererHTMLElement = renderer.HTMLElementExported,
@@ -4423,6 +4441,20 @@
4423
4441
  return _createClass(LWCUpgradableElement);
4424
4442
  }(RendererHTMLElement);
4425
4443
 
4444
+ if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
4445
+ CE.prototype.connectedCallback = function () {
4446
+ if (checkHasVM(this)) {
4447
+ connectRootElement(this);
4448
+ }
4449
+ };
4450
+
4451
+ CE.prototype.disconnectedCallback = function () {
4452
+ if (checkHasVM(this)) {
4453
+ disconnectRootElement(this);
4454
+ }
4455
+ };
4456
+ }
4457
+
4426
4458
  defineCustomElement(tagName, CE);
4427
4459
  return CE;
4428
4460
  }
@@ -4534,6 +4566,15 @@
4534
4566
  // different than the one previously set.
4535
4567
 
4536
4568
  if (isFirstPatch || cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
4569
+ // Additional verification if properties are supported by the element
4570
+ // Validation relies on html properties and public properties being defined on the element,
4571
+ // SSR has its own custom validation.
4572
+ if (process.env.NODE_ENV !== 'production') {
4573
+ if (!(key in elm)) {
4574
+ logWarn("Unknown public property \"".concat(key, "\" of element <").concat(elm.tagName.toLowerCase(), ">. This is either a typo on the corresponding attribute \"").concat(htmlPropertyToAttribute(key), "\", or the attribute does not exist in this browser or DOM implementation."));
4575
+ }
4576
+ }
4577
+
4537
4578
  setProperty(elm, key, cur);
4538
4579
  }
4539
4580
  }
@@ -4946,13 +4987,19 @@
4946
4987
  insertNode(elm, parent, anchor, renderer);
4947
4988
 
4948
4989
  if (vm) {
4949
- if (process.env.NODE_ENV !== 'production') {
4950
- assert.isTrue(vm.state === 0
4951
- /* VMState.created */
4952
- , "".concat(vm, " cannot be recycled."));
4953
- }
4990
+ {
4991
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
4992
+ if (process.env.NODE_ENV !== 'production') {
4993
+ // With synthetic lifecycle callbacks, it's possible for elements to be removed without the engine
4994
+ // noticing it (e.g. `appendChild` the same host element twice). This test ensures we don't regress.
4995
+ assert.isTrue(vm.state === 0
4996
+ /* VMState.created */
4997
+ , "".concat(vm, " cannot be recycled."));
4998
+ }
4954
4999
 
4955
- runConnectedCallback(vm);
5000
+ runConnectedCallback(vm);
5001
+ }
5002
+ }
4956
5003
  }
4957
5004
 
4958
5005
  mountVNodes(vnode.children, elm, renderer, null);
@@ -5142,10 +5189,10 @@
5142
5189
  var scopeToken = getScopeTokenClass(owner);
5143
5190
 
5144
5191
  if (!isNull(scopeToken)) {
5145
- var _getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
5192
+ var getClassList = renderer.getClassList; // TODO [#2762]: this dot notation with add is probably problematic
5146
5193
  // probably we should have a renderer api for just the add operation
5147
5194
 
5148
- _getClassList(elm).add(scopeToken);
5195
+ getClassList(elm).add(scopeToken);
5149
5196
  } // Set property element for synthetic shadow DOM style scoping.
5150
5197
 
5151
5198
 
@@ -6751,7 +6798,7 @@
6751
6798
  return "[object:vm ".concat(def.name, " (").concat(vm.idx, ")]");
6752
6799
  };
6753
6800
 
6754
- if (runtimeFlags.ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST) {
6801
+ if (lwcRuntimeFlags.ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST) {
6755
6802
  vm.shadowMode = 0
6756
6803
  /* ShadowMode.Native */
6757
6804
  ;
@@ -6786,7 +6833,7 @@
6786
6833
  } else if (isNativeShadowDefined) {
6787
6834
  // Not combined with above condition because @lwc/features only supports identifiers in
6788
6835
  // the if-condition.
6789
- if (runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
6836
+ if (lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE) {
6790
6837
  if (def.shadowSupportMode === "any"
6791
6838
  /* ShadowSupportMode.Any */
6792
6839
  ) {
@@ -7480,7 +7527,7 @@
7480
7527
  ArrayPush$1.call(wiredConnecting, function () {
7481
7528
  connector.connect();
7482
7529
 
7483
- if (!runtimeFlags.ENABLE_WIRE_SYNC_EMIT) {
7530
+ if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
7484
7531
  if (hasDynamicParams) {
7485
7532
  Promise.resolve().then(computeConfigAndUpdate);
7486
7533
  return;
@@ -7660,6 +7707,8 @@
7660
7707
  return renderer.nextSibling(hydratedNode);
7661
7708
  }
7662
7709
 
7710
+ var NODE_VALUE_PROP = 'nodeValue';
7711
+
7663
7712
  function hydrateText(node, vnode, renderer) {
7664
7713
  var _a;
7665
7714
 
@@ -7670,9 +7719,8 @@
7670
7719
  }
7671
7720
 
7672
7721
  if (process.env.NODE_ENV !== 'production') {
7673
- var _getProperty = renderer.getProperty;
7674
-
7675
- var nodeValue = _getProperty(node, 'nodeValue');
7722
+ var getProperty = renderer.getProperty;
7723
+ var nodeValue = getProperty(node, NODE_VALUE_PROP);
7676
7724
 
7677
7725
  if (nodeValue !== vnode.text && !(nodeValue === "\u200D" && vnode.text === '')) {
7678
7726
  logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
@@ -7695,9 +7743,8 @@
7695
7743
  }
7696
7744
 
7697
7745
  if (process.env.NODE_ENV !== 'production') {
7698
- var _getProperty2 = renderer.getProperty;
7699
-
7700
- var nodeValue = _getProperty2(node, 'nodeValue');
7746
+ var getProperty = renderer.getProperty;
7747
+ var nodeValue = getProperty(node, NODE_VALUE_PROP);
7701
7748
 
7702
7749
  if (nodeValue !== vnode.text) {
7703
7750
  logWarn('Hydration mismatch: comment values do not match, will recover from the difference', vnode.owner);
@@ -7705,7 +7752,7 @@
7705
7752
  }
7706
7753
 
7707
7754
  var setProperty = renderer.setProperty;
7708
- setProperty(node, 'nodeValue', (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
7755
+ setProperty(node, NODE_VALUE_PROP, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
7709
7756
  vnode.elm = node;
7710
7757
  return node;
7711
7758
  }
@@ -7737,17 +7784,17 @@
7737
7784
  // it may be that this element has lwc:inner-html, we need to diff and in case are the same,
7738
7785
  // remove the innerHTML from props so it reuses the existing dom elements.
7739
7786
  var props = vnode.data.props;
7740
- var _getProperty3 = renderer.getProperty;
7787
+ var getProperty = renderer.getProperty;
7741
7788
 
7742
7789
  if (!isUndefined$1(props) && !isUndefined$1(props.innerHTML)) {
7743
- if (_getProperty3(elm, 'innerHTML') === props.innerHTML) {
7790
+ if (getProperty(elm, 'innerHTML') === props.innerHTML) {
7744
7791
  // Do a shallow clone since VNodeData may be shared across VNodes due to hoist optimization
7745
7792
  vnode.data = Object.assign(Object.assign({}, vnode.data), {
7746
7793
  props: cloneAndOmitKey(props, 'innerHTML')
7747
7794
  });
7748
7795
  } else {
7749
7796
  if (process.env.NODE_ENV !== 'production') {
7750
- logWarn("Mismatch hydrating element <".concat(_getProperty3(elm, 'tagName').toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), owner);
7797
+ logWarn("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: innerHTML values do not match for element, will recover from the difference"), owner);
7751
7798
  }
7752
7799
  }
7753
7800
  }
@@ -7756,8 +7803,8 @@
7756
7803
  patchElementPropsAndAttrs(vnode, renderer);
7757
7804
 
7758
7805
  if (!isDomManual) {
7759
- var _getFirstChild = renderer.getFirstChild;
7760
- hydrateChildren(_getFirstChild(elm), vnode.children, elm, owner);
7806
+ var getFirstChild = renderer.getFirstChild;
7807
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, owner);
7761
7808
  }
7762
7809
 
7763
7810
  return elm;
@@ -7796,10 +7843,10 @@
7796
7843
  if (vm.renderMode !== 0
7797
7844
  /* RenderMode.Light */
7798
7845
  ) {
7799
- var _getFirstChild2 = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
7846
+ var getFirstChild = renderer.getFirstChild; // VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
7800
7847
  // Note: for Light DOM, this is handled while hydrating the VM
7801
7848
 
7802
- hydrateChildren(_getFirstChild2(elm), vnode.children, elm, vm);
7849
+ hydrateChildren(getFirstChild(elm), vnode.children, elm, vm);
7803
7850
  }
7804
7851
 
7805
7852
  hydrateVM(vm);
@@ -7848,11 +7895,11 @@
7848
7895
  // next node in the list to be hydrated.
7849
7896
 
7850
7897
 
7851
- var _nextSibling = renderer.nextSibling;
7898
+ var nextSibling = renderer.nextSibling;
7852
7899
 
7853
7900
  do {
7854
7901
  var current = nextNode;
7855
- nextNode = _nextSibling(nextNode);
7902
+ nextNode = nextSibling(nextNode);
7856
7903
  removeNode(current, parentNode, renderer);
7857
7904
  } while (nextNode);
7858
7905
  }
@@ -7915,14 +7962,13 @@
7915
7962
  attrValue = _Object$entries$_i[1];
7916
7963
 
7917
7964
  var owner = vnode.owner;
7918
- var _getAttribute = renderer.getAttribute;
7919
-
7920
- var elmAttrValue = _getAttribute(elm, attrName);
7965
+ var getAttribute = renderer.getAttribute;
7966
+ var elmAttrValue = getAttribute(elm, attrName);
7921
7967
 
7922
7968
  if (String(attrValue) !== elmAttrValue) {
7923
7969
  if (process.env.NODE_ENV !== 'production') {
7924
- var _getProperty4 = renderer.getProperty;
7925
- logError("Mismatch hydrating element <".concat(_getProperty4(elm, 'tagName').toLowerCase(), ">: attribute \"").concat(attrName, "\" has different values, expected \"").concat(attrValue, "\" but found \"").concat(elmAttrValue, "\""), owner);
7970
+ var getProperty = renderer.getProperty;
7971
+ logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"").concat(attrName, "\" has different values, expected \"").concat(attrValue, "\" but found \"").concat(elmAttrValue, "\""), owner);
7926
7972
  }
7927
7973
 
7928
7974
  nodesAreCompatible = false;
@@ -8033,8 +8079,8 @@
8033
8079
 
8034
8080
  if (!nodesAreCompatible) {
8035
8081
  if (process.env.NODE_ENV !== 'production') {
8036
- var _getProperty5 = renderer.getProperty;
8037
- logError("Mismatch hydrating element <".concat(_getProperty5(elm, 'tagName').toLowerCase(), ">: attribute \"style\" has different values, expected \"").concat(vnodeStyle, "\" but found \"").concat(elmStyle, "\"."), vnode.owner);
8082
+ var getProperty = renderer.getProperty;
8083
+ logError("Mismatch hydrating element <".concat(getProperty(elm, 'tagName').toLowerCase(), ">: attribute \"style\" has different values, expected \"").concat(vnodeStyle, "\" but found \"").concat(elmStyle, "\"."), vnode.owner);
8038
8084
  }
8039
8085
  }
8040
8086
 
@@ -8054,7 +8100,7 @@
8054
8100
  return false;
8055
8101
  }
8056
8102
 
8057
- return getProperty(client, 'nodeValue') === getProperty(ssr, 'nodeValue');
8103
+ return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
8058
8104
  }
8059
8105
 
8060
8106
  if (getProperty(client, 'nodeType') === 8
@@ -8066,7 +8112,7 @@
8066
8112
  return false;
8067
8113
  }
8068
8114
 
8069
- return getProperty(client, 'nodeValue') === getProperty(ssr, 'nodeValue');
8115
+ return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
8070
8116
  }
8071
8117
 
8072
8118
  if (!hasCorrectNodeType(vnode, ssr, 1
@@ -8266,7 +8312,7 @@
8266
8312
 
8267
8313
  return ctor;
8268
8314
  }
8269
- /* version: 2.23.0 */
8315
+ /* version: 2.23.3 */
8270
8316
 
8271
8317
  /*
8272
8318
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8433,361 +8479,395 @@
8433
8479
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8434
8480
  */
8435
8481
 
8482
+ /**
8483
+ * A factory function that produces a renderer.
8484
+ * Renderer encapsulates operations that are required to render an LWC component into the underlying
8485
+ * runtime environment. In the case of @lwc/enigne-dom, it is meant to be used in a DOM environment.
8486
+ * Example usage:
8487
+ * import { renderer, rendererFactory } from 'lwc';
8488
+ * const customRenderer = rendererFactory(renderer);
8489
+ *
8490
+ * @param baseRenderer Either null or the base renderer imported from 'lwc'.
8491
+ */
8436
8492
 
8437
- var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
8438
- var createFragment;
8439
8493
 
8440
- if (SUPPORTS_TEMPLATE) {
8441
- // Parse the fragment HTML string into DOM
8442
- createFragment = function createFragment(html) {
8443
- var template = document.createElement('template');
8444
- template.innerHTML = html;
8445
- return template.content.firstChild;
8446
- };
8447
- } else {
8448
- // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
8449
- // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
8450
- // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
8451
- // With other elements added from:
8452
- // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
8453
- // Using the test:
8454
- // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
8455
- // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
8456
- var topLevelWrappingMap = {
8457
- caption: ['table'],
8458
- col: ['colgroup', 'table'],
8459
- colgroup: ['table'],
8460
- option: ['select'],
8461
- tbody: ['table'],
8462
- td: ['tr', 'tbody', 'table'],
8463
- th: ['tr', 'tbody', 'table'],
8464
- thead: ['table'],
8465
- tfoot: ['table'],
8466
- tr: ['tbody', 'table']
8467
- }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
8468
-
8469
- var getTagName = function getTagName(text) {
8470
- return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
8471
- }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
8472
-
8473
-
8474
- createFragment = function createFragment(html) {
8475
- var wrapperTags = topLevelWrappingMap[getTagName(html)];
8476
-
8477
- if (!isUndefined$1(wrapperTags)) {
8478
- var _iterator5 = _createForOfIteratorHelper(wrapperTags),
8479
- _step5;
8494
+ function rendererFactory(baseRenderer) {
8495
+ // Util functions
8496
+ function assertInvariant(value, msg) {
8497
+ if (!value) {
8498
+ throw new Error("Invariant Violation: ".concat(msg));
8499
+ }
8500
+ }
8480
8501
 
8481
- try {
8482
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
8483
- var wrapperTag = _step5.value;
8484
- html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
8485
- }
8486
- } catch (err) {
8487
- _iterator5.e(err);
8488
- } finally {
8489
- _iterator5.f();
8490
- }
8491
- } // For IE11, the document title must not be undefined, but it can be an empty string
8492
- // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
8502
+ function isNull(obj) {
8503
+ return obj === null;
8504
+ }
8493
8505
 
8506
+ function isUndefined(obj) {
8507
+ return obj === undefined;
8508
+ }
8494
8509
 
8495
- var doc = document.implementation.createHTMLDocument('');
8496
- doc.body.innerHTML = html;
8497
- var content = doc.body;
8510
+ var getCustomElement;
8511
+ var defineCustomElement;
8512
+ var HTMLElementConstructor;
8498
8513
 
8499
- if (!isUndefined$1(wrapperTags)) {
8500
- for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
8501
- content = content.firstChild;
8502
- }
8514
+ function isCustomElementRegistryAvailable() {
8515
+ if (typeof customElements === 'undefined') {
8516
+ return false;
8503
8517
  }
8504
8518
 
8505
- return content.firstChild;
8506
- };
8507
- }
8508
- /*
8509
- * Copyright (c) 2018, salesforce.com, inc.
8510
- * All rights reserved.
8511
- * SPDX-License-Identifier: MIT
8512
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8513
- */
8519
+ try {
8520
+ // dereference HTMLElement global because babel wraps globals in compat mode with a
8521
+ // _wrapNativeSuper()
8522
+ // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
8523
+ // get wrapped by babel.
8524
+ var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
8525
+ // invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
8526
+ // which are not equipped to be initialized that way.
8514
8527
 
8528
+ var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
8529
+ _inherits(clazz, _HTMLElementAlias);
8515
8530
 
8516
- var getCustomElement;
8517
- var defineCustomElement;
8518
- var HTMLElementConstructor;
8531
+ var _super7 = _createSuper(clazz);
8519
8532
 
8520
- function isCustomElementRegistryAvailable() {
8521
- if (typeof customElements === 'undefined') {
8522
- return false;
8533
+ function clazz() {
8534
+ _classCallCheck(this, clazz);
8535
+
8536
+ return _super7.apply(this, arguments);
8537
+ }
8538
+
8539
+ return _createClass(clazz);
8540
+ }(HTMLElementAlias);
8541
+
8542
+ customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
8543
+ new clazz();
8544
+ return true;
8545
+ } catch (_a) {
8546
+ return false;
8547
+ }
8523
8548
  }
8524
8549
 
8525
- try {
8526
- // dereference HTMLElement global because babel wraps globals in compat mode with a
8527
- // _wrapNativeSuper()
8528
- // This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
8529
- // get wrapped by babel.
8530
- var HTMLElementAlias = HTMLElement; // In case we use compat mode with a modern browser, the compat mode transformation
8531
- // invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
8532
- // which are not equipped to be initialized that way.
8550
+ if (isCustomElementRegistryAvailable()) {
8551
+ getCustomElement = customElements.get.bind(customElements);
8552
+ defineCustomElement = customElements.define.bind(customElements);
8553
+ HTMLElementConstructor = HTMLElement;
8554
+ } else {
8555
+ var registry = Object.create(null);
8556
+ var reverseRegistry = new WeakMap();
8557
+
8558
+ defineCustomElement = function define(name, ctor) {
8559
+ if (name !== String.prototype.toLowerCase.call(name) || registry[name]) {
8560
+ throw new TypeError("Invalid Registration");
8561
+ }
8562
+
8563
+ registry[name] = ctor;
8564
+ reverseRegistry.set(ctor, name);
8565
+ };
8533
8566
 
8534
- var clazz = /*#__PURE__*/function (_HTMLElementAlias) {
8535
- _inherits(clazz, _HTMLElementAlias);
8567
+ getCustomElement = function get(name) {
8568
+ return registry[name];
8569
+ };
8536
8570
 
8537
- var _super7 = _createSuper(clazz);
8571
+ HTMLElementConstructor = function HTMLElement() {
8572
+ if (!(this instanceof HTMLElement)) {
8573
+ throw new TypeError("Invalid Invocation");
8574
+ }
8538
8575
 
8539
- function clazz() {
8540
- _classCallCheck(this, clazz);
8576
+ var constructor = this.constructor;
8577
+ var name = reverseRegistry.get(constructor);
8541
8578
 
8542
- return _super7.apply(this, arguments);
8579
+ if (!name) {
8580
+ throw new TypeError("Invalid Construction");
8543
8581
  }
8544
8582
 
8545
- return _createClass(clazz);
8546
- }(HTMLElementAlias);
8583
+ var elm = document.createElement(name);
8584
+ Object.setPrototypeOf(elm, constructor.prototype);
8585
+ return elm;
8586
+ };
8547
8587
 
8548
- customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
8549
- new clazz();
8550
- return true;
8551
- } catch (_a) {
8552
- return false;
8588
+ HTMLElementConstructor.prototype = HTMLElement.prototype;
8553
8589
  }
8554
- }
8555
8590
 
8556
- if (isCustomElementRegistryAvailable()) {
8557
- getCustomElement = customElements.get.bind(customElements);
8558
- defineCustomElement = customElements.define.bind(customElements);
8559
- HTMLElementConstructor = HTMLElement;
8560
- } else {
8561
- var registry = create(null);
8562
- var reverseRegistry = new WeakMap();
8591
+ function cloneNode(node, deep) {
8592
+ return node.cloneNode(deep);
8593
+ }
8563
8594
 
8564
- defineCustomElement = function define(name, ctor) {
8565
- if (name !== StringToLowerCase.call(name) || registry[name]) {
8566
- throw new TypeError("Invalid Registration");
8567
- }
8595
+ function createElement(tagName, namespace) {
8596
+ return isUndefined(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
8597
+ }
8568
8598
 
8569
- registry[name] = ctor;
8570
- reverseRegistry.set(ctor, name);
8571
- };
8599
+ function createText(content) {
8600
+ return document.createTextNode(content);
8601
+ }
8572
8602
 
8573
- getCustomElement = function get(name) {
8574
- return registry[name];
8575
- };
8603
+ function createComment(content) {
8604
+ return document.createComment(content);
8605
+ }
8576
8606
 
8577
- HTMLElementConstructor = function HTMLElement() {
8578
- if (!(this instanceof HTMLElement)) {
8579
- throw new TypeError("Invalid Invocation");
8580
- }
8607
+ var createFragment; // IE11 lacks support for this feature
8581
8608
 
8582
- var constructor = this.constructor;
8583
- var name = reverseRegistry.get(constructor);
8609
+ var SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
8584
8610
 
8585
- if (!name) {
8586
- throw new TypeError("Invalid Construction");
8587
- }
8611
+ if (SUPPORTS_TEMPLATE) {
8612
+ // Parse the fragment HTML string into DOM
8613
+ createFragment = function createFragment(html) {
8614
+ var template = document.createElement('template');
8615
+ template.innerHTML = html;
8616
+ return template.content.firstChild;
8617
+ };
8618
+ } else {
8619
+ // In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
8620
+ // <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
8621
+ // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
8622
+ // With other elements added from:
8623
+ // https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
8624
+ // Using the test:
8625
+ // document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
8626
+ // And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
8627
+ var topLevelWrappingMap = {
8628
+ caption: ['table'],
8629
+ col: ['colgroup', 'table'],
8630
+ colgroup: ['table'],
8631
+ option: ['select'],
8632
+ tbody: ['table'],
8633
+ td: ['tr', 'tbody', 'table'],
8634
+ th: ['tr', 'tbody', 'table'],
8635
+ thead: ['table'],
8636
+ tfoot: ['table'],
8637
+ tr: ['tbody', 'table']
8638
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
8639
+
8640
+ var getTagName = function getTagName(text) {
8641
+ return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
8642
+ }; // Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
8643
+
8644
+
8645
+ createFragment = function createFragment(html) {
8646
+ var wrapperTags = topLevelWrappingMap[getTagName(html)];
8647
+
8648
+ if (!isUndefined(wrapperTags)) {
8649
+ var _iterator5 = _createForOfIteratorHelper(wrapperTags),
8650
+ _step5;
8651
+
8652
+ try {
8653
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
8654
+ var wrapperTag = _step5.value;
8655
+ html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
8656
+ }
8657
+ } catch (err) {
8658
+ _iterator5.e(err);
8659
+ } finally {
8660
+ _iterator5.f();
8661
+ }
8662
+ } // For IE11, the document title must not be undefined, but it can be an empty string
8663
+ // https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
8588
8664
 
8589
- var elm = document.createElement(name);
8590
- setPrototypeOf(elm, constructor.prototype);
8591
- return elm;
8592
- };
8593
8665
 
8594
- HTMLElementConstructor.prototype = HTMLElement.prototype;
8595
- }
8666
+ var doc = document.implementation.createHTMLDocument('');
8667
+ doc.body.innerHTML = html;
8668
+ var content = doc.body;
8596
8669
 
8597
- var isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
8598
- var isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
8670
+ if (!isUndefined(wrapperTags)) {
8671
+ for (var _i32 = 0; _i32 < wrapperTags.length; _i32++) {
8672
+ content = content.firstChild;
8673
+ }
8674
+ }
8599
8675
 
8600
- function cloneNode(node, deep) {
8601
- return node.cloneNode(deep);
8602
- }
8676
+ return content.firstChild;
8677
+ };
8678
+ }
8603
8679
 
8604
- function createElement$1(tagName, namespace) {
8605
- return isUndefined$1(namespace) ? document.createElement(tagName) : document.createElementNS(namespace, tagName);
8606
- }
8680
+ function insert(node, parent, anchor) {
8681
+ parent.insertBefore(node, anchor);
8682
+ }
8607
8683
 
8608
- function createText(content) {
8609
- return document.createTextNode(content);
8610
- }
8684
+ function remove(node, parent) {
8685
+ parent.removeChild(node);
8686
+ }
8611
8687
 
8612
- function createComment(content) {
8613
- return document.createComment(content);
8614
- }
8688
+ function nextSibling(node) {
8689
+ return node.nextSibling;
8690
+ }
8615
8691
 
8616
- function insert(node, parent, anchor) {
8617
- parent.insertBefore(node, anchor);
8618
- }
8692
+ function attachShadow(element, options) {
8693
+ // `shadowRoot` will be non-null in two cases:
8694
+ // 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
8695
+ // 2. when a webapp author places <c-app> in their static HTML and mounts their
8696
+ // root component with customElement.define('c-app', Ctor)
8697
+ if (!isNull(element.shadowRoot)) {
8698
+ return element.shadowRoot;
8699
+ }
8619
8700
 
8620
- function remove(node, parent) {
8621
- parent.removeChild(node);
8622
- }
8701
+ return element.attachShadow(options);
8702
+ }
8623
8703
 
8624
- function nextSibling(node) {
8625
- return node.nextSibling;
8626
- }
8704
+ function setText(node, content) {
8705
+ node.nodeValue = content;
8706
+ }
8627
8707
 
8628
- function attachShadow(element, options) {
8629
- // `shadowRoot` will be non-null in two cases:
8630
- // 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
8631
- // 2. when a webapp author places <c-app> in their static HTML and mounts their
8632
- // root component with customElement.define('c-app', Ctor)
8633
- if (!isNull(element.shadowRoot)) {
8634
- return element.shadowRoot;
8708
+ function getProperty(node, key) {
8709
+ return node[key];
8635
8710
  }
8636
8711
 
8637
- return element.attachShadow(options);
8638
- }
8712
+ function setProperty(node, key, value) {
8713
+ node[key] = value;
8714
+ }
8639
8715
 
8640
- function setText(node, content) {
8641
- node.nodeValue = content;
8642
- }
8716
+ function getAttribute(element, name, namespace) {
8717
+ return isUndefined(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8718
+ }
8643
8719
 
8644
- function getProperty(node, key) {
8645
- return node[key];
8646
- }
8720
+ function setAttribute(element, name, value, namespace) {
8721
+ return isUndefined(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8722
+ }
8647
8723
 
8648
- function setProperty(node, key, value) {
8649
- if (process.env.NODE_ENV !== 'production') {
8650
- if (node instanceof Element && !(key in node)) {
8651
- // TODO [#1297]: Move this validation to the compiler
8652
- assert.fail("Unknown public property \"".concat(key, "\" of element <").concat(node.tagName, ">. This is likely a typo on the corresponding attribute \"").concat(htmlPropertyToAttribute(key), "\"."));
8724
+ function removeAttribute(element, name, namespace) {
8725
+ if (isUndefined(namespace)) {
8726
+ element.removeAttribute(name);
8727
+ } else {
8728
+ element.removeAttributeNS(namespace, name);
8653
8729
  }
8654
8730
  }
8655
8731
 
8656
- node[key] = value;
8657
- }
8732
+ function addEventListener(target, type, callback, options) {
8733
+ target.addEventListener(type, callback, options);
8734
+ }
8658
8735
 
8659
- function getAttribute(element, name, namespace) {
8660
- return isUndefined$1(namespace) ? element.getAttribute(name) : element.getAttributeNS(namespace, name);
8661
- }
8736
+ function removeEventListener(target, type, callback, options) {
8737
+ target.removeEventListener(type, callback, options);
8738
+ }
8662
8739
 
8663
- function setAttribute(element, name, value, namespace) {
8664
- return isUndefined$1(namespace) ? element.setAttribute(name, value) : element.setAttributeNS(namespace, name, value);
8665
- }
8740
+ function dispatchEvent(target, event) {
8741
+ return target.dispatchEvent(event);
8742
+ }
8666
8743
 
8667
- function removeAttribute(element, name, namespace) {
8668
- if (isUndefined$1(namespace)) {
8669
- element.removeAttribute(name);
8670
- } else {
8671
- element.removeAttributeNS(namespace, name);
8744
+ function getClassList(element) {
8745
+ return element.classList;
8672
8746
  }
8673
- }
8674
8747
 
8675
- function addEventListener(target, type, callback, options) {
8676
- target.addEventListener(type, callback, options);
8677
- }
8748
+ function setCSSStyleProperty(element, name, value, important) {
8749
+ // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8750
+ // represent elements in the engine?
8751
+ element.style.setProperty(name, value, important ? 'important' : '');
8752
+ }
8678
8753
 
8679
- function removeEventListener(target, type, callback, options) {
8680
- target.removeEventListener(type, callback, options);
8681
- }
8754
+ function getBoundingClientRect(element) {
8755
+ return element.getBoundingClientRect();
8756
+ }
8682
8757
 
8683
- function dispatchEvent(target, event) {
8684
- return target.dispatchEvent(event);
8685
- }
8758
+ function querySelector(element, selectors) {
8759
+ return element.querySelector(selectors);
8760
+ }
8686
8761
 
8687
- function getClassList(element) {
8688
- return element.classList;
8689
- }
8762
+ function querySelectorAll(element, selectors) {
8763
+ return element.querySelectorAll(selectors);
8764
+ }
8690
8765
 
8691
- function setCSSStyleProperty(element, name, value, important) {
8692
- // TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
8693
- // represent elements in the engine?
8694
- element.style.setProperty(name, value, important ? 'important' : '');
8695
- }
8766
+ function getElementsByTagName(element, tagNameOrWildCard) {
8767
+ return element.getElementsByTagName(tagNameOrWildCard);
8768
+ }
8696
8769
 
8697
- function getBoundingClientRect(element) {
8698
- return element.getBoundingClientRect();
8699
- }
8770
+ function getElementsByClassName(element, names) {
8771
+ return element.getElementsByClassName(names);
8772
+ }
8700
8773
 
8701
- function querySelector(element, selectors) {
8702
- return element.querySelector(selectors);
8703
- }
8774
+ function getChildren(element) {
8775
+ return element.children;
8776
+ }
8704
8777
 
8705
- function querySelectorAll(element, selectors) {
8706
- return element.querySelectorAll(selectors);
8707
- }
8778
+ function getChildNodes(element) {
8779
+ return element.childNodes;
8780
+ }
8708
8781
 
8709
- function getElementsByTagName(element, tagNameOrWildCard) {
8710
- return element.getElementsByTagName(tagNameOrWildCard);
8711
- }
8782
+ function getFirstChild(element) {
8783
+ return element.firstChild;
8784
+ }
8712
8785
 
8713
- function getElementsByClassName(element, names) {
8714
- return element.getElementsByClassName(names);
8715
- }
8786
+ function getFirstElementChild(element) {
8787
+ return element.firstElementChild;
8788
+ }
8716
8789
 
8717
- function getChildren(element) {
8718
- return element.children;
8719
- }
8790
+ function getLastChild(element) {
8791
+ return element.lastChild;
8792
+ }
8720
8793
 
8721
- function getChildNodes(element) {
8722
- return element.childNodes;
8723
- }
8794
+ function getLastElementChild(element) {
8795
+ return element.lastElementChild;
8796
+ }
8724
8797
 
8725
- function getFirstChild(element) {
8726
- return element.firstChild;
8727
- }
8798
+ function isConnected(node) {
8799
+ return node.isConnected;
8800
+ }
8728
8801
 
8729
- function getFirstElementChild(element) {
8730
- return element.firstElementChild;
8731
- }
8802
+ function assertInstanceOfHTMLElement(elm, msg) {
8803
+ assertInvariant(elm instanceof HTMLElement, msg);
8804
+ }
8732
8805
 
8733
- function getLastChild(element) {
8734
- return element.lastChild;
8735
- }
8806
+ var HTMLElementExported = HTMLElementConstructor;
8807
+ var renderer = {
8808
+ HTMLElementExported: HTMLElementExported,
8809
+ insert: insert,
8810
+ remove: remove,
8811
+ cloneNode: cloneNode,
8812
+ createFragment: createFragment,
8813
+ createElement: createElement,
8814
+ createText: createText,
8815
+ createComment: createComment,
8816
+ nextSibling: nextSibling,
8817
+ attachShadow: attachShadow,
8818
+ getProperty: getProperty,
8819
+ setProperty: setProperty,
8820
+ setText: setText,
8821
+ getAttribute: getAttribute,
8822
+ setAttribute: setAttribute,
8823
+ removeAttribute: removeAttribute,
8824
+ addEventListener: addEventListener,
8825
+ removeEventListener: removeEventListener,
8826
+ dispatchEvent: dispatchEvent,
8827
+ getClassList: getClassList,
8828
+ setCSSStyleProperty: setCSSStyleProperty,
8829
+ getBoundingClientRect: getBoundingClientRect,
8830
+ querySelector: querySelector,
8831
+ querySelectorAll: querySelectorAll,
8832
+ getElementsByTagName: getElementsByTagName,
8833
+ getElementsByClassName: getElementsByClassName,
8834
+ getChildren: getChildren,
8835
+ getChildNodes: getChildNodes,
8836
+ getFirstChild: getFirstChild,
8837
+ getFirstElementChild: getFirstElementChild,
8838
+ getLastChild: getLastChild,
8839
+ getLastElementChild: getLastElementChild,
8840
+ isConnected: isConnected,
8841
+ assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
8842
+ defineCustomElement: defineCustomElement,
8843
+ getCustomElement: getCustomElement
8844
+ }; // Meant to inherit any properties passed via the base renderer as the argument to the factory.
8736
8845
 
8737
- function getLastElementChild(element) {
8738
- return element.lastElementChild;
8846
+ Object.setPrototypeOf(renderer, baseRenderer);
8847
+ return renderer;
8739
8848
  }
8849
+ /*
8850
+ * Copyright (c) 2018, salesforce.com, inc.
8851
+ * All rights reserved.
8852
+ * SPDX-License-Identifier: MIT
8853
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8854
+ */
8740
8855
 
8741
- function isConnected(node) {
8742
- return node.isConnected;
8743
- }
8856
+ /**
8857
+ * The base renderer that will be used by engine-core.
8858
+ * This will be used for DOM operations when lwc is running in a browser environment.
8859
+ */
8744
8860
 
8745
- function assertInstanceOfHTMLElement(elm, msg) {
8746
- assert.invariant(elm instanceof HTMLElement, msg);
8747
- }
8748
8861
 
8749
- var HTMLElementExported = HTMLElementConstructor;
8750
- var renderer = {
8751
- isNativeShadowDefined: isNativeShadowDefined,
8752
- isSyntheticShadowDefined: isSyntheticShadowDefined,
8753
- HTMLElementExported: HTMLElementExported,
8754
- insert: insert,
8755
- remove: remove,
8756
- cloneNode: cloneNode,
8757
- createFragment: createFragment,
8758
- createElement: createElement$1,
8759
- createText: createText,
8760
- createComment: createComment,
8761
- nextSibling: nextSibling,
8762
- attachShadow: attachShadow,
8763
- getProperty: getProperty,
8764
- setProperty: setProperty,
8765
- setText: setText,
8766
- getAttribute: getAttribute,
8767
- setAttribute: setAttribute,
8768
- removeAttribute: removeAttribute,
8769
- addEventListener: addEventListener,
8770
- removeEventListener: removeEventListener,
8771
- dispatchEvent: dispatchEvent,
8772
- getClassList: getClassList,
8773
- setCSSStyleProperty: setCSSStyleProperty,
8774
- getBoundingClientRect: getBoundingClientRect,
8775
- querySelector: querySelector,
8776
- querySelectorAll: querySelectorAll,
8777
- getElementsByTagName: getElementsByTagName,
8778
- getElementsByClassName: getElementsByClassName,
8779
- getChildren: getChildren,
8780
- getChildNodes: getChildNodes,
8781
- getFirstChild: getFirstChild,
8782
- getFirstElementChild: getFirstElementChild,
8783
- getLastChild: getLastChild,
8784
- getLastElementChild: getLastElementChild,
8785
- isConnected: isConnected,
8862
+ var renderer = assign( // The base renderer will invoke the factory with null and assign additional properties that are
8863
+ // shared across renderers
8864
+ rendererFactory(null), // Properties that are either not required to be sandboxed or rely on a globally shared information
8865
+ {
8866
+ // insertStyleSheet implementation shares a global cache of stylesheet data
8786
8867
  insertStylesheet: insertStylesheet,
8787
- assertInstanceOfHTMLElement: assertInstanceOfHTMLElement,
8788
- defineCustomElement: defineCustomElement,
8789
- getCustomElement: getCustomElement
8790
- };
8868
+ isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
8869
+ isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN)
8870
+ });
8791
8871
  /*
8792
8872
  * Copyright (c) 2018, salesforce.com, inc.
8793
8873
  * All rights reserved.
@@ -8959,7 +9039,6 @@
8959
9039
  * SPDX-License-Identifier: MIT
8960
9040
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
8961
9041
  */
8962
- // TODO [#2472]: Remove this workaround when appropriate.
8963
9042
  // eslint-disable-next-line @lwc/lwc-internal/no-global-node
8964
9043
 
8965
9044
 
@@ -8979,39 +9058,41 @@
8979
9058
  }
8980
9059
 
8981
9060
  return node; // for convenience
8982
- } // Monkey patching Node methods to be able to detect the insertions and removal of root elements
8983
- // created via createElement.
8984
-
9061
+ }
8985
9062
 
8986
- var _Node$1$prototype = _Node$1.prototype,
8987
- _appendChild2 = _Node$1$prototype.appendChild,
8988
- _insertBefore2 = _Node$1$prototype.insertBefore,
8989
- _removeChild2 = _Node$1$prototype.removeChild,
8990
- _replaceChild2 = _Node$1$prototype.replaceChild;
8991
- assign(_Node$1.prototype, {
8992
- appendChild: function appendChild(newChild) {
8993
- var appendedNode = _appendChild2.call(this, newChild);
9063
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
9064
+ // Monkey patching Node methods to be able to detect the insertions and removal of root elements
9065
+ // created via createElement.
9066
+ var _Node$1$prototype = _Node$1.prototype,
9067
+ _appendChild = _Node$1$prototype.appendChild,
9068
+ _insertBefore = _Node$1$prototype.insertBefore,
9069
+ _removeChild = _Node$1$prototype.removeChild,
9070
+ _replaceChild = _Node$1$prototype.replaceChild;
9071
+ assign(_Node$1.prototype, {
9072
+ appendChild: function appendChild(newChild) {
9073
+ var appendedNode = _appendChild.call(this, newChild);
8994
9074
 
8995
- return callNodeSlot(appendedNode, ConnectingSlot);
8996
- },
8997
- insertBefore: function insertBefore(newChild, referenceNode) {
8998
- var insertedNode = _insertBefore2.call(this, newChild, referenceNode);
9075
+ return callNodeSlot(appendedNode, ConnectingSlot);
9076
+ },
9077
+ insertBefore: function insertBefore(newChild, referenceNode) {
9078
+ var insertedNode = _insertBefore.call(this, newChild, referenceNode);
8999
9079
 
9000
- return callNodeSlot(insertedNode, ConnectingSlot);
9001
- },
9002
- removeChild: function removeChild(oldChild) {
9003
- var removedNode = _removeChild2.call(this, oldChild);
9080
+ return callNodeSlot(insertedNode, ConnectingSlot);
9081
+ },
9082
+ removeChild: function removeChild(oldChild) {
9083
+ var removedNode = _removeChild.call(this, oldChild);
9004
9084
 
9005
- return callNodeSlot(removedNode, DisconnectingSlot);
9006
- },
9007
- replaceChild: function replaceChild(newChild, oldChild) {
9008
- var replacedNode = _replaceChild2.call(this, newChild, oldChild);
9085
+ return callNodeSlot(removedNode, DisconnectingSlot);
9086
+ },
9087
+ replaceChild: function replaceChild(newChild, oldChild) {
9088
+ var replacedNode = _replaceChild.call(this, newChild, oldChild);
9009
9089
 
9010
- callNodeSlot(replacedNode, DisconnectingSlot);
9011
- callNodeSlot(newChild, ConnectingSlot);
9012
- return replacedNode;
9013
- }
9014
- });
9090
+ callNodeSlot(replacedNode, DisconnectingSlot);
9091
+ callNodeSlot(newChild, ConnectingSlot);
9092
+ return replacedNode;
9093
+ }
9094
+ });
9095
+ }
9015
9096
  /**
9016
9097
  * EXPERIMENTAL: This function is almost identical to document.createElement with the slightly
9017
9098
  * difference that in the options, you can pass the `is` property set to a Constructor instead of
@@ -9024,6 +9105,7 @@
9024
9105
  * ```
9025
9106
  */
9026
9107
 
9108
+
9027
9109
  function createElement(sel, options) {
9028
9110
  if (!isObject(options) || isNull(options)) {
9029
9111
  throw new TypeError("\"createElement\" function expects an object as second parameter but received \"".concat(toString$1(options), "\"."));
@@ -9051,8 +9133,12 @@
9051
9133
  mode: options.mode !== 'closed' ? 'open' : 'closed',
9052
9134
  owner: null
9053
9135
  });
9054
- ConnectingSlot.set(elm, connectRootElement);
9055
- DisconnectingSlot.set(elm, disconnectRootElement);
9136
+
9137
+ if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
9138
+ ConnectingSlot.set(elm, connectRootElement);
9139
+ DisconnectingSlot.set(elm, disconnectRootElement);
9140
+ }
9141
+
9056
9142
  wasComponentUpgraded = true;
9057
9143
  });
9058
9144
 
@@ -9099,7 +9185,7 @@
9099
9185
  // inserted nodes without the `lwc:dom=manual` directive will be considered as global elements.
9100
9186
 
9101
9187
 
9102
- return isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
9188
+ return renderer.isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
9103
9189
  }
9104
9190
  /*
9105
9191
  * Copyright (c) 2018, salesforce.com, inc.
@@ -9143,7 +9229,7 @@
9143
9229
  });
9144
9230
  freeze(LightningElement);
9145
9231
  seal(LightningElement.prototype);
9146
- /* version: 2.23.0 */
9232
+ /* version: 2.23.3 */
9147
9233
 
9148
9234
  exports.LightningElement = LightningElement;
9149
9235
  exports.__unstable__ProfilerControl = profilerControl;
@@ -9165,6 +9251,7 @@
9165
9251
  exports.registerDecorators = registerDecorators;
9166
9252
  exports.registerTemplate = registerTemplate;
9167
9253
  exports.renderer = renderer;
9254
+ exports.rendererFactory = rendererFactory;
9168
9255
  exports.sanitizeAttribute = sanitizeAttribute;
9169
9256
  exports.setFeatureFlag = setFeatureFlag;
9170
9257
  exports.setFeatureFlagForTest = setFeatureFlagForTest;