@lwc/engine-core 2.40.1 → 2.40.2-lbc

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.
@@ -6400,9 +6400,19 @@ function hydrateElement(elm, vnode, renderer) {
6400
6400
  return elm;
6401
6401
  }
6402
6402
  function hydrateCustomElement(elm, vnode, renderer) {
6403
- if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
6404
- !isMatchingElement(vnode, elm, renderer)) {
6405
- return handleMismatch(elm, vnode, renderer);
6403
+ if (vnode.ctor.validationOptOut) {
6404
+ if (Array.isArray(vnode.ctor.validationOptOut)) {
6405
+ if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
6406
+ !isMatchingElement(vnode, elm, renderer, new Set(vnode.ctor.validationOptOut))) {
6407
+ return handleMismatch(elm, vnode, renderer);
6408
+ }
6409
+ }
6410
+ }
6411
+ else {
6412
+ if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
6413
+ !isMatchingElement(vnode, elm, renderer)) {
6414
+ return handleMismatch(elm, vnode, renderer);
6415
+ }
6406
6416
  }
6407
6417
  const { sel, mode, ctor, owner } = vnode;
6408
6418
  const vm = createVM(elm, ctor, renderer, {
@@ -6495,7 +6505,8 @@ function hasCorrectNodeType(vnode, node, nodeType, renderer) {
6495
6505
  }
6496
6506
  return true;
6497
6507
  }
6498
- function isMatchingElement(vnode, elm, renderer) {
6508
+ function isMatchingElement(vnode, elm, renderer, attrsToSkip) {
6509
+ var _a, _b;
6499
6510
  const { getProperty } = renderer;
6500
6511
  if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
6501
6512
  if (process.env.NODE_ENV !== 'production') {
@@ -6503,10 +6514,14 @@ function isMatchingElement(vnode, elm, renderer) {
6503
6514
  }
6504
6515
  return false;
6505
6516
  }
6506
- const hasIncompatibleAttrs = validateAttrs(vnode, elm, renderer);
6507
- const hasIncompatibleClass = validateClassAttr(vnode, elm, renderer);
6508
- const hasIncompatibleStyle = validateStyleAttr(vnode, elm, renderer);
6509
- return hasIncompatibleAttrs && hasIncompatibleClass && hasIncompatibleStyle;
6517
+ const hasCompatibleAttrs = validateAttrs(vnode, elm, renderer, attrsToSkip);
6518
+ const hasCompatibleClass = ((_a = attrsToSkip === null || attrsToSkip === void 0 ? void 0 : attrsToSkip.has) === null || _a === void 0 ? void 0 : _a.call(attrsToSkip, 'class'))
6519
+ ? true
6520
+ : validateClassAttr(vnode, elm, renderer);
6521
+ const hasCompatibleStyle = ((_b = attrsToSkip === null || attrsToSkip === void 0 ? void 0 : attrsToSkip.has) === null || _b === void 0 ? void 0 : _b.call(attrsToSkip, 'style'))
6522
+ ? true
6523
+ : validateStyleAttr(vnode, elm, renderer);
6524
+ return hasCompatibleAttrs && hasCompatibleClass && hasCompatibleStyle;
6510
6525
  }
6511
6526
  function attributeValuesAreEqual(vnodeValue, value) {
6512
6527
  const vnodeValueAsString = String(vnodeValue);
@@ -6521,12 +6536,16 @@ function attributeValuesAreEqual(vnodeValue, value) {
6521
6536
  // In all other cases, the two values are not considered equal
6522
6537
  return false;
6523
6538
  }
6524
- function validateAttrs(vnode, elm, renderer) {
6539
+ function validateAttrs(vnode, elm, renderer, attrsToSkip) {
6540
+ var _a;
6525
6541
  const { data: { attrs = {} }, } = vnode;
6526
6542
  let nodesAreCompatible = true;
6527
6543
  // Validate attributes, though we could always recovery from those by running the update mods.
6528
6544
  // Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
6529
6545
  for (const [attrName, attrValue] of Object.entries(attrs)) {
6546
+ if ((_a = attrsToSkip === null || attrsToSkip === void 0 ? void 0 : attrsToSkip.has) === null || _a === void 0 ? void 0 : _a.call(attrsToSkip, attrName)) {
6547
+ continue;
6548
+ }
6530
6549
  const { owner } = vnode;
6531
6550
  const { getAttribute } = renderer;
6532
6551
  const elmAttrValue = getAttribute(elm, attrName);
@@ -6950,5 +6969,5 @@ function readonly(obj) {
6950
6969
  }
6951
6970
 
6952
6971
  export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
6953
- /* version: 2.40.1 */
6972
+ /* version: 2.40.1-lbc */
6954
6973
  //# sourceMappingURL=engine-core.js.map