lwc 2.22.0 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +58 -114
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +58 -114
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +56 -112
  5. package/dist/engine-dom/iife/es5/engine-dom.js +61 -123
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +59 -121
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +58 -114
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +56 -112
  11. package/dist/engine-dom/umd/es5/engine-dom.js +61 -123
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +59 -121
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +54 -132
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +54 -132
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +13 -10
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +13 -10
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +13 -10
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +15 -14
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +15 -14
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +13 -10
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +13 -10
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +15 -14
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +15 -14
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  34. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  35. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  36. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  37. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  39. package/package.json +7 -7
@@ -415,9 +415,9 @@ function htmlEscape(str, attrMode = false) {
415
415
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
416
416
  */
417
417
  // Increment whenever the LWC template compiler changes
418
- const LWC_VERSION = "2.22.0";
418
+ const LWC_VERSION = "2.23.0";
419
419
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
420
- /** version: 2.22.0 */
420
+ /** version: 2.23.0 */
421
421
 
422
422
  /*
423
423
  * Copyright (c) 2020, salesforce.com, inc.
@@ -526,7 +526,7 @@ function setFeatureFlagForTest(name, value) {
526
526
  setFeatureFlag(name, value);
527
527
  }
528
528
  }
529
- /** version: 2.22.0 */
529
+ /** version: 2.23.0 */
530
530
 
531
531
  /* proxy-compat-disable */
532
532
 
@@ -1175,6 +1175,13 @@ function patchLightningElementPrototypeWithRestrictions(proto) {
1175
1175
  defineProperties(proto, getLightningElementPrototypeRestrictionsDescriptors(proto));
1176
1176
  }
1177
1177
 
1178
+ function updateComponentValue(vm, key, newValue) {
1179
+ const { cmpFields } = vm;
1180
+ if (newValue !== cmpFields[key]) {
1181
+ cmpFields[key] = newValue;
1182
+ }
1183
+ }
1184
+
1178
1185
  /**
1179
1186
  * Copyright (C) 2017 salesforce.com, inc.
1180
1187
  */
@@ -1799,9 +1806,7 @@ function createBridgeToElementDescriptor(propName, descriptor) {
1799
1806
  assert.isFalse(isBeingConstructed(vm), `Failed to construct '${getComponentTag(vm)}': The result must not have attributes.`);
1800
1807
  assert.invariant(!isObject(newValue) || isNull(newValue), `Invalid value "${newValue}" for "${propName}" of ${vm}. Value cannot be an object, must be a primitive value.`);
1801
1808
  }
1802
- if (newValue !== vm.cmpProps[propName]) {
1803
- vm.cmpProps[propName] = newValue;
1804
- }
1809
+ updateComponentValue(vm, propName, newValue);
1805
1810
  return set.call(vm.elm, newValue);
1806
1811
  },
1807
1812
  };
@@ -2094,9 +2099,7 @@ function createObservedFieldPropertyDescriptor(key) {
2094
2099
  },
2095
2100
  set(newValue) {
2096
2101
  const vm = getAssociatedVM(this);
2097
- if (newValue !== vm.cmpFields[key]) {
2098
- vm.cmpFields[key] = newValue;
2099
- }
2102
+ updateComponentValue(vm, key, newValue);
2100
2103
  },
2101
2104
  enumerable: true,
2102
2105
  configurable: true,
@@ -2258,9 +2261,7 @@ function internalTrackDecorator(key) {
2258
2261
  assert.invariant(!isUpdatingTemplate, `Updating the template of ${vmBeingRendered} has side effects on the state of ${vm}.${toString$1(key)}`);
2259
2262
  }
2260
2263
  const reactiveOrAnyValue = getReactiveProxy(newValue);
2261
- if (reactiveOrAnyValue !== vm.cmpFields[key]) {
2262
- vm.cmpFields[key] = reactiveOrAnyValue;
2263
- }
2264
+ updateComponentValue(vm, key, reactiveOrAnyValue);
2264
2265
  },
2265
2266
  enumerable: true,
2266
2267
  configurable: true,
@@ -2298,9 +2299,7 @@ function internalWireFieldDecorator(key) {
2298
2299
  * letting the author to do the wrong thing, but it will keep our
2299
2300
  * system to be backward compatible.
2300
2301
  */
2301
- if (value !== vm.cmpFields[key]) {
2302
- vm.cmpFields[key] = value;
2303
- }
2302
+ updateComponentValue(vm, key, value);
2304
2303
  },
2305
2304
  enumerable: true,
2306
2305
  configurable: true,
@@ -3258,38 +3257,20 @@ function getScopeTokenClass(owner) {
3258
3257
  const { cmpTemplate, context } = owner;
3259
3258
  return (context.hasScopedStyles && (cmpTemplate === null || cmpTemplate === void 0 ? void 0 : cmpTemplate.stylesheetToken)) || null;
3260
3259
  }
3261
- function getNearestNativeShadowComponent(vm) {
3262
- const owner = getNearestShadowComponent(vm);
3263
- if (!isNull(owner) && owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
3264
- // Synthetic-within-native is impossible. So if the nearest shadow component is
3265
- // synthetic, we know we won't find a native component if we go any further.
3266
- return null;
3267
- }
3268
- return owner;
3269
- }
3270
3260
  function createStylesheet(vm, stylesheets) {
3271
- const { renderMode, shadowMode, renderer: { ssr, insertStylesheet }, } = vm;
3261
+ const { renderMode, shadowMode, renderer: { insertStylesheet }, } = vm;
3272
3262
  if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
3273
3263
  for (let i = 0; i < stylesheets.length; i++) {
3274
3264
  insertStylesheet(stylesheets[i]);
3275
3265
  }
3276
3266
  }
3277
- else if (ssr || vm.hydrated) {
3267
+ else {
3278
3268
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
3279
3269
  // This works in the client, because the stylesheets are created, and cached in the VM
3280
3270
  // the first time the VM renders.
3281
3271
  // native shadow or light DOM, SSR
3282
3272
  return ArrayMap.call(stylesheets, createInlineStyleVNode);
3283
3273
  }
3284
- else {
3285
- // native shadow or light DOM, DOM renderer
3286
- const root = getNearestNativeShadowComponent(vm);
3287
- // null root means a global style
3288
- const target = isNull(root) ? undefined : root.shadowRoot;
3289
- for (let i = 0; i < stylesheets.length; i++) {
3290
- insertStylesheet(stylesheets[i], target);
3291
- }
3292
- }
3293
3274
  return null;
3294
3275
  }
3295
3276
 
@@ -3575,7 +3556,7 @@ function patchChildren(c1, c2, parent, renderer) {
3575
3556
  updateStaticChildren(c1, c2, parent, renderer);
3576
3557
  }
3577
3558
  }
3578
- function patch(n1, n2, renderer) {
3559
+ function patch(n1, n2, parent, renderer) {
3579
3560
  var _a, _b;
3580
3561
  if (n1 === n2) {
3581
3562
  return;
@@ -3604,7 +3585,7 @@ function patch(n1, n2, renderer) {
3604
3585
  patchElement(n1, n2, (_a = n2.data.renderer) !== null && _a !== void 0 ? _a : renderer);
3605
3586
  break;
3606
3587
  case 3 /* VNodeType.CustomElement */:
3607
- patchCustomElement(n1, n2, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
3588
+ patchCustomElement(n1, n2, parent, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
3608
3589
  break;
3609
3590
  }
3610
3591
  }
@@ -3731,22 +3712,32 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
3731
3712
  appendVM(vm);
3732
3713
  }
3733
3714
  }
3734
- function patchCustomElement(n1, n2, renderer) {
3735
- const elm = (n2.elm = n1.elm);
3736
- const vm = (n2.vm = n1.vm);
3737
- patchElementPropsAndAttrs$1(n1, n2, renderer);
3738
- if (!isUndefined$1(vm)) {
3739
- // in fallback mode, the allocation will always set children to
3740
- // empty and delegate the real allocation to the slot elements
3741
- allocateChildren(n2, vm);
3715
+ function patchCustomElement(n1, n2, parent, renderer) {
3716
+ if (n1.ctor !== n2.ctor) {
3717
+ // If the constructor, unmount the current component and mount a new one using the new
3718
+ // constructor.
3719
+ const anchor = renderer.nextSibling(n1.elm);
3720
+ unmount(n1, parent, renderer, true);
3721
+ mountCustomElement(n2, parent, anchor, renderer);
3742
3722
  }
3743
- // in fallback mode, the children will be always empty, so, nothing
3744
- // will happen, but in native, it does allocate the light dom
3745
- patchChildren(n1.children, n2.children, elm, renderer);
3746
- if (!isUndefined$1(vm)) {
3747
- // this will probably update the shadowRoot, but only if the vm is in a dirty state
3748
- // this is important to preserve the top to bottom synchronous rendering phase.
3749
- rerenderVM(vm);
3723
+ else {
3724
+ // Otherwise patch the existing component with new props/attrs/etc.
3725
+ const elm = (n2.elm = n1.elm);
3726
+ const vm = (n2.vm = n1.vm);
3727
+ patchElementPropsAndAttrs$1(n1, n2, renderer);
3728
+ if (!isUndefined$1(vm)) {
3729
+ // in fallback mode, the allocation will always set children to
3730
+ // empty and delegate the real allocation to the slot elements
3731
+ allocateChildren(n2, vm);
3732
+ }
3733
+ // in fallback mode, the children will be always empty, so, nothing
3734
+ // will happen, but in native, it does allocate the light dom
3735
+ patchChildren(n1.children, n2.children, elm, renderer);
3736
+ if (!isUndefined$1(vm)) {
3737
+ // this will probably update the shadowRoot, but only if the vm is in a dirty state
3738
+ // this is important to preserve the top to bottom synchronous rendering phase.
3739
+ rerenderVM(vm);
3740
+ }
3750
3741
  }
3751
3742
  }
3752
3743
  function mountVNodes(vnodes, parent, renderer, anchor, start = 0, end = vnodes.length) {
@@ -4016,25 +4007,25 @@ function updateDynamicChildren(oldCh, newCh, parent, renderer) {
4016
4007
  newEndVnode = newCh[--newEndIdx];
4017
4008
  }
4018
4009
  else if (isSameVnode(oldStartVnode, newStartVnode)) {
4019
- patch(oldStartVnode, newStartVnode, renderer);
4010
+ patch(oldStartVnode, newStartVnode, parent, renderer);
4020
4011
  oldStartVnode = oldCh[++oldStartIdx];
4021
4012
  newStartVnode = newCh[++newStartIdx];
4022
4013
  }
4023
4014
  else if (isSameVnode(oldEndVnode, newEndVnode)) {
4024
- patch(oldEndVnode, newEndVnode, renderer);
4015
+ patch(oldEndVnode, newEndVnode, parent, renderer);
4025
4016
  oldEndVnode = oldCh[--oldEndIdx];
4026
4017
  newEndVnode = newCh[--newEndIdx];
4027
4018
  }
4028
4019
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
4029
4020
  // Vnode moved right
4030
- patch(oldStartVnode, newEndVnode, renderer);
4021
+ patch(oldStartVnode, newEndVnode, parent, renderer);
4031
4022
  insertNode(oldStartVnode.elm, parent, renderer.nextSibling(oldEndVnode.elm), renderer);
4032
4023
  oldStartVnode = oldCh[++oldStartIdx];
4033
4024
  newEndVnode = newCh[--newEndIdx];
4034
4025
  }
4035
4026
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
4036
4027
  // Vnode moved left
4037
- patch(oldEndVnode, newStartVnode, renderer);
4028
+ patch(oldEndVnode, newStartVnode, parent, renderer);
4038
4029
  insertNode(newStartVnode.elm, parent, oldStartVnode.elm, renderer);
4039
4030
  oldEndVnode = oldCh[--oldEndIdx];
4040
4031
  newStartVnode = newCh[++newStartIdx];
@@ -4057,7 +4048,7 @@ function updateDynamicChildren(oldCh, newCh, parent, renderer) {
4057
4048
  mount(newStartVnode, parent, renderer, oldStartVnode.elm);
4058
4049
  }
4059
4050
  else {
4060
- patch(elmToMove, newStartVnode, renderer);
4051
+ patch(elmToMove, newStartVnode, parent, renderer);
4061
4052
  // Delete the old child, but copy the array since it is read-only.
4062
4053
  // The `oldCh` will be GC'ed after `updateDynamicChildren` is complete,
4063
4054
  // so we only care about the `oldCh` object inside this function.
@@ -4117,7 +4108,7 @@ function updateStaticChildren(c1, c2, parent, renderer) {
4117
4108
  if (isVNode(n1)) {
4118
4109
  if (isVNode(n2)) {
4119
4110
  // both vnodes are equivalent, and we just need to patch them
4120
- patch(n1, n2, renderer);
4111
+ patch(n1, n2, parent, renderer);
4121
4112
  anchor = n2.elm;
4122
4113
  }
4123
4114
  else {
@@ -4451,13 +4442,6 @@ function fid(url) {
4451
4442
  }
4452
4443
  return url;
4453
4444
  }
4454
- /**
4455
- * Map to store an index value assigned to any dynamic component reference ingested
4456
- * by dc() api. This allows us to generate a unique unique per template per dynamic
4457
- * component reference to avoid diffing algo mismatches.
4458
- */
4459
- const DynamicImportedComponentMap = new Map();
4460
- let dynamicImportedComponentCounter = 0;
4461
4445
  /**
4462
4446
  * create a dynamic component via `<x-foo lwc:dynamic={Ctor}>`
4463
4447
  */
@@ -4474,18 +4458,7 @@ function dc(sel, Ctor, data, children = EmptyArray) {
4474
4458
  if (!isComponentConstructor(Ctor)) {
4475
4459
  throw new Error(`Invalid LWC Constructor ${toString$1(Ctor)} for custom element <${sel}>.`);
4476
4460
  }
4477
- let idx = DynamicImportedComponentMap.get(Ctor);
4478
- if (isUndefined$1(idx)) {
4479
- idx = dynamicImportedComponentCounter++;
4480
- DynamicImportedComponentMap.set(Ctor, idx);
4481
- }
4482
- // the new vnode key is a mix of idx and compiler key, this is required by the diffing algo
4483
- // to identify different constructors as vnodes with different keys to avoid reusing the
4484
- // element used for previous constructors.
4485
- // Shallow clone is necessary here becuase VElementData may be shared across VNodes due to
4486
- // hoisting optimization.
4487
- const newData = Object.assign(Object.assign({}, data), { key: `dc:${idx}:${data.key}` });
4488
- return c(sel, Ctor, newData, children);
4461
+ return c(sel, Ctor, data, children);
4489
4462
  }
4490
4463
  /**
4491
4464
  * slow children collection marking mechanism. this API allows the compiler to signal
@@ -5321,46 +5294,7 @@ function patchShadowRoot(vm, newCh) {
5321
5294
 
5322
5295
  if (vm.state === 1
5323
5296
  /* VMState.connected */
5324
- ) {
5325
- // If the element is connected, that means connectedCallback was already issued, and
5326
- // any successive rendering should finish with the call to renderedCallback, otherwise
5327
- // the connectedCallback will take care of calling it in the right order at the end of
5328
- // the current rehydration process.
5329
- runRenderedCallback(vm);
5330
- }
5331
- }
5332
-
5333
- function runRenderedCallback(vm) {
5334
- const {
5335
- def: {
5336
- renderedCallback
5337
- },
5338
- renderer: {
5339
- ssr
5340
- }
5341
- } = vm;
5342
-
5343
- if (isTrue(ssr)) {
5344
- return;
5345
- }
5346
-
5347
- const {
5348
- rendered
5349
- } = Services;
5350
-
5351
- if (rendered) {
5352
- invokeServiceHook(vm, rendered);
5353
- }
5354
-
5355
- if (!isUndefined$1(renderedCallback)) {
5356
- logOperationStart(4
5357
- /* OperationId.RenderedCallback */
5358
- , vm);
5359
- invokeComponentCallback(vm, renderedCallback);
5360
- logOperationEnd(4
5361
- /* OperationId.RenderedCallback */
5362
- , vm);
5363
- }
5297
+ ) ;
5364
5298
  }
5365
5299
 
5366
5300
  function runConnectedCallback(vm) {
@@ -5627,14 +5561,8 @@ class WireContextRegistrationEvent extends CustomEvent {
5627
5561
  }
5628
5562
 
5629
5563
  function createFieldDataCallback(vm, name) {
5630
- const {
5631
- cmpFields
5632
- } = vm;
5633
5564
  return value => {
5634
- if (value !== vm.cmpFields[name]) {
5635
- // storing the value in the underlying storage
5636
- cmpFields[name] = value;
5637
- }
5565
+ updateComponentValue(vm, name, value);
5638
5566
  };
5639
5567
  }
5640
5568
 
@@ -6048,7 +5976,7 @@ function freezeTemplate(tmpl) {
6048
5976
  });
6049
5977
  }
6050
5978
  }
6051
- /* version: 2.22.0 */
5979
+ /* version: 2.23.0 */
6052
5980
 
6053
5981
  /*
6054
5982
  * Copyright (c) 2020, salesforce.com, inc.
@@ -6131,10 +6059,6 @@ class HTMLElementImpl {
6131
6059
  return createElement(tagName);
6132
6060
  }
6133
6061
  }
6134
- const ssr = true;
6135
- function isHydrating() {
6136
- return false;
6137
- }
6138
6062
  const isNativeShadowDefined = false;
6139
6063
  const isSyntheticShadowDefined = false;
6140
6064
  function insert(node, parent, anchor) {
@@ -6373,11 +6297,9 @@ const HTMLElementExported = HTMLElementImpl;
6373
6297
  /* noop */
6374
6298
  const assertInstanceOfHTMLElement = noop;
6375
6299
  const renderer = {
6376
- ssr,
6377
6300
  isNativeShadowDefined,
6378
6301
  isSyntheticShadowDefined,
6379
6302
  HTMLElementExported,
6380
- isHydrating,
6381
6303
  insert,
6382
6304
  remove,
6383
6305
  cloneNode,
@@ -6524,6 +6446,6 @@ function renderComponent(tagName, Ctor, props = {}) {
6524
6446
  */
6525
6447
  freeze(LightningElement);
6526
6448
  seal(LightningElement.prototype);
6527
- /* version: 2.22.0 */
6449
+ /* version: 2.23.0 */
6528
6450
 
6529
6451
  export { LightningElement, api$1 as api, createContextProvider, freezeTemplate, getComponentDef, isComponentConstructor, parseFragment, parseFragment as parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, renderComponent, renderer, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, track, unwrap, wire };
@@ -148,7 +148,7 @@ const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
148
148
  // We use this to detect symbol support in order to avoid the expensive symbol polyfill. Note that
149
149
  // we can't use typeof since it will fail when transpiling.
150
150
  const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === 'Symbol(x)')();
151
- /** version: 2.22.0 */
151
+ /** version: 2.23.0 */
152
152
 
153
153
  /*
154
154
  * Copyright (c) 2018, salesforce.com, inc.
@@ -299,7 +299,7 @@ const elementsFromPoint = hasOwnProperty.call(Document.prototype, 'elementsFromP
299
299
  // defaultView can be null when a document has no browsing context. For example, the owner document
300
300
  // of a node in a template doesn't have a default view: https://jsfiddle.net/hv9z0q5a/
301
301
  const defaultViewGetter = getOwnPropertyDescriptor(Document.prototype, 'defaultView').get;
302
- const { createComment, createTreeWalker, querySelectorAll, getElementById, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, } = Document.prototype;
302
+ const { createComment, querySelectorAll, getElementById, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, } = Document.prototype;
303
303
  // In Firefox v57 and lower, getElementsByName is defined on HTMLDocument.prototype
304
304
  // In all other browsers have the method on Document.prototype
305
305
  const { getElementsByName } = HTMLDocument.prototype;
@@ -1124,7 +1124,7 @@ if (!_globalThis.lwcRuntimeFlags) {
1124
1124
  Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
1125
1125
  }
1126
1126
  const runtimeFlags = _globalThis.lwcRuntimeFlags;
1127
- /** version: 2.22.0 */
1127
+ /** version: 2.23.0 */
1128
1128
 
1129
1129
  /*
1130
1130
  * Copyright (c) 2018, salesforce.com, inc.
@@ -4953,16 +4953,19 @@ defineProperty(Element.prototype, KEY__SHADOW_TOKEN, {
4953
4953
  },
4954
4954
  configurable: true,
4955
4955
  });
4956
+ function recursivelySetShadowResolver(node, fn) {
4957
+ node[KEY__SHADOW_RESOLVER] = fn;
4958
+ const childNodes = childNodesGetter.call(node);
4959
+ for (let i = 0, n = childNodes.length; i < n; i++) {
4960
+ recursivelySetShadowResolver(childNodes[i], fn);
4961
+ }
4962
+ }
4956
4963
  defineProperty(Element.prototype, KEY__SHADOW_STATIC, {
4957
4964
  set(v) {
4958
4965
  // Marking an element as static will propagate the shadow resolver to the children.
4959
- const fn = this[KEY__SHADOW_RESOLVER];
4960
4966
  if (v) {
4961
- const treeWalker = createTreeWalker.call(getOwnerDocument(this), this, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, () => NodeFilter.FILTER_ACCEPT, false);
4962
- let currentNode;
4963
- while ((currentNode = treeWalker.nextNode())) {
4964
- currentNode[KEY__SHADOW_RESOLVER] = fn;
4965
- }
4967
+ const fn = this[KEY__SHADOW_RESOLVER];
4968
+ recursivelySetShadowResolver(this, fn);
4966
4969
  }
4967
4970
  this[KEY__SHADOW_STATIC_PRIVATE] = v;
4968
4971
  },
@@ -5111,4 +5114,4 @@ if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
5111
5114
  }));
5112
5115
  });
5113
5116
  }
5114
- /** version: 2.22.0 */
5117
+ /** version: 2.23.0 */
@@ -151,7 +151,7 @@
151
151
  // We use this to detect symbol support in order to avoid the expensive symbol polyfill. Note that
152
152
  // we can't use typeof since it will fail when transpiling.
153
153
  const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === 'Symbol(x)')();
154
- /** version: 2.22.0 */
154
+ /** version: 2.23.0 */
155
155
 
156
156
  /*
157
157
  * Copyright (c) 2018, salesforce.com, inc.
@@ -302,7 +302,7 @@
302
302
  // defaultView can be null when a document has no browsing context. For example, the owner document
303
303
  // of a node in a template doesn't have a default view: https://jsfiddle.net/hv9z0q5a/
304
304
  const defaultViewGetter = getOwnPropertyDescriptor(Document.prototype, 'defaultView').get;
305
- const { createComment, createTreeWalker, querySelectorAll, getElementById, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, } = Document.prototype;
305
+ const { createComment, querySelectorAll, getElementById, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, } = Document.prototype;
306
306
  // In Firefox v57 and lower, getElementsByName is defined on HTMLDocument.prototype
307
307
  // In all other browsers have the method on Document.prototype
308
308
  const { getElementsByName } = HTMLDocument.prototype;
@@ -1127,7 +1127,7 @@
1127
1127
  Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
1128
1128
  }
1129
1129
  const runtimeFlags = _globalThis.lwcRuntimeFlags;
1130
- /** version: 2.22.0 */
1130
+ /** version: 2.23.0 */
1131
1131
 
1132
1132
  /*
1133
1133
  * Copyright (c) 2018, salesforce.com, inc.
@@ -4956,16 +4956,19 @@
4956
4956
  },
4957
4957
  configurable: true,
4958
4958
  });
4959
+ function recursivelySetShadowResolver(node, fn) {
4960
+ node[KEY__SHADOW_RESOLVER] = fn;
4961
+ const childNodes = childNodesGetter.call(node);
4962
+ for (let i = 0, n = childNodes.length; i < n; i++) {
4963
+ recursivelySetShadowResolver(childNodes[i], fn);
4964
+ }
4965
+ }
4959
4966
  defineProperty(Element.prototype, KEY__SHADOW_STATIC, {
4960
4967
  set(v) {
4961
4968
  // Marking an element as static will propagate the shadow resolver to the children.
4962
- const fn = this[KEY__SHADOW_RESOLVER];
4963
4969
  if (v) {
4964
- const treeWalker = createTreeWalker.call(getOwnerDocument(this), this, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT, () => NodeFilter.FILTER_ACCEPT, false);
4965
- let currentNode;
4966
- while ((currentNode = treeWalker.nextNode())) {
4967
- currentNode[KEY__SHADOW_RESOLVER] = fn;
4968
- }
4970
+ const fn = this[KEY__SHADOW_RESOLVER];
4971
+ recursivelySetShadowResolver(this, fn);
4969
4972
  }
4970
4973
  this[KEY__SHADOW_STATIC_PRIVATE] = v;
4971
4974
  },
@@ -5114,6 +5117,6 @@
5114
5117
  }));
5115
5118
  });
5116
5119
  }
5117
- /** version: 2.22.0 */
5120
+ /** version: 2.23.0 */
5118
5121
 
5119
5122
  })();