@lwc/engine-core 2.39.1 → 2.40.1-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.
- package/dist/engine-core.cjs.js +29 -10
- package/dist/engine-core.cjs.js.map +1 -1
- package/dist/engine-core.js +29 -10
- package/dist/engine-core.js.map +1 -1
- package/package.json +5 -5
- package/types/3rdparty/snabbdom/snabbdom.d.ts +11 -0
- package/types/3rdparty/snabbdom/types.d.ts +70 -0
- package/types/framework/accessor-reactive-observer.d.ts +9 -0
- package/types/framework/api-helpers.d.ts +15 -0
- package/types/framework/context-provider.d.ts +10 -0
- package/types/framework/context.d.ts +17 -0
- package/types/framework/hooks.d.ts +9 -0
- package/types/framework/modules/scope-token-class.d.ts +2 -0
- package/types/framework/performance-timing.d.ts +10 -0
- package/types/framework/upgradable-element.d.ts +7 -0
- package/types/framework/wiring.d.ts +28 -0
- package/types/renderer.d.ts +119 -0
- package/types/testFeatureFlag.d.ts +1 -0
package/dist/engine-core.cjs.js
CHANGED
|
@@ -6402,9 +6402,19 @@ function hydrateElement(elm, vnode, renderer) {
|
|
|
6402
6402
|
return elm;
|
|
6403
6403
|
}
|
|
6404
6404
|
function hydrateCustomElement(elm, vnode, renderer) {
|
|
6405
|
-
if (
|
|
6406
|
-
|
|
6407
|
-
|
|
6405
|
+
if (vnode.ctor.validationOptOut) {
|
|
6406
|
+
if (Array.isArray(vnode.ctor.validationOptOut)) {
|
|
6407
|
+
if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
|
|
6408
|
+
!isMatchingElement(vnode, elm, renderer, new Set(vnode.ctor.validationOptOut))) {
|
|
6409
|
+
return handleMismatch(elm, vnode, renderer);
|
|
6410
|
+
}
|
|
6411
|
+
}
|
|
6412
|
+
}
|
|
6413
|
+
else {
|
|
6414
|
+
if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
|
|
6415
|
+
!isMatchingElement(vnode, elm, renderer)) {
|
|
6416
|
+
return handleMismatch(elm, vnode, renderer);
|
|
6417
|
+
}
|
|
6408
6418
|
}
|
|
6409
6419
|
const { sel, mode, ctor, owner } = vnode;
|
|
6410
6420
|
const vm = createVM(elm, ctor, renderer, {
|
|
@@ -6497,7 +6507,8 @@ function hasCorrectNodeType(vnode, node, nodeType, renderer) {
|
|
|
6497
6507
|
}
|
|
6498
6508
|
return true;
|
|
6499
6509
|
}
|
|
6500
|
-
function isMatchingElement(vnode, elm, renderer) {
|
|
6510
|
+
function isMatchingElement(vnode, elm, renderer, attrsToSkip) {
|
|
6511
|
+
var _a, _b;
|
|
6501
6512
|
const { getProperty } = renderer;
|
|
6502
6513
|
if (vnode.sel.toLowerCase() !== getProperty(elm, 'tagName').toLowerCase()) {
|
|
6503
6514
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -6505,10 +6516,14 @@ function isMatchingElement(vnode, elm, renderer) {
|
|
|
6505
6516
|
}
|
|
6506
6517
|
return false;
|
|
6507
6518
|
}
|
|
6508
|
-
const
|
|
6509
|
-
const
|
|
6510
|
-
|
|
6511
|
-
|
|
6519
|
+
const hasCompatibleAttrs = validateAttrs(vnode, elm, renderer, attrsToSkip);
|
|
6520
|
+
const hasCompatibleClass = ((_a = attrsToSkip === null || attrsToSkip === void 0 ? void 0 : attrsToSkip.has) === null || _a === void 0 ? void 0 : _a.call(attrsToSkip, 'class'))
|
|
6521
|
+
? false
|
|
6522
|
+
: validateClassAttr(vnode, elm, renderer);
|
|
6523
|
+
const hasCompatibleStyle = ((_b = attrsToSkip === null || attrsToSkip === void 0 ? void 0 : attrsToSkip.has) === null || _b === void 0 ? void 0 : _b.call(attrsToSkip, 'style'))
|
|
6524
|
+
? false
|
|
6525
|
+
: validateStyleAttr(vnode, elm, renderer);
|
|
6526
|
+
return hasCompatibleAttrs && hasCompatibleClass && hasCompatibleStyle;
|
|
6512
6527
|
}
|
|
6513
6528
|
function attributeValuesAreEqual(vnodeValue, value) {
|
|
6514
6529
|
const vnodeValueAsString = String(vnodeValue);
|
|
@@ -6523,12 +6538,16 @@ function attributeValuesAreEqual(vnodeValue, value) {
|
|
|
6523
6538
|
// In all other cases, the two values are not considered equal
|
|
6524
6539
|
return false;
|
|
6525
6540
|
}
|
|
6526
|
-
function validateAttrs(vnode, elm, renderer) {
|
|
6541
|
+
function validateAttrs(vnode, elm, renderer, attrsToSkip) {
|
|
6542
|
+
var _a;
|
|
6527
6543
|
const { data: { attrs = {} }, } = vnode;
|
|
6528
6544
|
let nodesAreCompatible = true;
|
|
6529
6545
|
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
6530
6546
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
6531
6547
|
for (const [attrName, attrValue] of Object.entries(attrs)) {
|
|
6548
|
+
if ((_a = attrsToSkip === null || attrsToSkip === void 0 ? void 0 : attrsToSkip.has) === null || _a === void 0 ? void 0 : _a.call(attrsToSkip, attrName)) {
|
|
6549
|
+
continue;
|
|
6550
|
+
}
|
|
6532
6551
|
const { owner } = vnode;
|
|
6533
6552
|
const { getAttribute } = renderer;
|
|
6534
6553
|
const elmAttrValue = getAttribute(elm, attrName);
|
|
@@ -6989,5 +7008,5 @@ exports.swapTemplate = swapTemplate;
|
|
|
6989
7008
|
exports.track = track;
|
|
6990
7009
|
exports.unwrap = unwrap;
|
|
6991
7010
|
exports.wire = wire;
|
|
6992
|
-
/* version: 2.
|
|
7011
|
+
/* version: 2.40.1-lbc */
|
|
6993
7012
|
//# sourceMappingURL=engine-core.cjs.js.map
|