@vue/runtime-dom 3.4.0-alpha.4 → 3.4.0-beta.1
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/runtime-dom.cjs.js +22 -10
- package/dist/runtime-dom.cjs.prod.js +21 -9
- package/dist/runtime-dom.d.ts +2 -1
- package/dist/runtime-dom.esm-browser.js +421 -241
- package/dist/runtime-dom.esm-browser.prod.js +5 -5
- package/dist/runtime-dom.esm-bundler.js +23 -11
- package/dist/runtime-dom.global.js +421 -241
- package/dist/runtime-dom.global.prod.js +5 -5
- package/package.json +4 -4
|
@@ -127,6 +127,20 @@ function parseStringStyle(cssText) {
|
|
|
127
127
|
});
|
|
128
128
|
return ret;
|
|
129
129
|
}
|
|
130
|
+
function stringifyStyle(styles) {
|
|
131
|
+
let ret = "";
|
|
132
|
+
if (!styles || isString(styles)) {
|
|
133
|
+
return ret;
|
|
134
|
+
}
|
|
135
|
+
for (const key in styles) {
|
|
136
|
+
const value = styles[key];
|
|
137
|
+
const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
|
|
138
|
+
if (isString(value) || typeof value === "number") {
|
|
139
|
+
ret += `${normalizedKey}:${value};`;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return ret;
|
|
143
|
+
}
|
|
130
144
|
function normalizeClass(value) {
|
|
131
145
|
let res = "";
|
|
132
146
|
if (isString(value)) {
|
|
@@ -162,14 +176,25 @@ function normalizeProps(props) {
|
|
|
162
176
|
|
|
163
177
|
const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
|
|
164
178
|
const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
|
|
179
|
+
const MATH_TAGS = "math,maction,annotation,annotation-xml,menclose,merror,mfenced,mfrac,mi,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,semantics,mspace,msqrt,mstyle,msub,msup,msubsup,mtable,mtd,mtext,mtr,munder,munderover";
|
|
165
180
|
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
|
166
181
|
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
|
182
|
+
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
167
183
|
|
|
168
184
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
169
185
|
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
|
186
|
+
const isBooleanAttr = /* @__PURE__ */ makeMap(
|
|
187
|
+
specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
|
|
188
|
+
);
|
|
170
189
|
function includeBooleanAttr(value) {
|
|
171
190
|
return !!value || value === "";
|
|
172
191
|
}
|
|
192
|
+
const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
|
|
193
|
+
`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
|
|
194
|
+
);
|
|
195
|
+
const isKnownSvgAttr = /* @__PURE__ */ makeMap(
|
|
196
|
+
`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
|
|
197
|
+
);
|
|
173
198
|
|
|
174
199
|
function looseCompareArrays(a, b) {
|
|
175
200
|
if (a.length !== b.length)
|
|
@@ -231,20 +256,29 @@ const replacer = (_key, val) => {
|
|
|
231
256
|
return replacer(_key, val.value);
|
|
232
257
|
} else if (isMap(val)) {
|
|
233
258
|
return {
|
|
234
|
-
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
235
|
-
entries[
|
|
236
|
-
|
|
237
|
-
|
|
259
|
+
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
260
|
+
(entries, [key, val2], i) => {
|
|
261
|
+
entries[stringifySymbol(key, i) + " =>"] = val2;
|
|
262
|
+
return entries;
|
|
263
|
+
},
|
|
264
|
+
{}
|
|
265
|
+
)
|
|
238
266
|
};
|
|
239
267
|
} else if (isSet(val)) {
|
|
240
268
|
return {
|
|
241
|
-
[`Set(${val.size})`]: [...val.values()]
|
|
269
|
+
[`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
|
|
242
270
|
};
|
|
271
|
+
} else if (isSymbol(val)) {
|
|
272
|
+
return stringifySymbol(val);
|
|
243
273
|
} else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
|
|
244
274
|
return String(val);
|
|
245
275
|
}
|
|
246
276
|
return val;
|
|
247
277
|
};
|
|
278
|
+
const stringifySymbol = (v, i = "") => {
|
|
279
|
+
var _a;
|
|
280
|
+
return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
|
|
281
|
+
};
|
|
248
282
|
|
|
249
283
|
function warn$1(msg, ...args) {
|
|
250
284
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
@@ -693,8 +727,13 @@ class BaseReactiveHandler {
|
|
|
693
727
|
return isReadonly2;
|
|
694
728
|
} else if (key === "__v_isShallow") {
|
|
695
729
|
return shallow;
|
|
696
|
-
} else if (key === "__v_raw"
|
|
697
|
-
|
|
730
|
+
} else if (key === "__v_raw") {
|
|
731
|
+
if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
|
|
732
|
+
// this means the reciever is a user proxy of the reactive proxy
|
|
733
|
+
Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
|
|
734
|
+
return target;
|
|
735
|
+
}
|
|
736
|
+
return;
|
|
698
737
|
}
|
|
699
738
|
const targetIsArray = isArray(target);
|
|
700
739
|
if (!isReadonly2) {
|
|
@@ -730,17 +769,19 @@ class MutableReactiveHandler extends BaseReactiveHandler {
|
|
|
730
769
|
}
|
|
731
770
|
set(target, key, value, receiver) {
|
|
732
771
|
let oldValue = target[key];
|
|
733
|
-
if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
|
|
734
|
-
return false;
|
|
735
|
-
}
|
|
736
772
|
if (!this._shallow) {
|
|
773
|
+
const isOldValueReadonly = isReadonly(oldValue);
|
|
737
774
|
if (!isShallow(value) && !isReadonly(value)) {
|
|
738
775
|
oldValue = toRaw(oldValue);
|
|
739
776
|
value = toRaw(value);
|
|
740
777
|
}
|
|
741
778
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
742
|
-
|
|
743
|
-
|
|
779
|
+
if (isOldValueReadonly) {
|
|
780
|
+
return false;
|
|
781
|
+
} else {
|
|
782
|
+
oldValue.value = value;
|
|
783
|
+
return true;
|
|
784
|
+
}
|
|
744
785
|
}
|
|
745
786
|
}
|
|
746
787
|
const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
|
|
@@ -1762,13 +1803,16 @@ function queuePostFlushCb(cb) {
|
|
|
1762
1803
|
}
|
|
1763
1804
|
queueFlush();
|
|
1764
1805
|
}
|
|
1765
|
-
function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
1806
|
+
function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
1766
1807
|
{
|
|
1767
1808
|
seen = seen || /* @__PURE__ */ new Map();
|
|
1768
1809
|
}
|
|
1769
1810
|
for (; i < queue.length; i++) {
|
|
1770
1811
|
const cb = queue[i];
|
|
1771
1812
|
if (cb && cb.pre) {
|
|
1813
|
+
if (instance && cb.id !== instance.uid) {
|
|
1814
|
+
continue;
|
|
1815
|
+
}
|
|
1772
1816
|
if (checkRecursiveUpdates(seen, cb)) {
|
|
1773
1817
|
continue;
|
|
1774
1818
|
}
|
|
@@ -2528,9 +2572,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
2528
2572
|
return false;
|
|
2529
2573
|
}
|
|
2530
2574
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
2531
|
-
while (parent
|
|
2532
|
-
|
|
2533
|
-
|
|
2575
|
+
while (parent) {
|
|
2576
|
+
const root = parent.subTree;
|
|
2577
|
+
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
2578
|
+
root.el = vnode.el;
|
|
2579
|
+
}
|
|
2580
|
+
if (root === vnode) {
|
|
2581
|
+
(vnode = parent.vnode).el = el;
|
|
2582
|
+
parent = parent.parent;
|
|
2583
|
+
} else {
|
|
2584
|
+
break;
|
|
2585
|
+
}
|
|
2534
2586
|
}
|
|
2535
2587
|
}
|
|
2536
2588
|
|
|
@@ -2590,6 +2642,7 @@ function resolve(registry, name) {
|
|
|
2590
2642
|
}
|
|
2591
2643
|
|
|
2592
2644
|
const isSuspense = (type) => type.__isSuspense;
|
|
2645
|
+
let suspenseId = 0;
|
|
2593
2646
|
const SuspenseImpl = {
|
|
2594
2647
|
name: "Suspense",
|
|
2595
2648
|
// In order to make Suspense tree-shakable, we need to avoid importing it
|
|
@@ -2597,7 +2650,7 @@ const SuspenseImpl = {
|
|
|
2597
2650
|
// on a vnode's type and calls the `process` method, passing in renderer
|
|
2598
2651
|
// internals.
|
|
2599
2652
|
__isSuspense: true,
|
|
2600
|
-
process(n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
2653
|
+
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
2601
2654
|
if (n1 == null) {
|
|
2602
2655
|
mountSuspense(
|
|
2603
2656
|
n2,
|
|
@@ -2605,7 +2658,7 @@ const SuspenseImpl = {
|
|
|
2605
2658
|
anchor,
|
|
2606
2659
|
parentComponent,
|
|
2607
2660
|
parentSuspense,
|
|
2608
|
-
|
|
2661
|
+
namespace,
|
|
2609
2662
|
slotScopeIds,
|
|
2610
2663
|
optimized,
|
|
2611
2664
|
rendererInternals
|
|
@@ -2617,7 +2670,7 @@ const SuspenseImpl = {
|
|
|
2617
2670
|
container,
|
|
2618
2671
|
anchor,
|
|
2619
2672
|
parentComponent,
|
|
2620
|
-
|
|
2673
|
+
namespace,
|
|
2621
2674
|
slotScopeIds,
|
|
2622
2675
|
optimized,
|
|
2623
2676
|
rendererInternals
|
|
@@ -2635,7 +2688,7 @@ function triggerEvent(vnode, name) {
|
|
|
2635
2688
|
eventListener();
|
|
2636
2689
|
}
|
|
2637
2690
|
}
|
|
2638
|
-
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense,
|
|
2691
|
+
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
2639
2692
|
const {
|
|
2640
2693
|
p: patch,
|
|
2641
2694
|
o: { createElement }
|
|
@@ -2648,7 +2701,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
2648
2701
|
container,
|
|
2649
2702
|
hiddenContainer,
|
|
2650
2703
|
anchor,
|
|
2651
|
-
|
|
2704
|
+
namespace,
|
|
2652
2705
|
slotScopeIds,
|
|
2653
2706
|
optimized,
|
|
2654
2707
|
rendererInternals
|
|
@@ -2660,7 +2713,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
2660
2713
|
null,
|
|
2661
2714
|
parentComponent,
|
|
2662
2715
|
suspense,
|
|
2663
|
-
|
|
2716
|
+
namespace,
|
|
2664
2717
|
slotScopeIds
|
|
2665
2718
|
);
|
|
2666
2719
|
if (suspense.deps > 0) {
|
|
@@ -2674,7 +2727,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
2674
2727
|
parentComponent,
|
|
2675
2728
|
null,
|
|
2676
2729
|
// fallback tree will not have suspense context
|
|
2677
|
-
|
|
2730
|
+
namespace,
|
|
2678
2731
|
slotScopeIds
|
|
2679
2732
|
);
|
|
2680
2733
|
setActiveBranch(suspense, vnode.ssFallback);
|
|
@@ -2682,7 +2735,7 @@ function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense
|
|
|
2682
2735
|
suspense.resolve(false, true);
|
|
2683
2736
|
}
|
|
2684
2737
|
}
|
|
2685
|
-
function patchSuspense(n1, n2, container, anchor, parentComponent,
|
|
2738
|
+
function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch, um: unmount, o: { createElement } }) {
|
|
2686
2739
|
const suspense = n2.suspense = n1.suspense;
|
|
2687
2740
|
suspense.vnode = n2;
|
|
2688
2741
|
n2.el = n1.el;
|
|
@@ -2699,29 +2752,31 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2699
2752
|
null,
|
|
2700
2753
|
parentComponent,
|
|
2701
2754
|
suspense,
|
|
2702
|
-
|
|
2755
|
+
namespace,
|
|
2703
2756
|
slotScopeIds,
|
|
2704
2757
|
optimized
|
|
2705
2758
|
);
|
|
2706
2759
|
if (suspense.deps <= 0) {
|
|
2707
2760
|
suspense.resolve();
|
|
2708
2761
|
} else if (isInFallback) {
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2762
|
+
if (!isHydrating) {
|
|
2763
|
+
patch(
|
|
2764
|
+
activeBranch,
|
|
2765
|
+
newFallback,
|
|
2766
|
+
container,
|
|
2767
|
+
anchor,
|
|
2768
|
+
parentComponent,
|
|
2769
|
+
null,
|
|
2770
|
+
// fallback tree will not have suspense context
|
|
2771
|
+
namespace,
|
|
2772
|
+
slotScopeIds,
|
|
2773
|
+
optimized
|
|
2774
|
+
);
|
|
2775
|
+
setActiveBranch(suspense, newFallback);
|
|
2776
|
+
}
|
|
2722
2777
|
}
|
|
2723
2778
|
} else {
|
|
2724
|
-
suspense.pendingId++;
|
|
2779
|
+
suspense.pendingId = suspenseId++;
|
|
2725
2780
|
if (isHydrating) {
|
|
2726
2781
|
suspense.isHydrating = false;
|
|
2727
2782
|
suspense.activeBranch = pendingBranch;
|
|
@@ -2739,7 +2794,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2739
2794
|
null,
|
|
2740
2795
|
parentComponent,
|
|
2741
2796
|
suspense,
|
|
2742
|
-
|
|
2797
|
+
namespace,
|
|
2743
2798
|
slotScopeIds,
|
|
2744
2799
|
optimized
|
|
2745
2800
|
);
|
|
@@ -2754,7 +2809,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2754
2809
|
parentComponent,
|
|
2755
2810
|
null,
|
|
2756
2811
|
// fallback tree will not have suspense context
|
|
2757
|
-
|
|
2812
|
+
namespace,
|
|
2758
2813
|
slotScopeIds,
|
|
2759
2814
|
optimized
|
|
2760
2815
|
);
|
|
@@ -2768,7 +2823,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2768
2823
|
anchor,
|
|
2769
2824
|
parentComponent,
|
|
2770
2825
|
suspense,
|
|
2771
|
-
|
|
2826
|
+
namespace,
|
|
2772
2827
|
slotScopeIds,
|
|
2773
2828
|
optimized
|
|
2774
2829
|
);
|
|
@@ -2781,7 +2836,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2781
2836
|
null,
|
|
2782
2837
|
parentComponent,
|
|
2783
2838
|
suspense,
|
|
2784
|
-
|
|
2839
|
+
namespace,
|
|
2785
2840
|
slotScopeIds,
|
|
2786
2841
|
optimized
|
|
2787
2842
|
);
|
|
@@ -2799,7 +2854,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2799
2854
|
anchor,
|
|
2800
2855
|
parentComponent,
|
|
2801
2856
|
suspense,
|
|
2802
|
-
|
|
2857
|
+
namespace,
|
|
2803
2858
|
slotScopeIds,
|
|
2804
2859
|
optimized
|
|
2805
2860
|
);
|
|
@@ -2807,7 +2862,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2807
2862
|
} else {
|
|
2808
2863
|
triggerEvent(n2, "onPending");
|
|
2809
2864
|
suspense.pendingBranch = newBranch;
|
|
2810
|
-
|
|
2865
|
+
if (newBranch.shapeFlag & 512) {
|
|
2866
|
+
suspense.pendingId = newBranch.component.suspenseId;
|
|
2867
|
+
} else {
|
|
2868
|
+
suspense.pendingId = suspenseId++;
|
|
2869
|
+
}
|
|
2811
2870
|
patch(
|
|
2812
2871
|
null,
|
|
2813
2872
|
newBranch,
|
|
@@ -2815,7 +2874,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2815
2874
|
null,
|
|
2816
2875
|
parentComponent,
|
|
2817
2876
|
suspense,
|
|
2818
|
-
|
|
2877
|
+
namespace,
|
|
2819
2878
|
slotScopeIds,
|
|
2820
2879
|
optimized
|
|
2821
2880
|
);
|
|
@@ -2837,7 +2896,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
2837
2896
|
}
|
|
2838
2897
|
}
|
|
2839
2898
|
let hasWarned = false;
|
|
2840
|
-
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor,
|
|
2899
|
+
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
|
|
2841
2900
|
if (!hasWarned) {
|
|
2842
2901
|
hasWarned = true;
|
|
2843
2902
|
console[console.info ? "info" : "log"](
|
|
@@ -2867,7 +2926,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2867
2926
|
vnode,
|
|
2868
2927
|
parent: parentSuspense,
|
|
2869
2928
|
parentComponent,
|
|
2870
|
-
|
|
2929
|
+
namespace,
|
|
2871
2930
|
container,
|
|
2872
2931
|
hiddenContainer,
|
|
2873
2932
|
anchor,
|
|
@@ -2876,7 +2935,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2876
2935
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
2877
2936
|
activeBranch: null,
|
|
2878
2937
|
pendingBranch: null,
|
|
2879
|
-
isInFallback:
|
|
2938
|
+
isInFallback: !isHydrating,
|
|
2880
2939
|
isHydrating,
|
|
2881
2940
|
isUnmounted: false,
|
|
2882
2941
|
effects: [],
|
|
@@ -2960,8 +3019,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2960
3019
|
if (!suspense.pendingBranch) {
|
|
2961
3020
|
return;
|
|
2962
3021
|
}
|
|
2963
|
-
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2,
|
|
3022
|
+
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
|
|
2964
3023
|
triggerEvent(vnode2, "onFallback");
|
|
3024
|
+
const anchor2 = next(activeBranch);
|
|
2965
3025
|
const mountFallback = () => {
|
|
2966
3026
|
if (!suspense.isInFallback) {
|
|
2967
3027
|
return;
|
|
@@ -2970,11 +3030,11 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2970
3030
|
null,
|
|
2971
3031
|
fallbackVNode,
|
|
2972
3032
|
container2,
|
|
2973
|
-
|
|
3033
|
+
anchor2,
|
|
2974
3034
|
parentComponent2,
|
|
2975
3035
|
null,
|
|
2976
3036
|
// fallback tree will not have suspense context
|
|
2977
|
-
|
|
3037
|
+
namespace2,
|
|
2978
3038
|
slotScopeIds,
|
|
2979
3039
|
optimized
|
|
2980
3040
|
);
|
|
@@ -3037,7 +3097,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3037
3097
|
// consider the comment placeholder case.
|
|
3038
3098
|
hydratedEl ? null : next(instance.subTree),
|
|
3039
3099
|
suspense,
|
|
3040
|
-
|
|
3100
|
+
namespace,
|
|
3041
3101
|
optimized
|
|
3042
3102
|
);
|
|
3043
3103
|
if (placeholder) {
|
|
@@ -3074,7 +3134,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3074
3134
|
};
|
|
3075
3135
|
return suspense;
|
|
3076
3136
|
}
|
|
3077
|
-
function hydrateSuspense(node, vnode, parentComponent, parentSuspense,
|
|
3137
|
+
function hydrateSuspense(node, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
|
|
3078
3138
|
const suspense = vnode.suspense = createSuspenseBoundary(
|
|
3079
3139
|
vnode,
|
|
3080
3140
|
parentSuspense,
|
|
@@ -3082,7 +3142,7 @@ function hydrateSuspense(node, vnode, parentComponent, parentSuspense, isSVG, sl
|
|
|
3082
3142
|
node.parentNode,
|
|
3083
3143
|
document.createElement("div"),
|
|
3084
3144
|
null,
|
|
3085
|
-
|
|
3145
|
+
namespace,
|
|
3086
3146
|
slotScopeIds,
|
|
3087
3147
|
optimized,
|
|
3088
3148
|
rendererInternals,
|
|
@@ -3970,7 +4030,7 @@ const KeepAliveImpl = {
|
|
|
3970
4030
|
}
|
|
3971
4031
|
} = sharedContext;
|
|
3972
4032
|
const storageContainer = createElement("div");
|
|
3973
|
-
sharedContext.activate = (vnode, container, anchor,
|
|
4033
|
+
sharedContext.activate = (vnode, container, anchor, namespace, optimized) => {
|
|
3974
4034
|
const instance2 = vnode.component;
|
|
3975
4035
|
move(vnode, container, anchor, 0, parentSuspense);
|
|
3976
4036
|
patch(
|
|
@@ -3980,7 +4040,7 @@ const KeepAliveImpl = {
|
|
|
3980
4040
|
anchor,
|
|
3981
4041
|
instance2,
|
|
3982
4042
|
parentSuspense,
|
|
3983
|
-
|
|
4043
|
+
namespace,
|
|
3984
4044
|
vnode.slotScopeIds,
|
|
3985
4045
|
optimized
|
|
3986
4046
|
);
|
|
@@ -4646,7 +4706,7 @@ function useSlots() {
|
|
|
4646
4706
|
function useAttrs() {
|
|
4647
4707
|
return getContext().attrs;
|
|
4648
4708
|
}
|
|
4649
|
-
function useModel(props, name
|
|
4709
|
+
function useModel(props, name) {
|
|
4650
4710
|
const i = getCurrentInstance();
|
|
4651
4711
|
if (!i) {
|
|
4652
4712
|
warn(`useModel() called without active instance.`);
|
|
@@ -4656,29 +4716,24 @@ function useModel(props, name, options) {
|
|
|
4656
4716
|
warn(`useModel() called with prop "${name}" which is not declared.`);
|
|
4657
4717
|
return ref();
|
|
4658
4718
|
}
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
)
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
__v_isRef: true,
|
|
4674
|
-
get value() {
|
|
4675
|
-
return props[name];
|
|
4676
|
-
},
|
|
4677
|
-
set value(value) {
|
|
4678
|
-
i.emit(`update:${name}`, value);
|
|
4719
|
+
let localValue;
|
|
4720
|
+
watchSyncEffect(() => {
|
|
4721
|
+
localValue = props[name];
|
|
4722
|
+
});
|
|
4723
|
+
return customRef((track, trigger) => ({
|
|
4724
|
+
get() {
|
|
4725
|
+
track();
|
|
4726
|
+
return localValue;
|
|
4727
|
+
},
|
|
4728
|
+
set(value) {
|
|
4729
|
+
const rawProps = i.vnode.props;
|
|
4730
|
+
if (!(rawProps && name in rawProps) && hasChanged(value, localValue)) {
|
|
4731
|
+
localValue = value;
|
|
4732
|
+
trigger();
|
|
4679
4733
|
}
|
|
4680
|
-
|
|
4681
|
-
|
|
4734
|
+
i.emit(`update:${name}`, value);
|
|
4735
|
+
}
|
|
4736
|
+
}));
|
|
4682
4737
|
}
|
|
4683
4738
|
function getContext() {
|
|
4684
4739
|
const i = getCurrentInstance();
|
|
@@ -5272,7 +5327,7 @@ function createAppAPI(render, hydrate) {
|
|
|
5272
5327
|
context.directives[name] = directive;
|
|
5273
5328
|
return app;
|
|
5274
5329
|
},
|
|
5275
|
-
mount(rootContainer, isHydrate,
|
|
5330
|
+
mount(rootContainer, isHydrate, namespace) {
|
|
5276
5331
|
if (!isMounted) {
|
|
5277
5332
|
if (rootContainer.__vue_app__) {
|
|
5278
5333
|
warn(
|
|
@@ -5282,15 +5337,24 @@ function createAppAPI(render, hydrate) {
|
|
|
5282
5337
|
}
|
|
5283
5338
|
const vnode = createVNode(rootComponent, rootProps);
|
|
5284
5339
|
vnode.appContext = context;
|
|
5340
|
+
if (namespace === true) {
|
|
5341
|
+
namespace = "svg";
|
|
5342
|
+
} else if (namespace === false) {
|
|
5343
|
+
namespace = void 0;
|
|
5344
|
+
}
|
|
5285
5345
|
{
|
|
5286
5346
|
context.reload = () => {
|
|
5287
|
-
render(
|
|
5347
|
+
render(
|
|
5348
|
+
cloneVNode(vnode),
|
|
5349
|
+
rootContainer,
|
|
5350
|
+
namespace
|
|
5351
|
+
);
|
|
5288
5352
|
};
|
|
5289
5353
|
}
|
|
5290
5354
|
if (isHydrate && hydrate) {
|
|
5291
5355
|
hydrate(vnode, rootContainer);
|
|
5292
5356
|
} else {
|
|
5293
|
-
render(vnode, rootContainer,
|
|
5357
|
+
render(vnode, rootContainer, namespace);
|
|
5294
5358
|
}
|
|
5295
5359
|
isMounted = true;
|
|
5296
5360
|
app._container = rootContainer;
|
|
@@ -5680,11 +5744,12 @@ function validateProps(rawProps, props, instance) {
|
|
|
5680
5744
|
key,
|
|
5681
5745
|
resolvedValues[key],
|
|
5682
5746
|
opt,
|
|
5747
|
+
shallowReadonly(resolvedValues) ,
|
|
5683
5748
|
!hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
|
|
5684
5749
|
);
|
|
5685
5750
|
}
|
|
5686
5751
|
}
|
|
5687
|
-
function validateProp(name, value, prop, isAbsent) {
|
|
5752
|
+
function validateProp(name, value, prop, props, isAbsent) {
|
|
5688
5753
|
const { type, required, validator, skipCheck } = prop;
|
|
5689
5754
|
if (required && isAbsent) {
|
|
5690
5755
|
warn('Missing required prop: "' + name + '"');
|
|
@@ -5707,7 +5772,7 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
5707
5772
|
return;
|
|
5708
5773
|
}
|
|
5709
5774
|
}
|
|
5710
|
-
if (validator && !validator(value)) {
|
|
5775
|
+
if (validator && !validator(value, props)) {
|
|
5711
5776
|
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
5712
5777
|
}
|
|
5713
5778
|
}
|
|
@@ -5963,7 +6028,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
5963
6028
|
}
|
|
5964
6029
|
|
|
5965
6030
|
let hasMismatch = false;
|
|
5966
|
-
const isSVGContainer = (container) =>
|
|
6031
|
+
const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
|
|
6032
|
+
const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
|
|
6033
|
+
const getContainerType = (container) => {
|
|
6034
|
+
if (isSVGContainer(container))
|
|
6035
|
+
return "svg";
|
|
6036
|
+
if (isMathMLContainer(container))
|
|
6037
|
+
return "mathml";
|
|
6038
|
+
return void 0;
|
|
6039
|
+
};
|
|
5967
6040
|
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
5968
6041
|
function createHydrationFunctions(rendererInternals) {
|
|
5969
6042
|
const {
|
|
@@ -6042,11 +6115,13 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6042
6115
|
if (node.data !== vnode.children) {
|
|
6043
6116
|
hasMismatch = true;
|
|
6044
6117
|
warn(
|
|
6045
|
-
`Hydration text mismatch
|
|
6046
|
-
|
|
6118
|
+
`Hydration text mismatch in`,
|
|
6119
|
+
node.parentNode,
|
|
6120
|
+
`
|
|
6121
|
+
- rendered on server: ${JSON.stringify(
|
|
6047
6122
|
node.data
|
|
6048
6123
|
)}
|
|
6049
|
-
-
|
|
6124
|
+
- expected on client: ${JSON.stringify(vnode.children)}`
|
|
6050
6125
|
);
|
|
6051
6126
|
node.data = vnode.children;
|
|
6052
6127
|
}
|
|
@@ -6132,7 +6207,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6132
6207
|
null,
|
|
6133
6208
|
parentComponent,
|
|
6134
6209
|
parentSuspense,
|
|
6135
|
-
|
|
6210
|
+
getContainerType(container),
|
|
6136
6211
|
optimized
|
|
6137
6212
|
);
|
|
6138
6213
|
if (isAsyncWrapper(vnode)) {
|
|
@@ -6167,7 +6242,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6167
6242
|
vnode,
|
|
6168
6243
|
parentComponent,
|
|
6169
6244
|
parentSuspense,
|
|
6170
|
-
|
|
6245
|
+
getContainerType(parentNode(node)),
|
|
6171
6246
|
slotScopeIds,
|
|
6172
6247
|
optimized,
|
|
6173
6248
|
rendererInternals,
|
|
@@ -6190,38 +6265,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6190
6265
|
if (dirs) {
|
|
6191
6266
|
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
6192
6267
|
}
|
|
6193
|
-
if (props) {
|
|
6194
|
-
if (forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
6195
|
-
for (const key in props) {
|
|
6196
|
-
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
6197
|
-
key[0] === ".") {
|
|
6198
|
-
patchProp(
|
|
6199
|
-
el,
|
|
6200
|
-
key,
|
|
6201
|
-
null,
|
|
6202
|
-
props[key],
|
|
6203
|
-
false,
|
|
6204
|
-
void 0,
|
|
6205
|
-
parentComponent
|
|
6206
|
-
);
|
|
6207
|
-
}
|
|
6208
|
-
}
|
|
6209
|
-
} else if (props.onClick) {
|
|
6210
|
-
patchProp(
|
|
6211
|
-
el,
|
|
6212
|
-
"onClick",
|
|
6213
|
-
null,
|
|
6214
|
-
props.onClick,
|
|
6215
|
-
false,
|
|
6216
|
-
void 0,
|
|
6217
|
-
parentComponent
|
|
6218
|
-
);
|
|
6219
|
-
}
|
|
6220
|
-
}
|
|
6221
|
-
let vnodeHooks;
|
|
6222
|
-
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
6223
|
-
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
6224
|
-
}
|
|
6225
6268
|
let needCallTransitionHooks = false;
|
|
6226
6269
|
if (isTemplateNode(el)) {
|
|
6227
6270
|
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
@@ -6232,16 +6275,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6232
6275
|
replaceNode(content, el, parentComponent);
|
|
6233
6276
|
vnode.el = el = content;
|
|
6234
6277
|
}
|
|
6235
|
-
if (dirs) {
|
|
6236
|
-
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
6237
|
-
}
|
|
6238
|
-
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
6239
|
-
queueEffectWithSuspense(() => {
|
|
6240
|
-
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
6241
|
-
needCallTransitionHooks && transition.enter(el);
|
|
6242
|
-
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
6243
|
-
}, parentSuspense);
|
|
6244
|
-
}
|
|
6245
6278
|
if (shapeFlag & 16 && // skip if element has innerHTML / textContent
|
|
6246
6279
|
!(props && (props.innerHTML || props.textContent))) {
|
|
6247
6280
|
let next = hydrateChildren(
|
|
@@ -6258,7 +6291,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6258
6291
|
hasMismatch = true;
|
|
6259
6292
|
if (!hasWarned) {
|
|
6260
6293
|
warn(
|
|
6261
|
-
`Hydration children mismatch
|
|
6294
|
+
`Hydration children mismatch on`,
|
|
6295
|
+
el,
|
|
6296
|
+
`
|
|
6297
|
+
Server rendered element contains more child nodes than client vdom.`
|
|
6262
6298
|
);
|
|
6263
6299
|
hasWarned = true;
|
|
6264
6300
|
}
|
|
@@ -6270,13 +6306,50 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6270
6306
|
if (el.textContent !== vnode.children) {
|
|
6271
6307
|
hasMismatch = true;
|
|
6272
6308
|
warn(
|
|
6273
|
-
`Hydration text content mismatch
|
|
6274
|
-
|
|
6275
|
-
|
|
6309
|
+
`Hydration text content mismatch on`,
|
|
6310
|
+
el,
|
|
6311
|
+
`
|
|
6312
|
+
- rendered on server: ${el.textContent}
|
|
6313
|
+
- expected on client: ${vnode.children}`
|
|
6276
6314
|
);
|
|
6277
6315
|
el.textContent = vnode.children;
|
|
6278
6316
|
}
|
|
6279
6317
|
}
|
|
6318
|
+
if (props) {
|
|
6319
|
+
{
|
|
6320
|
+
for (const key in props) {
|
|
6321
|
+
if (propHasMismatch(el, key, props[key])) {
|
|
6322
|
+
hasMismatch = true;
|
|
6323
|
+
}
|
|
6324
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
6325
|
+
key[0] === ".") {
|
|
6326
|
+
patchProp(
|
|
6327
|
+
el,
|
|
6328
|
+
key,
|
|
6329
|
+
null,
|
|
6330
|
+
props[key],
|
|
6331
|
+
void 0,
|
|
6332
|
+
void 0,
|
|
6333
|
+
parentComponent
|
|
6334
|
+
);
|
|
6335
|
+
}
|
|
6336
|
+
}
|
|
6337
|
+
}
|
|
6338
|
+
}
|
|
6339
|
+
let vnodeHooks;
|
|
6340
|
+
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
6341
|
+
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
6342
|
+
}
|
|
6343
|
+
if (dirs) {
|
|
6344
|
+
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
6345
|
+
}
|
|
6346
|
+
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
6347
|
+
queueEffectWithSuspense(() => {
|
|
6348
|
+
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
6349
|
+
needCallTransitionHooks && transition.enter(el);
|
|
6350
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
6351
|
+
}, parentSuspense);
|
|
6352
|
+
}
|
|
6280
6353
|
}
|
|
6281
6354
|
return el.nextSibling;
|
|
6282
6355
|
};
|
|
@@ -6302,7 +6375,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6302
6375
|
hasMismatch = true;
|
|
6303
6376
|
if (!hasWarned) {
|
|
6304
6377
|
warn(
|
|
6305
|
-
`Hydration children mismatch
|
|
6378
|
+
`Hydration children mismatch on`,
|
|
6379
|
+
container,
|
|
6380
|
+
`
|
|
6381
|
+
Server rendered element contains fewer child nodes than client vdom.`
|
|
6306
6382
|
);
|
|
6307
6383
|
hasWarned = true;
|
|
6308
6384
|
}
|
|
@@ -6313,7 +6389,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6313
6389
|
null,
|
|
6314
6390
|
parentComponent,
|
|
6315
6391
|
parentSuspense,
|
|
6316
|
-
|
|
6392
|
+
getContainerType(container),
|
|
6317
6393
|
slotScopeIds
|
|
6318
6394
|
);
|
|
6319
6395
|
}
|
|
@@ -6347,12 +6423,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6347
6423
|
hasMismatch = true;
|
|
6348
6424
|
warn(
|
|
6349
6425
|
`Hydration node mismatch:
|
|
6350
|
-
-
|
|
6351
|
-
vnode.type,
|
|
6352
|
-
`
|
|
6353
|
-
- Server rendered DOM:`,
|
|
6426
|
+
- rendered on server:`,
|
|
6354
6427
|
node,
|
|
6355
|
-
node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` :
|
|
6428
|
+
node.nodeType === 3 /* TEXT */ ? `(text)` : isComment(node) && node.data === "[" ? `(start of fragment)` : ``,
|
|
6429
|
+
`
|
|
6430
|
+
- expected on client:`,
|
|
6431
|
+
vnode.type
|
|
6356
6432
|
);
|
|
6357
6433
|
vnode.el = null;
|
|
6358
6434
|
if (isFragment) {
|
|
@@ -6376,7 +6452,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6376
6452
|
next,
|
|
6377
6453
|
parentComponent,
|
|
6378
6454
|
parentSuspense,
|
|
6379
|
-
|
|
6455
|
+
getContainerType(container),
|
|
6380
6456
|
slotScopeIds
|
|
6381
6457
|
);
|
|
6382
6458
|
return next;
|
|
@@ -6417,6 +6493,46 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6417
6493
|
};
|
|
6418
6494
|
return [hydrate, hydrateNode];
|
|
6419
6495
|
}
|
|
6496
|
+
function propHasMismatch(el, key, clientValue) {
|
|
6497
|
+
let mismatchType;
|
|
6498
|
+
let mismatchKey;
|
|
6499
|
+
let actual;
|
|
6500
|
+
let expected;
|
|
6501
|
+
if (key === "class") {
|
|
6502
|
+
actual = el.className;
|
|
6503
|
+
expected = normalizeClass(clientValue);
|
|
6504
|
+
if (actual !== expected) {
|
|
6505
|
+
mismatchType = mismatchKey = `class`;
|
|
6506
|
+
}
|
|
6507
|
+
} else if (key === "style") {
|
|
6508
|
+
actual = el.getAttribute("style");
|
|
6509
|
+
expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
|
|
6510
|
+
if (actual !== expected) {
|
|
6511
|
+
mismatchType = mismatchKey = "style";
|
|
6512
|
+
}
|
|
6513
|
+
} else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
|
|
6514
|
+
actual = el.hasAttribute(key) && el.getAttribute(key);
|
|
6515
|
+
expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
|
|
6516
|
+
if (actual !== expected) {
|
|
6517
|
+
mismatchType = `attribute`;
|
|
6518
|
+
mismatchKey = key;
|
|
6519
|
+
}
|
|
6520
|
+
}
|
|
6521
|
+
if (mismatchType) {
|
|
6522
|
+
const format = (v) => v === false ? `(not rendered)` : `${mismatchKey}="${v}"`;
|
|
6523
|
+
warn(
|
|
6524
|
+
`Hydration ${mismatchType} mismatch on`,
|
|
6525
|
+
el,
|
|
6526
|
+
`
|
|
6527
|
+
- rendered on server: ${format(actual)}
|
|
6528
|
+
- expected on client: ${format(expected)}
|
|
6529
|
+
Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
|
|
6530
|
+
You should fix the source of the mismatch.`
|
|
6531
|
+
);
|
|
6532
|
+
return true;
|
|
6533
|
+
}
|
|
6534
|
+
return false;
|
|
6535
|
+
}
|
|
6420
6536
|
|
|
6421
6537
|
let supported;
|
|
6422
6538
|
let perf;
|
|
@@ -6485,7 +6601,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6485
6601
|
setScopeId: hostSetScopeId = NOOP,
|
|
6486
6602
|
insertStaticContent: hostInsertStaticContent
|
|
6487
6603
|
} = options;
|
|
6488
|
-
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null,
|
|
6604
|
+
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
|
|
6489
6605
|
if (n1 === n2) {
|
|
6490
6606
|
return;
|
|
6491
6607
|
}
|
|
@@ -6508,9 +6624,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6508
6624
|
break;
|
|
6509
6625
|
case Static:
|
|
6510
6626
|
if (n1 == null) {
|
|
6511
|
-
mountStaticNode(n2, container, anchor,
|
|
6627
|
+
mountStaticNode(n2, container, anchor, namespace);
|
|
6512
6628
|
} else {
|
|
6513
|
-
patchStaticNode(n1, n2, container,
|
|
6629
|
+
patchStaticNode(n1, n2, container, namespace);
|
|
6514
6630
|
}
|
|
6515
6631
|
break;
|
|
6516
6632
|
case Fragment:
|
|
@@ -6521,7 +6637,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6521
6637
|
anchor,
|
|
6522
6638
|
parentComponent,
|
|
6523
6639
|
parentSuspense,
|
|
6524
|
-
|
|
6640
|
+
namespace,
|
|
6525
6641
|
slotScopeIds,
|
|
6526
6642
|
optimized
|
|
6527
6643
|
);
|
|
@@ -6535,7 +6651,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6535
6651
|
anchor,
|
|
6536
6652
|
parentComponent,
|
|
6537
6653
|
parentSuspense,
|
|
6538
|
-
|
|
6654
|
+
namespace,
|
|
6539
6655
|
slotScopeIds,
|
|
6540
6656
|
optimized
|
|
6541
6657
|
);
|
|
@@ -6547,7 +6663,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6547
6663
|
anchor,
|
|
6548
6664
|
parentComponent,
|
|
6549
6665
|
parentSuspense,
|
|
6550
|
-
|
|
6666
|
+
namespace,
|
|
6551
6667
|
slotScopeIds,
|
|
6552
6668
|
optimized
|
|
6553
6669
|
);
|
|
@@ -6559,7 +6675,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6559
6675
|
anchor,
|
|
6560
6676
|
parentComponent,
|
|
6561
6677
|
parentSuspense,
|
|
6562
|
-
|
|
6678
|
+
namespace,
|
|
6563
6679
|
slotScopeIds,
|
|
6564
6680
|
optimized,
|
|
6565
6681
|
internals
|
|
@@ -6572,7 +6688,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6572
6688
|
anchor,
|
|
6573
6689
|
parentComponent,
|
|
6574
6690
|
parentSuspense,
|
|
6575
|
-
|
|
6691
|
+
namespace,
|
|
6576
6692
|
slotScopeIds,
|
|
6577
6693
|
optimized,
|
|
6578
6694
|
internals
|
|
@@ -6610,17 +6726,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6610
6726
|
n2.el = n1.el;
|
|
6611
6727
|
}
|
|
6612
6728
|
};
|
|
6613
|
-
const mountStaticNode = (n2, container, anchor,
|
|
6729
|
+
const mountStaticNode = (n2, container, anchor, namespace) => {
|
|
6614
6730
|
[n2.el, n2.anchor] = hostInsertStaticContent(
|
|
6615
6731
|
n2.children,
|
|
6616
6732
|
container,
|
|
6617
6733
|
anchor,
|
|
6618
|
-
|
|
6734
|
+
namespace,
|
|
6619
6735
|
n2.el,
|
|
6620
6736
|
n2.anchor
|
|
6621
6737
|
);
|
|
6622
6738
|
};
|
|
6623
|
-
const patchStaticNode = (n1, n2, container,
|
|
6739
|
+
const patchStaticNode = (n1, n2, container, namespace) => {
|
|
6624
6740
|
if (n2.children !== n1.children) {
|
|
6625
6741
|
const anchor = hostNextSibling(n1.anchor);
|
|
6626
6742
|
removeStaticNode(n1);
|
|
@@ -6628,7 +6744,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6628
6744
|
n2.children,
|
|
6629
6745
|
container,
|
|
6630
6746
|
anchor,
|
|
6631
|
-
|
|
6747
|
+
namespace
|
|
6632
6748
|
);
|
|
6633
6749
|
} else {
|
|
6634
6750
|
n2.el = n1.el;
|
|
@@ -6653,8 +6769,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6653
6769
|
}
|
|
6654
6770
|
hostRemove(anchor);
|
|
6655
6771
|
};
|
|
6656
|
-
const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
6657
|
-
|
|
6772
|
+
const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6773
|
+
if (n2.type === "svg") {
|
|
6774
|
+
namespace = "svg";
|
|
6775
|
+
} else if (n2.type === "math") {
|
|
6776
|
+
namespace = "mathml";
|
|
6777
|
+
}
|
|
6658
6778
|
if (n1 == null) {
|
|
6659
6779
|
mountElement(
|
|
6660
6780
|
n2,
|
|
@@ -6662,7 +6782,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6662
6782
|
anchor,
|
|
6663
6783
|
parentComponent,
|
|
6664
6784
|
parentSuspense,
|
|
6665
|
-
|
|
6785
|
+
namespace,
|
|
6666
6786
|
slotScopeIds,
|
|
6667
6787
|
optimized
|
|
6668
6788
|
);
|
|
@@ -6672,19 +6792,19 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6672
6792
|
n2,
|
|
6673
6793
|
parentComponent,
|
|
6674
6794
|
parentSuspense,
|
|
6675
|
-
|
|
6795
|
+
namespace,
|
|
6676
6796
|
slotScopeIds,
|
|
6677
6797
|
optimized
|
|
6678
6798
|
);
|
|
6679
6799
|
}
|
|
6680
6800
|
};
|
|
6681
|
-
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense,
|
|
6801
|
+
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6682
6802
|
let el;
|
|
6683
6803
|
let vnodeHook;
|
|
6684
|
-
const {
|
|
6804
|
+
const { props, shapeFlag, transition, dirs } = vnode;
|
|
6685
6805
|
el = vnode.el = hostCreateElement(
|
|
6686
6806
|
vnode.type,
|
|
6687
|
-
|
|
6807
|
+
namespace,
|
|
6688
6808
|
props && props.is,
|
|
6689
6809
|
props
|
|
6690
6810
|
);
|
|
@@ -6697,7 +6817,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6697
6817
|
null,
|
|
6698
6818
|
parentComponent,
|
|
6699
6819
|
parentSuspense,
|
|
6700
|
-
|
|
6820
|
+
resolveChildrenNamespace(vnode, namespace),
|
|
6701
6821
|
slotScopeIds,
|
|
6702
6822
|
optimized
|
|
6703
6823
|
);
|
|
@@ -6714,7 +6834,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6714
6834
|
key,
|
|
6715
6835
|
null,
|
|
6716
6836
|
props[key],
|
|
6717
|
-
|
|
6837
|
+
namespace,
|
|
6718
6838
|
vnode.children,
|
|
6719
6839
|
parentComponent,
|
|
6720
6840
|
parentSuspense,
|
|
@@ -6723,7 +6843,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6723
6843
|
}
|
|
6724
6844
|
}
|
|
6725
6845
|
if ("value" in props) {
|
|
6726
|
-
hostPatchProp(el, "value", null, props.value);
|
|
6846
|
+
hostPatchProp(el, "value", null, props.value, namespace);
|
|
6727
6847
|
}
|
|
6728
6848
|
if (vnodeHook = props.onVnodeBeforeMount) {
|
|
6729
6849
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
@@ -6781,7 +6901,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6781
6901
|
}
|
|
6782
6902
|
}
|
|
6783
6903
|
};
|
|
6784
|
-
const mountChildren = (children, container, anchor, parentComponent, parentSuspense,
|
|
6904
|
+
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
6785
6905
|
for (let i = start; i < children.length; i++) {
|
|
6786
6906
|
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]);
|
|
6787
6907
|
patch(
|
|
@@ -6791,13 +6911,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6791
6911
|
anchor,
|
|
6792
6912
|
parentComponent,
|
|
6793
6913
|
parentSuspense,
|
|
6794
|
-
|
|
6914
|
+
namespace,
|
|
6795
6915
|
slotScopeIds,
|
|
6796
6916
|
optimized
|
|
6797
6917
|
);
|
|
6798
6918
|
}
|
|
6799
6919
|
};
|
|
6800
|
-
const patchElement = (n1, n2, parentComponent, parentSuspense,
|
|
6920
|
+
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6801
6921
|
const el = n2.el = n1.el;
|
|
6802
6922
|
let { patchFlag, dynamicChildren, dirs } = n2;
|
|
6803
6923
|
patchFlag |= n1.patchFlag & 16;
|
|
@@ -6817,7 +6937,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6817
6937
|
optimized = false;
|
|
6818
6938
|
dynamicChildren = null;
|
|
6819
6939
|
}
|
|
6820
|
-
const areChildrenSVG = isSVG && n2.type !== "foreignObject";
|
|
6821
6940
|
if (dynamicChildren) {
|
|
6822
6941
|
patchBlockChildren(
|
|
6823
6942
|
n1.dynamicChildren,
|
|
@@ -6825,7 +6944,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6825
6944
|
el,
|
|
6826
6945
|
parentComponent,
|
|
6827
6946
|
parentSuspense,
|
|
6828
|
-
|
|
6947
|
+
resolveChildrenNamespace(n2, namespace),
|
|
6829
6948
|
slotScopeIds
|
|
6830
6949
|
);
|
|
6831
6950
|
{
|
|
@@ -6839,7 +6958,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6839
6958
|
null,
|
|
6840
6959
|
parentComponent,
|
|
6841
6960
|
parentSuspense,
|
|
6842
|
-
|
|
6961
|
+
resolveChildrenNamespace(n2, namespace),
|
|
6843
6962
|
slotScopeIds,
|
|
6844
6963
|
false
|
|
6845
6964
|
);
|
|
@@ -6853,16 +6972,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6853
6972
|
newProps,
|
|
6854
6973
|
parentComponent,
|
|
6855
6974
|
parentSuspense,
|
|
6856
|
-
|
|
6975
|
+
namespace
|
|
6857
6976
|
);
|
|
6858
6977
|
} else {
|
|
6859
6978
|
if (patchFlag & 2) {
|
|
6860
6979
|
if (oldProps.class !== newProps.class) {
|
|
6861
|
-
hostPatchProp(el, "class", null, newProps.class,
|
|
6980
|
+
hostPatchProp(el, "class", null, newProps.class, namespace);
|
|
6862
6981
|
}
|
|
6863
6982
|
}
|
|
6864
6983
|
if (patchFlag & 4) {
|
|
6865
|
-
hostPatchProp(el, "style", oldProps.style, newProps.style,
|
|
6984
|
+
hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
|
|
6866
6985
|
}
|
|
6867
6986
|
if (patchFlag & 8) {
|
|
6868
6987
|
const propsToUpdate = n2.dynamicProps;
|
|
@@ -6876,7 +6995,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6876
6995
|
key,
|
|
6877
6996
|
prev,
|
|
6878
6997
|
next,
|
|
6879
|
-
|
|
6998
|
+
namespace,
|
|
6880
6999
|
n1.children,
|
|
6881
7000
|
parentComponent,
|
|
6882
7001
|
parentSuspense,
|
|
@@ -6899,7 +7018,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6899
7018
|
newProps,
|
|
6900
7019
|
parentComponent,
|
|
6901
7020
|
parentSuspense,
|
|
6902
|
-
|
|
7021
|
+
namespace
|
|
6903
7022
|
);
|
|
6904
7023
|
}
|
|
6905
7024
|
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
|
|
@@ -6909,7 +7028,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6909
7028
|
}, parentSuspense);
|
|
6910
7029
|
}
|
|
6911
7030
|
};
|
|
6912
|
-
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense,
|
|
7031
|
+
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
|
|
6913
7032
|
for (let i = 0; i < newChildren.length; i++) {
|
|
6914
7033
|
const oldVNode = oldChildren[i];
|
|
6915
7034
|
const newVNode = newChildren[i];
|
|
@@ -6934,13 +7053,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6934
7053
|
null,
|
|
6935
7054
|
parentComponent,
|
|
6936
7055
|
parentSuspense,
|
|
6937
|
-
|
|
7056
|
+
namespace,
|
|
6938
7057
|
slotScopeIds,
|
|
6939
7058
|
true
|
|
6940
7059
|
);
|
|
6941
7060
|
}
|
|
6942
7061
|
};
|
|
6943
|
-
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense,
|
|
7062
|
+
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
|
|
6944
7063
|
if (oldProps !== newProps) {
|
|
6945
7064
|
if (oldProps !== EMPTY_OBJ) {
|
|
6946
7065
|
for (const key in oldProps) {
|
|
@@ -6950,7 +7069,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6950
7069
|
key,
|
|
6951
7070
|
oldProps[key],
|
|
6952
7071
|
null,
|
|
6953
|
-
|
|
7072
|
+
namespace,
|
|
6954
7073
|
vnode.children,
|
|
6955
7074
|
parentComponent,
|
|
6956
7075
|
parentSuspense,
|
|
@@ -6970,7 +7089,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6970
7089
|
key,
|
|
6971
7090
|
prev,
|
|
6972
7091
|
next,
|
|
6973
|
-
|
|
7092
|
+
namespace,
|
|
6974
7093
|
vnode.children,
|
|
6975
7094
|
parentComponent,
|
|
6976
7095
|
parentSuspense,
|
|
@@ -6979,11 +7098,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6979
7098
|
}
|
|
6980
7099
|
}
|
|
6981
7100
|
if ("value" in newProps) {
|
|
6982
|
-
hostPatchProp(el, "value", oldProps.value, newProps.value);
|
|
7101
|
+
hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
|
|
6983
7102
|
}
|
|
6984
7103
|
}
|
|
6985
7104
|
};
|
|
6986
|
-
const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
7105
|
+
const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
6987
7106
|
const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
|
|
6988
7107
|
const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
|
|
6989
7108
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
@@ -7007,7 +7126,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7007
7126
|
fragmentEndAnchor,
|
|
7008
7127
|
parentComponent,
|
|
7009
7128
|
parentSuspense,
|
|
7010
|
-
|
|
7129
|
+
namespace,
|
|
7011
7130
|
slotScopeIds,
|
|
7012
7131
|
optimized
|
|
7013
7132
|
);
|
|
@@ -7021,7 +7140,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7021
7140
|
container,
|
|
7022
7141
|
parentComponent,
|
|
7023
7142
|
parentSuspense,
|
|
7024
|
-
|
|
7143
|
+
namespace,
|
|
7025
7144
|
slotScopeIds
|
|
7026
7145
|
);
|
|
7027
7146
|
{
|
|
@@ -7035,14 +7154,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7035
7154
|
fragmentEndAnchor,
|
|
7036
7155
|
parentComponent,
|
|
7037
7156
|
parentSuspense,
|
|
7038
|
-
|
|
7157
|
+
namespace,
|
|
7039
7158
|
slotScopeIds,
|
|
7040
7159
|
optimized
|
|
7041
7160
|
);
|
|
7042
7161
|
}
|
|
7043
7162
|
}
|
|
7044
7163
|
};
|
|
7045
|
-
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
7164
|
+
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7046
7165
|
n2.slotScopeIds = slotScopeIds;
|
|
7047
7166
|
if (n1 == null) {
|
|
7048
7167
|
if (n2.shapeFlag & 512) {
|
|
@@ -7050,7 +7169,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7050
7169
|
n2,
|
|
7051
7170
|
container,
|
|
7052
7171
|
anchor,
|
|
7053
|
-
|
|
7172
|
+
namespace,
|
|
7054
7173
|
optimized
|
|
7055
7174
|
);
|
|
7056
7175
|
} else {
|
|
@@ -7060,7 +7179,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7060
7179
|
anchor,
|
|
7061
7180
|
parentComponent,
|
|
7062
7181
|
parentSuspense,
|
|
7063
|
-
|
|
7182
|
+
namespace,
|
|
7064
7183
|
optimized
|
|
7065
7184
|
);
|
|
7066
7185
|
}
|
|
@@ -7068,7 +7187,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7068
7187
|
updateComponent(n1, n2, optimized);
|
|
7069
7188
|
}
|
|
7070
7189
|
};
|
|
7071
|
-
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense,
|
|
7190
|
+
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
7072
7191
|
const instance = (initialVNode.component = createComponentInstance(
|
|
7073
7192
|
initialVNode,
|
|
7074
7193
|
parentComponent,
|
|
@@ -7099,17 +7218,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7099
7218
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
7100
7219
|
processCommentNode(null, placeholder, container, anchor);
|
|
7101
7220
|
}
|
|
7102
|
-
|
|
7221
|
+
} else {
|
|
7222
|
+
setupRenderEffect(
|
|
7223
|
+
instance,
|
|
7224
|
+
initialVNode,
|
|
7225
|
+
container,
|
|
7226
|
+
anchor,
|
|
7227
|
+
parentSuspense,
|
|
7228
|
+
namespace,
|
|
7229
|
+
optimized
|
|
7230
|
+
);
|
|
7103
7231
|
}
|
|
7104
|
-
setupRenderEffect(
|
|
7105
|
-
instance,
|
|
7106
|
-
initialVNode,
|
|
7107
|
-
container,
|
|
7108
|
-
anchor,
|
|
7109
|
-
parentSuspense,
|
|
7110
|
-
isSVG,
|
|
7111
|
-
optimized
|
|
7112
|
-
);
|
|
7113
7232
|
{
|
|
7114
7233
|
popWarningContext();
|
|
7115
7234
|
endMeasure(instance, `mount`);
|
|
@@ -7138,7 +7257,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7138
7257
|
instance.vnode = n2;
|
|
7139
7258
|
}
|
|
7140
7259
|
};
|
|
7141
|
-
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense,
|
|
7260
|
+
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
|
|
7142
7261
|
const componentUpdateFn = () => {
|
|
7143
7262
|
if (!instance.isMounted) {
|
|
7144
7263
|
let vnodeHook;
|
|
@@ -7205,7 +7324,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7205
7324
|
anchor,
|
|
7206
7325
|
instance,
|
|
7207
7326
|
parentSuspense,
|
|
7208
|
-
|
|
7327
|
+
namespace
|
|
7209
7328
|
);
|
|
7210
7329
|
{
|
|
7211
7330
|
endMeasure(instance, `patch`);
|
|
@@ -7232,6 +7351,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7232
7351
|
initialVNode = container = anchor = null;
|
|
7233
7352
|
} else {
|
|
7234
7353
|
let { next, bu, u, parent, vnode } = instance;
|
|
7354
|
+
{
|
|
7355
|
+
const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
|
|
7356
|
+
if (nonHydratedAsyncRoot) {
|
|
7357
|
+
if (next) {
|
|
7358
|
+
next.el = vnode.el;
|
|
7359
|
+
updateComponentPreRender(instance, next, optimized);
|
|
7360
|
+
}
|
|
7361
|
+
nonHydratedAsyncRoot.asyncDep.then(() => {
|
|
7362
|
+
if (!instance.isUnmounted) {
|
|
7363
|
+
componentUpdateFn();
|
|
7364
|
+
}
|
|
7365
|
+
});
|
|
7366
|
+
return;
|
|
7367
|
+
}
|
|
7368
|
+
}
|
|
7235
7369
|
let originNext = next;
|
|
7236
7370
|
let vnodeHook;
|
|
7237
7371
|
{
|
|
@@ -7272,7 +7406,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7272
7406
|
getNextHostNode(prevTree),
|
|
7273
7407
|
instance,
|
|
7274
7408
|
parentSuspense,
|
|
7275
|
-
|
|
7409
|
+
namespace
|
|
7276
7410
|
);
|
|
7277
7411
|
{
|
|
7278
7412
|
endMeasure(instance, `patch`);
|
|
@@ -7327,10 +7461,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7327
7461
|
updateProps(instance, nextVNode.props, prevProps, optimized);
|
|
7328
7462
|
updateSlots(instance, nextVNode.children, optimized);
|
|
7329
7463
|
pauseTracking();
|
|
7330
|
-
flushPreFlushCbs();
|
|
7464
|
+
flushPreFlushCbs(instance);
|
|
7331
7465
|
resetTracking();
|
|
7332
7466
|
};
|
|
7333
|
-
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
7467
|
+
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
|
|
7334
7468
|
const c1 = n1 && n1.children;
|
|
7335
7469
|
const prevShapeFlag = n1 ? n1.shapeFlag : 0;
|
|
7336
7470
|
const c2 = n2.children;
|
|
@@ -7344,7 +7478,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7344
7478
|
anchor,
|
|
7345
7479
|
parentComponent,
|
|
7346
7480
|
parentSuspense,
|
|
7347
|
-
|
|
7481
|
+
namespace,
|
|
7348
7482
|
slotScopeIds,
|
|
7349
7483
|
optimized
|
|
7350
7484
|
);
|
|
@@ -7357,7 +7491,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7357
7491
|
anchor,
|
|
7358
7492
|
parentComponent,
|
|
7359
7493
|
parentSuspense,
|
|
7360
|
-
|
|
7494
|
+
namespace,
|
|
7361
7495
|
slotScopeIds,
|
|
7362
7496
|
optimized
|
|
7363
7497
|
);
|
|
@@ -7381,7 +7515,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7381
7515
|
anchor,
|
|
7382
7516
|
parentComponent,
|
|
7383
7517
|
parentSuspense,
|
|
7384
|
-
|
|
7518
|
+
namespace,
|
|
7385
7519
|
slotScopeIds,
|
|
7386
7520
|
optimized
|
|
7387
7521
|
);
|
|
@@ -7399,7 +7533,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7399
7533
|
anchor,
|
|
7400
7534
|
parentComponent,
|
|
7401
7535
|
parentSuspense,
|
|
7402
|
-
|
|
7536
|
+
namespace,
|
|
7403
7537
|
slotScopeIds,
|
|
7404
7538
|
optimized
|
|
7405
7539
|
);
|
|
@@ -7407,7 +7541,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7407
7541
|
}
|
|
7408
7542
|
}
|
|
7409
7543
|
};
|
|
7410
|
-
const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense,
|
|
7544
|
+
const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7411
7545
|
c1 = c1 || EMPTY_ARR;
|
|
7412
7546
|
c2 = c2 || EMPTY_ARR;
|
|
7413
7547
|
const oldLength = c1.length;
|
|
@@ -7423,7 +7557,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7423
7557
|
null,
|
|
7424
7558
|
parentComponent,
|
|
7425
7559
|
parentSuspense,
|
|
7426
|
-
|
|
7560
|
+
namespace,
|
|
7427
7561
|
slotScopeIds,
|
|
7428
7562
|
optimized
|
|
7429
7563
|
);
|
|
@@ -7444,14 +7578,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7444
7578
|
anchor,
|
|
7445
7579
|
parentComponent,
|
|
7446
7580
|
parentSuspense,
|
|
7447
|
-
|
|
7581
|
+
namespace,
|
|
7448
7582
|
slotScopeIds,
|
|
7449
7583
|
optimized,
|
|
7450
7584
|
commonLength
|
|
7451
7585
|
);
|
|
7452
7586
|
}
|
|
7453
7587
|
};
|
|
7454
|
-
const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense,
|
|
7588
|
+
const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
7455
7589
|
let i = 0;
|
|
7456
7590
|
const l2 = c2.length;
|
|
7457
7591
|
let e1 = c1.length - 1;
|
|
@@ -7467,7 +7601,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7467
7601
|
null,
|
|
7468
7602
|
parentComponent,
|
|
7469
7603
|
parentSuspense,
|
|
7470
|
-
|
|
7604
|
+
namespace,
|
|
7471
7605
|
slotScopeIds,
|
|
7472
7606
|
optimized
|
|
7473
7607
|
);
|
|
@@ -7487,7 +7621,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7487
7621
|
null,
|
|
7488
7622
|
parentComponent,
|
|
7489
7623
|
parentSuspense,
|
|
7490
|
-
|
|
7624
|
+
namespace,
|
|
7491
7625
|
slotScopeIds,
|
|
7492
7626
|
optimized
|
|
7493
7627
|
);
|
|
@@ -7509,7 +7643,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7509
7643
|
anchor,
|
|
7510
7644
|
parentComponent,
|
|
7511
7645
|
parentSuspense,
|
|
7512
|
-
|
|
7646
|
+
namespace,
|
|
7513
7647
|
slotScopeIds,
|
|
7514
7648
|
optimized
|
|
7515
7649
|
);
|
|
@@ -7579,7 +7713,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7579
7713
|
null,
|
|
7580
7714
|
parentComponent,
|
|
7581
7715
|
parentSuspense,
|
|
7582
|
-
|
|
7716
|
+
namespace,
|
|
7583
7717
|
slotScopeIds,
|
|
7584
7718
|
optimized
|
|
7585
7719
|
);
|
|
@@ -7600,7 +7734,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7600
7734
|
anchor,
|
|
7601
7735
|
parentComponent,
|
|
7602
7736
|
parentSuspense,
|
|
7603
|
-
|
|
7737
|
+
namespace,
|
|
7604
7738
|
slotScopeIds,
|
|
7605
7739
|
optimized
|
|
7606
7740
|
);
|
|
@@ -7821,13 +7955,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7821
7955
|
}
|
|
7822
7956
|
return hostNextSibling(vnode.anchor || vnode.el);
|
|
7823
7957
|
};
|
|
7824
|
-
const render = (vnode, container,
|
|
7958
|
+
const render = (vnode, container, namespace) => {
|
|
7825
7959
|
if (vnode == null) {
|
|
7826
7960
|
if (container._vnode) {
|
|
7827
7961
|
unmount(container._vnode, null, null, true);
|
|
7828
7962
|
}
|
|
7829
7963
|
} else {
|
|
7830
|
-
patch(
|
|
7964
|
+
patch(
|
|
7965
|
+
container._vnode || null,
|
|
7966
|
+
vnode,
|
|
7967
|
+
container,
|
|
7968
|
+
null,
|
|
7969
|
+
null,
|
|
7970
|
+
null,
|
|
7971
|
+
namespace
|
|
7972
|
+
);
|
|
7831
7973
|
}
|
|
7832
7974
|
flushPreFlushCbs();
|
|
7833
7975
|
flushPostFlushCbs();
|
|
@@ -7858,6 +8000,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
7858
8000
|
createApp: createAppAPI(render, hydrate)
|
|
7859
8001
|
};
|
|
7860
8002
|
}
|
|
8003
|
+
function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
8004
|
+
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
8005
|
+
}
|
|
7861
8006
|
function toggleRecurse({ effect, update }, allowed) {
|
|
7862
8007
|
effect.allowRecurse = update.allowRecurse = allowed;
|
|
7863
8008
|
}
|
|
@@ -7928,10 +8073,21 @@ function getSequence(arr) {
|
|
|
7928
8073
|
}
|
|
7929
8074
|
return result;
|
|
7930
8075
|
}
|
|
8076
|
+
function locateNonHydratedAsyncRoot(instance) {
|
|
8077
|
+
const subComponent = instance.subTree.component;
|
|
8078
|
+
if (subComponent) {
|
|
8079
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
8080
|
+
return subComponent;
|
|
8081
|
+
} else {
|
|
8082
|
+
return locateNonHydratedAsyncRoot(subComponent);
|
|
8083
|
+
}
|
|
8084
|
+
}
|
|
8085
|
+
}
|
|
7931
8086
|
|
|
7932
8087
|
const isTeleport = (type) => type.__isTeleport;
|
|
7933
8088
|
const isTeleportDisabled = (props) => props && (props.disabled || props.disabled === "");
|
|
7934
8089
|
const isTargetSVG = (target) => typeof SVGElement !== "undefined" && target instanceof SVGElement;
|
|
8090
|
+
const isTargetMathML = (target) => typeof MathMLElement === "function" && target instanceof MathMLElement;
|
|
7935
8091
|
const resolveTarget = (props, select) => {
|
|
7936
8092
|
const targetSelector = props && props.to;
|
|
7937
8093
|
if (isString(targetSelector)) {
|
|
@@ -7959,7 +8115,7 @@ const resolveTarget = (props, select) => {
|
|
|
7959
8115
|
const TeleportImpl = {
|
|
7960
8116
|
name: "Teleport",
|
|
7961
8117
|
__isTeleport: true,
|
|
7962
|
-
process(n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
8118
|
+
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, internals) {
|
|
7963
8119
|
const {
|
|
7964
8120
|
mc: mountChildren,
|
|
7965
8121
|
pc: patchChildren,
|
|
@@ -7981,7 +8137,11 @@ const TeleportImpl = {
|
|
|
7981
8137
|
const targetAnchor = n2.targetAnchor = createText("");
|
|
7982
8138
|
if (target) {
|
|
7983
8139
|
insert(targetAnchor, target);
|
|
7984
|
-
|
|
8140
|
+
if (namespace === "svg" || isTargetSVG(target)) {
|
|
8141
|
+
namespace = "svg";
|
|
8142
|
+
} else if (namespace === "mathml" || isTargetMathML(target)) {
|
|
8143
|
+
namespace = "mathml";
|
|
8144
|
+
}
|
|
7985
8145
|
} else if (!disabled) {
|
|
7986
8146
|
warn("Invalid Teleport target on mount:", target, `(${typeof target})`);
|
|
7987
8147
|
}
|
|
@@ -7993,7 +8153,7 @@ const TeleportImpl = {
|
|
|
7993
8153
|
anchor2,
|
|
7994
8154
|
parentComponent,
|
|
7995
8155
|
parentSuspense,
|
|
7996
|
-
|
|
8156
|
+
namespace,
|
|
7997
8157
|
slotScopeIds,
|
|
7998
8158
|
optimized
|
|
7999
8159
|
);
|
|
@@ -8012,7 +8172,11 @@ const TeleportImpl = {
|
|
|
8012
8172
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
8013
8173
|
const currentContainer = wasDisabled ? container : target;
|
|
8014
8174
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
8015
|
-
|
|
8175
|
+
if (namespace === "svg" || isTargetSVG(target)) {
|
|
8176
|
+
namespace = "svg";
|
|
8177
|
+
} else if (namespace === "mathml" || isTargetMathML(target)) {
|
|
8178
|
+
namespace = "mathml";
|
|
8179
|
+
}
|
|
8016
8180
|
if (dynamicChildren) {
|
|
8017
8181
|
patchBlockChildren(
|
|
8018
8182
|
n1.dynamicChildren,
|
|
@@ -8020,7 +8184,7 @@ const TeleportImpl = {
|
|
|
8020
8184
|
currentContainer,
|
|
8021
8185
|
parentComponent,
|
|
8022
8186
|
parentSuspense,
|
|
8023
|
-
|
|
8187
|
+
namespace,
|
|
8024
8188
|
slotScopeIds
|
|
8025
8189
|
);
|
|
8026
8190
|
traverseStaticChildren(n1, n2, true);
|
|
@@ -8032,7 +8196,7 @@ const TeleportImpl = {
|
|
|
8032
8196
|
currentAnchor,
|
|
8033
8197
|
parentComponent,
|
|
8034
8198
|
parentSuspense,
|
|
8035
|
-
|
|
8199
|
+
namespace,
|
|
8036
8200
|
slotScopeIds,
|
|
8037
8201
|
false
|
|
8038
8202
|
);
|
|
@@ -8655,10 +8819,14 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
8655
8819
|
let currentInstance = null;
|
|
8656
8820
|
const getCurrentInstance = () => currentInstance || currentRenderingInstance;
|
|
8657
8821
|
let internalSetCurrentInstance;
|
|
8822
|
+
let setInSSRSetupState;
|
|
8658
8823
|
{
|
|
8659
8824
|
internalSetCurrentInstance = (i) => {
|
|
8660
8825
|
currentInstance = i;
|
|
8661
8826
|
};
|
|
8827
|
+
setInSSRSetupState = (v) => {
|
|
8828
|
+
isInSSRComponentSetup = v;
|
|
8829
|
+
};
|
|
8662
8830
|
}
|
|
8663
8831
|
const setCurrentInstance = (instance) => {
|
|
8664
8832
|
internalSetCurrentInstance(instance);
|
|
@@ -8682,13 +8850,13 @@ function isStatefulComponent(instance) {
|
|
|
8682
8850
|
}
|
|
8683
8851
|
let isInSSRComponentSetup = false;
|
|
8684
8852
|
function setupComponent(instance, isSSR = false) {
|
|
8685
|
-
|
|
8853
|
+
isSSR && setInSSRSetupState(isSSR);
|
|
8686
8854
|
const { props, children } = instance.vnode;
|
|
8687
8855
|
const isStateful = isStatefulComponent(instance);
|
|
8688
8856
|
initProps(instance, props, isStateful, isSSR);
|
|
8689
8857
|
initSlots(instance, children);
|
|
8690
8858
|
const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
|
|
8691
|
-
|
|
8859
|
+
isSSR && setInSSRSetupState(false);
|
|
8692
8860
|
return setupResult;
|
|
8693
8861
|
}
|
|
8694
8862
|
function setupStatefulComponent(instance, isSSR) {
|
|
@@ -9200,7 +9368,7 @@ function isMemoSame(cached, memo) {
|
|
|
9200
9368
|
return true;
|
|
9201
9369
|
}
|
|
9202
9370
|
|
|
9203
|
-
const version = "3.4.0-
|
|
9371
|
+
const version = "3.4.0-beta.1";
|
|
9204
9372
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
9205
9373
|
const ssrUtils = null;
|
|
9206
9374
|
const resolveFilter = null;
|
|
@@ -9208,6 +9376,7 @@ const compatUtils = null;
|
|
|
9208
9376
|
const DeprecationTypes = null;
|
|
9209
9377
|
|
|
9210
9378
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
9379
|
+
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
9211
9380
|
const doc = typeof document !== "undefined" ? document : null;
|
|
9212
9381
|
const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
|
|
9213
9382
|
const nodeOps = {
|
|
@@ -9220,8 +9389,8 @@ const nodeOps = {
|
|
|
9220
9389
|
parent.removeChild(child);
|
|
9221
9390
|
}
|
|
9222
9391
|
},
|
|
9223
|
-
createElement: (tag,
|
|
9224
|
-
const el =
|
|
9392
|
+
createElement: (tag, namespace, is, props) => {
|
|
9393
|
+
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
|
|
9225
9394
|
if (tag === "select" && props && props.multiple != null) {
|
|
9226
9395
|
el.setAttribute("multiple", props.multiple);
|
|
9227
9396
|
}
|
|
@@ -9245,7 +9414,7 @@ const nodeOps = {
|
|
|
9245
9414
|
// Reason: innerHTML.
|
|
9246
9415
|
// Static content here can only come from compiled templates.
|
|
9247
9416
|
// As long as the user only uses trusted templates, this is safe.
|
|
9248
|
-
insertStaticContent(content, parent, anchor,
|
|
9417
|
+
insertStaticContent(content, parent, anchor, namespace, start, end) {
|
|
9249
9418
|
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
9250
9419
|
if (start && (start === end || start.nextSibling)) {
|
|
9251
9420
|
while (true) {
|
|
@@ -9254,9 +9423,9 @@ const nodeOps = {
|
|
|
9254
9423
|
break;
|
|
9255
9424
|
}
|
|
9256
9425
|
} else {
|
|
9257
|
-
templateContainer.innerHTML =
|
|
9426
|
+
templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
|
|
9258
9427
|
const template = templateContainer.content;
|
|
9259
|
-
if (
|
|
9428
|
+
if (namespace === "svg" || namespace === "mathml") {
|
|
9260
9429
|
const wrapper = template.firstChild;
|
|
9261
9430
|
while (wrapper.firstChild) {
|
|
9262
9431
|
template.appendChild(wrapper.firstChild);
|
|
@@ -9816,7 +9985,8 @@ function patchStopImmediatePropagation(e, value) {
|
|
|
9816
9985
|
|
|
9817
9986
|
const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
|
|
9818
9987
|
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
|
|
9819
|
-
const patchProp = (el, key, prevValue, nextValue,
|
|
9988
|
+
const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
|
|
9989
|
+
const isSVG = namespace === "svg";
|
|
9820
9990
|
if (key === "class") {
|
|
9821
9991
|
patchClass(el, nextValue, isSVG);
|
|
9822
9992
|
} else if (key === "style") {
|
|
@@ -9868,7 +10038,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
9868
10038
|
}
|
|
9869
10039
|
if (key === "width" || key === "height") {
|
|
9870
10040
|
const tag = el.tagName;
|
|
9871
|
-
|
|
10041
|
+
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
|
|
10042
|
+
return false;
|
|
10043
|
+
}
|
|
9872
10044
|
}
|
|
9873
10045
|
if (isNativeOn(key) && isString(value)) {
|
|
9874
10046
|
return false;
|
|
@@ -10614,7 +10786,7 @@ const createApp = (...args) => {
|
|
|
10614
10786
|
component.template = container.innerHTML;
|
|
10615
10787
|
}
|
|
10616
10788
|
container.innerHTML = "";
|
|
10617
|
-
const proxy = mount(container, false, container
|
|
10789
|
+
const proxy = mount(container, false, resolveRootNamespace(container));
|
|
10618
10790
|
if (container instanceof Element) {
|
|
10619
10791
|
container.removeAttribute("v-cloak");
|
|
10620
10792
|
container.setAttribute("data-v-app", "");
|
|
@@ -10633,14 +10805,22 @@ const createSSRApp = (...args) => {
|
|
|
10633
10805
|
app.mount = (containerOrSelector) => {
|
|
10634
10806
|
const container = normalizeContainer(containerOrSelector);
|
|
10635
10807
|
if (container) {
|
|
10636
|
-
return mount(container, true, container
|
|
10808
|
+
return mount(container, true, resolveRootNamespace(container));
|
|
10637
10809
|
}
|
|
10638
10810
|
};
|
|
10639
10811
|
return app;
|
|
10640
10812
|
};
|
|
10813
|
+
function resolveRootNamespace(container) {
|
|
10814
|
+
if (container instanceof SVGElement) {
|
|
10815
|
+
return "svg";
|
|
10816
|
+
}
|
|
10817
|
+
if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
|
|
10818
|
+
return "mathml";
|
|
10819
|
+
}
|
|
10820
|
+
}
|
|
10641
10821
|
function injectNativeTagCheck(app) {
|
|
10642
10822
|
Object.defineProperty(app.config, "isNativeTag", {
|
|
10643
|
-
value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
|
|
10823
|
+
value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
|
|
10644
10824
|
writable: false
|
|
10645
10825
|
});
|
|
10646
10826
|
}
|