@vue/server-renderer 3.4.0-alpha.3 → 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.
|
@@ -8,8 +8,8 @@ const EMPTY_ARR = Object.freeze([]) ;
|
|
|
8
8
|
const NOOP = () => {
|
|
9
9
|
};
|
|
10
10
|
const NO = () => false;
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
|
|
12
|
+
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
|
|
13
13
|
const isModelListener = (key) => key.startsWith("onUpdate:");
|
|
14
14
|
const extend = Object.assign;
|
|
15
15
|
const remove = (arr, el) => {
|
|
@@ -156,9 +156,11 @@ function normalizeClass(value) {
|
|
|
156
156
|
|
|
157
157
|
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";
|
|
158
158
|
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";
|
|
159
|
+
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";
|
|
159
160
|
const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
|
|
160
161
|
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
|
161
162
|
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
|
163
|
+
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
162
164
|
const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
|
|
163
165
|
|
|
164
166
|
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
|
|
@@ -292,20 +294,29 @@ const replacer = (_key, val) => {
|
|
|
292
294
|
return replacer(_key, val.value);
|
|
293
295
|
} else if (isMap(val)) {
|
|
294
296
|
return {
|
|
295
|
-
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
296
|
-
entries[
|
|
297
|
-
|
|
298
|
-
|
|
297
|
+
[`Map(${val.size})`]: [...val.entries()].reduce(
|
|
298
|
+
(entries, [key, val2], i) => {
|
|
299
|
+
entries[stringifySymbol(key, i) + " =>"] = val2;
|
|
300
|
+
return entries;
|
|
301
|
+
},
|
|
302
|
+
{}
|
|
303
|
+
)
|
|
299
304
|
};
|
|
300
305
|
} else if (isSet(val)) {
|
|
301
306
|
return {
|
|
302
|
-
[`Set(${val.size})`]: [...val.values()]
|
|
307
|
+
[`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
|
|
303
308
|
};
|
|
309
|
+
} else if (isSymbol(val)) {
|
|
310
|
+
return stringifySymbol(val);
|
|
304
311
|
} else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
|
|
305
312
|
return String(val);
|
|
306
313
|
}
|
|
307
314
|
return val;
|
|
308
315
|
};
|
|
316
|
+
const stringifySymbol = (v, i = "") => {
|
|
317
|
+
var _a;
|
|
318
|
+
return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
|
|
319
|
+
};
|
|
309
320
|
|
|
310
321
|
function warn$1(msg, ...args) {
|
|
311
322
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
@@ -714,8 +725,13 @@ class BaseReactiveHandler {
|
|
|
714
725
|
return isReadonly2;
|
|
715
726
|
} else if (key === "__v_isShallow") {
|
|
716
727
|
return shallow;
|
|
717
|
-
} else if (key === "__v_raw"
|
|
718
|
-
|
|
728
|
+
} else if (key === "__v_raw") {
|
|
729
|
+
if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
|
|
730
|
+
// this means the reciever is a user proxy of the reactive proxy
|
|
731
|
+
Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
|
|
732
|
+
return target;
|
|
733
|
+
}
|
|
734
|
+
return;
|
|
719
735
|
}
|
|
720
736
|
const targetIsArray = isArray(target);
|
|
721
737
|
if (!isReadonly2) {
|
|
@@ -751,17 +767,19 @@ class MutableReactiveHandler extends BaseReactiveHandler {
|
|
|
751
767
|
}
|
|
752
768
|
set(target, key, value, receiver) {
|
|
753
769
|
let oldValue = target[key];
|
|
754
|
-
if (isReadonly(oldValue) && isRef(oldValue) && !isRef(value)) {
|
|
755
|
-
return false;
|
|
756
|
-
}
|
|
757
770
|
if (!this._shallow) {
|
|
771
|
+
const isOldValueReadonly = isReadonly(oldValue);
|
|
758
772
|
if (!isShallow(value) && !isReadonly(value)) {
|
|
759
773
|
oldValue = toRaw(oldValue);
|
|
760
774
|
value = toRaw(value);
|
|
761
775
|
}
|
|
762
776
|
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
|
|
763
|
-
|
|
764
|
-
|
|
777
|
+
if (isOldValueReadonly) {
|
|
778
|
+
return false;
|
|
779
|
+
} else {
|
|
780
|
+
oldValue.value = value;
|
|
781
|
+
return true;
|
|
782
|
+
}
|
|
765
783
|
}
|
|
766
784
|
}
|
|
767
785
|
const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
|
|
@@ -1616,13 +1634,16 @@ function queuePostFlushCb(cb) {
|
|
|
1616
1634
|
}
|
|
1617
1635
|
queueFlush();
|
|
1618
1636
|
}
|
|
1619
|
-
function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
1637
|
+
function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
1620
1638
|
{
|
|
1621
1639
|
seen = seen || /* @__PURE__ */ new Map();
|
|
1622
1640
|
}
|
|
1623
1641
|
for (; i < queue.length; i++) {
|
|
1624
1642
|
const cb = queue[i];
|
|
1625
1643
|
if (cb && cb.pre) {
|
|
1644
|
+
if (instance && cb.id !== instance.uid) {
|
|
1645
|
+
continue;
|
|
1646
|
+
}
|
|
1626
1647
|
if (checkRecursiveUpdates(seen, cb)) {
|
|
1627
1648
|
continue;
|
|
1628
1649
|
}
|
|
@@ -2374,9 +2395,17 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
2374
2395
|
return false;
|
|
2375
2396
|
}
|
|
2376
2397
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
2377
|
-
while (parent
|
|
2378
|
-
|
|
2379
|
-
|
|
2398
|
+
while (parent) {
|
|
2399
|
+
const root = parent.subTree;
|
|
2400
|
+
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
2401
|
+
root.el = vnode.el;
|
|
2402
|
+
}
|
|
2403
|
+
if (root === vnode) {
|
|
2404
|
+
(vnode = parent.vnode).el = el;
|
|
2405
|
+
parent = parent.parent;
|
|
2406
|
+
} else {
|
|
2407
|
+
break;
|
|
2408
|
+
}
|
|
2380
2409
|
}
|
|
2381
2410
|
}
|
|
2382
2411
|
|
|
@@ -3432,18 +3461,6 @@ function createAppAPI(render, hydrate) {
|
|
|
3432
3461
|
rootProps = null;
|
|
3433
3462
|
}
|
|
3434
3463
|
const context = createAppContext();
|
|
3435
|
-
{
|
|
3436
|
-
Object.defineProperty(context.config, "unwrapInjectedRef", {
|
|
3437
|
-
get() {
|
|
3438
|
-
return true;
|
|
3439
|
-
},
|
|
3440
|
-
set() {
|
|
3441
|
-
warn(
|
|
3442
|
-
`app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
|
|
3443
|
-
);
|
|
3444
|
-
}
|
|
3445
|
-
});
|
|
3446
|
-
}
|
|
3447
3464
|
const installedPlugins = /* @__PURE__ */ new WeakSet();
|
|
3448
3465
|
let isMounted = false;
|
|
3449
3466
|
const app = context.app = {
|
|
@@ -3518,7 +3535,7 @@ function createAppAPI(render, hydrate) {
|
|
|
3518
3535
|
context.directives[name] = directive;
|
|
3519
3536
|
return app;
|
|
3520
3537
|
},
|
|
3521
|
-
mount(rootContainer, isHydrate,
|
|
3538
|
+
mount(rootContainer, isHydrate, namespace) {
|
|
3522
3539
|
if (!isMounted) {
|
|
3523
3540
|
if (rootContainer.__vue_app__) {
|
|
3524
3541
|
warn(
|
|
@@ -3528,15 +3545,24 @@ function createAppAPI(render, hydrate) {
|
|
|
3528
3545
|
}
|
|
3529
3546
|
const vnode = createVNode(rootComponent, rootProps);
|
|
3530
3547
|
vnode.appContext = context;
|
|
3548
|
+
if (namespace === true) {
|
|
3549
|
+
namespace = "svg";
|
|
3550
|
+
} else if (namespace === false) {
|
|
3551
|
+
namespace = void 0;
|
|
3552
|
+
}
|
|
3531
3553
|
{
|
|
3532
3554
|
context.reload = () => {
|
|
3533
|
-
render(
|
|
3555
|
+
render(
|
|
3556
|
+
cloneVNode(vnode),
|
|
3557
|
+
rootContainer,
|
|
3558
|
+
namespace
|
|
3559
|
+
);
|
|
3534
3560
|
};
|
|
3535
3561
|
}
|
|
3536
3562
|
if (isHydrate && hydrate) {
|
|
3537
3563
|
hydrate(vnode, rootContainer);
|
|
3538
3564
|
} else {
|
|
3539
|
-
render(vnode, rootContainer,
|
|
3565
|
+
render(vnode, rootContainer, namespace);
|
|
3540
3566
|
}
|
|
3541
3567
|
isMounted = true;
|
|
3542
3568
|
app._container = rootContainer;
|
|
@@ -3923,11 +3949,12 @@ function validateProps(rawProps, props, instance) {
|
|
|
3923
3949
|
key,
|
|
3924
3950
|
resolvedValues[key],
|
|
3925
3951
|
opt,
|
|
3952
|
+
shallowReadonly(resolvedValues) ,
|
|
3926
3953
|
!hasOwn(rawProps, key) && !hasOwn(rawProps, hyphenate(key))
|
|
3927
3954
|
);
|
|
3928
3955
|
}
|
|
3929
3956
|
}
|
|
3930
|
-
function validateProp(name, value, prop, isAbsent) {
|
|
3957
|
+
function validateProp(name, value, prop, props, isAbsent) {
|
|
3931
3958
|
const { type, required, validator, skipCheck } = prop;
|
|
3932
3959
|
if (required && isAbsent) {
|
|
3933
3960
|
warn('Missing required prop: "' + name + '"');
|
|
@@ -3950,7 +3977,7 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
3950
3977
|
return;
|
|
3951
3978
|
}
|
|
3952
3979
|
}
|
|
3953
|
-
if (validator && !validator(value)) {
|
|
3980
|
+
if (validator && !validator(value, props)) {
|
|
3954
3981
|
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
3955
3982
|
}
|
|
3956
3983
|
}
|
|
@@ -4269,7 +4296,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4269
4296
|
setScopeId: hostSetScopeId = NOOP,
|
|
4270
4297
|
insertStaticContent: hostInsertStaticContent
|
|
4271
4298
|
} = options;
|
|
4272
|
-
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null,
|
|
4299
|
+
const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = isHmrUpdating ? false : !!n2.dynamicChildren) => {
|
|
4273
4300
|
if (n1 === n2) {
|
|
4274
4301
|
return;
|
|
4275
4302
|
}
|
|
@@ -4292,9 +4319,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4292
4319
|
break;
|
|
4293
4320
|
case Static:
|
|
4294
4321
|
if (n1 == null) {
|
|
4295
|
-
mountStaticNode(n2, container, anchor,
|
|
4322
|
+
mountStaticNode(n2, container, anchor, namespace);
|
|
4296
4323
|
} else {
|
|
4297
|
-
patchStaticNode(n1, n2, container,
|
|
4324
|
+
patchStaticNode(n1, n2, container, namespace);
|
|
4298
4325
|
}
|
|
4299
4326
|
break;
|
|
4300
4327
|
case Fragment:
|
|
@@ -4305,7 +4332,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4305
4332
|
anchor,
|
|
4306
4333
|
parentComponent,
|
|
4307
4334
|
parentSuspense,
|
|
4308
|
-
|
|
4335
|
+
namespace,
|
|
4309
4336
|
slotScopeIds,
|
|
4310
4337
|
optimized
|
|
4311
4338
|
);
|
|
@@ -4319,7 +4346,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4319
4346
|
anchor,
|
|
4320
4347
|
parentComponent,
|
|
4321
4348
|
parentSuspense,
|
|
4322
|
-
|
|
4349
|
+
namespace,
|
|
4323
4350
|
slotScopeIds,
|
|
4324
4351
|
optimized
|
|
4325
4352
|
);
|
|
@@ -4331,7 +4358,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4331
4358
|
anchor,
|
|
4332
4359
|
parentComponent,
|
|
4333
4360
|
parentSuspense,
|
|
4334
|
-
|
|
4361
|
+
namespace,
|
|
4335
4362
|
slotScopeIds,
|
|
4336
4363
|
optimized
|
|
4337
4364
|
);
|
|
@@ -4343,7 +4370,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4343
4370
|
anchor,
|
|
4344
4371
|
parentComponent,
|
|
4345
4372
|
parentSuspense,
|
|
4346
|
-
|
|
4373
|
+
namespace,
|
|
4347
4374
|
slotScopeIds,
|
|
4348
4375
|
optimized,
|
|
4349
4376
|
internals
|
|
@@ -4356,7 +4383,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4356
4383
|
anchor,
|
|
4357
4384
|
parentComponent,
|
|
4358
4385
|
parentSuspense,
|
|
4359
|
-
|
|
4386
|
+
namespace,
|
|
4360
4387
|
slotScopeIds,
|
|
4361
4388
|
optimized,
|
|
4362
4389
|
internals
|
|
@@ -4394,17 +4421,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4394
4421
|
n2.el = n1.el;
|
|
4395
4422
|
}
|
|
4396
4423
|
};
|
|
4397
|
-
const mountStaticNode = (n2, container, anchor,
|
|
4424
|
+
const mountStaticNode = (n2, container, anchor, namespace) => {
|
|
4398
4425
|
[n2.el, n2.anchor] = hostInsertStaticContent(
|
|
4399
4426
|
n2.children,
|
|
4400
4427
|
container,
|
|
4401
4428
|
anchor,
|
|
4402
|
-
|
|
4429
|
+
namespace,
|
|
4403
4430
|
n2.el,
|
|
4404
4431
|
n2.anchor
|
|
4405
4432
|
);
|
|
4406
4433
|
};
|
|
4407
|
-
const patchStaticNode = (n1, n2, container,
|
|
4434
|
+
const patchStaticNode = (n1, n2, container, namespace) => {
|
|
4408
4435
|
if (n2.children !== n1.children) {
|
|
4409
4436
|
const anchor = hostNextSibling(n1.anchor);
|
|
4410
4437
|
removeStaticNode(n1);
|
|
@@ -4412,7 +4439,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4412
4439
|
n2.children,
|
|
4413
4440
|
container,
|
|
4414
4441
|
anchor,
|
|
4415
|
-
|
|
4442
|
+
namespace
|
|
4416
4443
|
);
|
|
4417
4444
|
} else {
|
|
4418
4445
|
n2.el = n1.el;
|
|
@@ -4437,8 +4464,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4437
4464
|
}
|
|
4438
4465
|
hostRemove(anchor);
|
|
4439
4466
|
};
|
|
4440
|
-
const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
4441
|
-
|
|
4467
|
+
const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4468
|
+
if (n2.type === "svg") {
|
|
4469
|
+
namespace = "svg";
|
|
4470
|
+
} else if (n2.type === "math") {
|
|
4471
|
+
namespace = "mathml";
|
|
4472
|
+
}
|
|
4442
4473
|
if (n1 == null) {
|
|
4443
4474
|
mountElement(
|
|
4444
4475
|
n2,
|
|
@@ -4446,7 +4477,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4446
4477
|
anchor,
|
|
4447
4478
|
parentComponent,
|
|
4448
4479
|
parentSuspense,
|
|
4449
|
-
|
|
4480
|
+
namespace,
|
|
4450
4481
|
slotScopeIds,
|
|
4451
4482
|
optimized
|
|
4452
4483
|
);
|
|
@@ -4456,19 +4487,19 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4456
4487
|
n2,
|
|
4457
4488
|
parentComponent,
|
|
4458
4489
|
parentSuspense,
|
|
4459
|
-
|
|
4490
|
+
namespace,
|
|
4460
4491
|
slotScopeIds,
|
|
4461
4492
|
optimized
|
|
4462
4493
|
);
|
|
4463
4494
|
}
|
|
4464
4495
|
};
|
|
4465
|
-
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense,
|
|
4496
|
+
const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4466
4497
|
let el;
|
|
4467
4498
|
let vnodeHook;
|
|
4468
|
-
const {
|
|
4499
|
+
const { props, shapeFlag, transition, dirs } = vnode;
|
|
4469
4500
|
el = vnode.el = hostCreateElement(
|
|
4470
4501
|
vnode.type,
|
|
4471
|
-
|
|
4502
|
+
namespace,
|
|
4472
4503
|
props && props.is,
|
|
4473
4504
|
props
|
|
4474
4505
|
);
|
|
@@ -4481,7 +4512,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4481
4512
|
null,
|
|
4482
4513
|
parentComponent,
|
|
4483
4514
|
parentSuspense,
|
|
4484
|
-
|
|
4515
|
+
resolveChildrenNamespace(vnode, namespace),
|
|
4485
4516
|
slotScopeIds,
|
|
4486
4517
|
optimized
|
|
4487
4518
|
);
|
|
@@ -4498,7 +4529,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4498
4529
|
key,
|
|
4499
4530
|
null,
|
|
4500
4531
|
props[key],
|
|
4501
|
-
|
|
4532
|
+
namespace,
|
|
4502
4533
|
vnode.children,
|
|
4503
4534
|
parentComponent,
|
|
4504
4535
|
parentSuspense,
|
|
@@ -4507,7 +4538,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4507
4538
|
}
|
|
4508
4539
|
}
|
|
4509
4540
|
if ("value" in props) {
|
|
4510
|
-
hostPatchProp(el, "value", null, props.value);
|
|
4541
|
+
hostPatchProp(el, "value", null, props.value, namespace);
|
|
4511
4542
|
}
|
|
4512
4543
|
if (vnodeHook = props.onVnodeBeforeMount) {
|
|
4513
4544
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
@@ -4565,7 +4596,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4565
4596
|
}
|
|
4566
4597
|
}
|
|
4567
4598
|
};
|
|
4568
|
-
const mountChildren = (children, container, anchor, parentComponent, parentSuspense,
|
|
4599
|
+
const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => {
|
|
4569
4600
|
for (let i = start; i < children.length; i++) {
|
|
4570
4601
|
const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode$1(children[i]);
|
|
4571
4602
|
patch(
|
|
@@ -4575,13 +4606,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4575
4606
|
anchor,
|
|
4576
4607
|
parentComponent,
|
|
4577
4608
|
parentSuspense,
|
|
4578
|
-
|
|
4609
|
+
namespace,
|
|
4579
4610
|
slotScopeIds,
|
|
4580
4611
|
optimized
|
|
4581
4612
|
);
|
|
4582
4613
|
}
|
|
4583
4614
|
};
|
|
4584
|
-
const patchElement = (n1, n2, parentComponent, parentSuspense,
|
|
4615
|
+
const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4585
4616
|
const el = n2.el = n1.el;
|
|
4586
4617
|
let { patchFlag, dynamicChildren, dirs } = n2;
|
|
4587
4618
|
patchFlag |= n1.patchFlag & 16;
|
|
@@ -4601,7 +4632,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4601
4632
|
optimized = false;
|
|
4602
4633
|
dynamicChildren = null;
|
|
4603
4634
|
}
|
|
4604
|
-
const areChildrenSVG = isSVG && n2.type !== "foreignObject";
|
|
4605
4635
|
if (dynamicChildren) {
|
|
4606
4636
|
patchBlockChildren(
|
|
4607
4637
|
n1.dynamicChildren,
|
|
@@ -4609,7 +4639,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4609
4639
|
el,
|
|
4610
4640
|
parentComponent,
|
|
4611
4641
|
parentSuspense,
|
|
4612
|
-
|
|
4642
|
+
resolveChildrenNamespace(n2, namespace),
|
|
4613
4643
|
slotScopeIds
|
|
4614
4644
|
);
|
|
4615
4645
|
{
|
|
@@ -4623,7 +4653,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4623
4653
|
null,
|
|
4624
4654
|
parentComponent,
|
|
4625
4655
|
parentSuspense,
|
|
4626
|
-
|
|
4656
|
+
resolveChildrenNamespace(n2, namespace),
|
|
4627
4657
|
slotScopeIds,
|
|
4628
4658
|
false
|
|
4629
4659
|
);
|
|
@@ -4637,16 +4667,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4637
4667
|
newProps,
|
|
4638
4668
|
parentComponent,
|
|
4639
4669
|
parentSuspense,
|
|
4640
|
-
|
|
4670
|
+
namespace
|
|
4641
4671
|
);
|
|
4642
4672
|
} else {
|
|
4643
4673
|
if (patchFlag & 2) {
|
|
4644
4674
|
if (oldProps.class !== newProps.class) {
|
|
4645
|
-
hostPatchProp(el, "class", null, newProps.class,
|
|
4675
|
+
hostPatchProp(el, "class", null, newProps.class, namespace);
|
|
4646
4676
|
}
|
|
4647
4677
|
}
|
|
4648
4678
|
if (patchFlag & 4) {
|
|
4649
|
-
hostPatchProp(el, "style", oldProps.style, newProps.style,
|
|
4679
|
+
hostPatchProp(el, "style", oldProps.style, newProps.style, namespace);
|
|
4650
4680
|
}
|
|
4651
4681
|
if (patchFlag & 8) {
|
|
4652
4682
|
const propsToUpdate = n2.dynamicProps;
|
|
@@ -4660,7 +4690,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4660
4690
|
key,
|
|
4661
4691
|
prev,
|
|
4662
4692
|
next,
|
|
4663
|
-
|
|
4693
|
+
namespace,
|
|
4664
4694
|
n1.children,
|
|
4665
4695
|
parentComponent,
|
|
4666
4696
|
parentSuspense,
|
|
@@ -4683,7 +4713,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4683
4713
|
newProps,
|
|
4684
4714
|
parentComponent,
|
|
4685
4715
|
parentSuspense,
|
|
4686
|
-
|
|
4716
|
+
namespace
|
|
4687
4717
|
);
|
|
4688
4718
|
}
|
|
4689
4719
|
if ((vnodeHook = newProps.onVnodeUpdated) || dirs) {
|
|
@@ -4693,7 +4723,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4693
4723
|
}, parentSuspense);
|
|
4694
4724
|
}
|
|
4695
4725
|
};
|
|
4696
|
-
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense,
|
|
4726
|
+
const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => {
|
|
4697
4727
|
for (let i = 0; i < newChildren.length; i++) {
|
|
4698
4728
|
const oldVNode = oldChildren[i];
|
|
4699
4729
|
const newVNode = newChildren[i];
|
|
@@ -4718,13 +4748,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4718
4748
|
null,
|
|
4719
4749
|
parentComponent,
|
|
4720
4750
|
parentSuspense,
|
|
4721
|
-
|
|
4751
|
+
namespace,
|
|
4722
4752
|
slotScopeIds,
|
|
4723
4753
|
true
|
|
4724
4754
|
);
|
|
4725
4755
|
}
|
|
4726
4756
|
};
|
|
4727
|
-
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense,
|
|
4757
|
+
const patchProps = (el, vnode, oldProps, newProps, parentComponent, parentSuspense, namespace) => {
|
|
4728
4758
|
if (oldProps !== newProps) {
|
|
4729
4759
|
if (oldProps !== EMPTY_OBJ) {
|
|
4730
4760
|
for (const key in oldProps) {
|
|
@@ -4734,7 +4764,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4734
4764
|
key,
|
|
4735
4765
|
oldProps[key],
|
|
4736
4766
|
null,
|
|
4737
|
-
|
|
4767
|
+
namespace,
|
|
4738
4768
|
vnode.children,
|
|
4739
4769
|
parentComponent,
|
|
4740
4770
|
parentSuspense,
|
|
@@ -4754,7 +4784,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4754
4784
|
key,
|
|
4755
4785
|
prev,
|
|
4756
4786
|
next,
|
|
4757
|
-
|
|
4787
|
+
namespace,
|
|
4758
4788
|
vnode.children,
|
|
4759
4789
|
parentComponent,
|
|
4760
4790
|
parentSuspense,
|
|
@@ -4763,11 +4793,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4763
4793
|
}
|
|
4764
4794
|
}
|
|
4765
4795
|
if ("value" in newProps) {
|
|
4766
|
-
hostPatchProp(el, "value", oldProps.value, newProps.value);
|
|
4796
|
+
hostPatchProp(el, "value", oldProps.value, newProps.value, namespace);
|
|
4767
4797
|
}
|
|
4768
4798
|
}
|
|
4769
4799
|
};
|
|
4770
|
-
const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
4800
|
+
const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4771
4801
|
const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText("");
|
|
4772
4802
|
const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText("");
|
|
4773
4803
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
@@ -4791,7 +4821,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4791
4821
|
fragmentEndAnchor,
|
|
4792
4822
|
parentComponent,
|
|
4793
4823
|
parentSuspense,
|
|
4794
|
-
|
|
4824
|
+
namespace,
|
|
4795
4825
|
slotScopeIds,
|
|
4796
4826
|
optimized
|
|
4797
4827
|
);
|
|
@@ -4805,7 +4835,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4805
4835
|
container,
|
|
4806
4836
|
parentComponent,
|
|
4807
4837
|
parentSuspense,
|
|
4808
|
-
|
|
4838
|
+
namespace,
|
|
4809
4839
|
slotScopeIds
|
|
4810
4840
|
);
|
|
4811
4841
|
{
|
|
@@ -4819,14 +4849,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4819
4849
|
fragmentEndAnchor,
|
|
4820
4850
|
parentComponent,
|
|
4821
4851
|
parentSuspense,
|
|
4822
|
-
|
|
4852
|
+
namespace,
|
|
4823
4853
|
slotScopeIds,
|
|
4824
4854
|
optimized
|
|
4825
4855
|
);
|
|
4826
4856
|
}
|
|
4827
4857
|
}
|
|
4828
4858
|
};
|
|
4829
|
-
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
4859
|
+
const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
4830
4860
|
n2.slotScopeIds = slotScopeIds;
|
|
4831
4861
|
if (n1 == null) {
|
|
4832
4862
|
if (n2.shapeFlag & 512) {
|
|
@@ -4834,7 +4864,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4834
4864
|
n2,
|
|
4835
4865
|
container,
|
|
4836
4866
|
anchor,
|
|
4837
|
-
|
|
4867
|
+
namespace,
|
|
4838
4868
|
optimized
|
|
4839
4869
|
);
|
|
4840
4870
|
} else {
|
|
@@ -4844,7 +4874,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4844
4874
|
anchor,
|
|
4845
4875
|
parentComponent,
|
|
4846
4876
|
parentSuspense,
|
|
4847
|
-
|
|
4877
|
+
namespace,
|
|
4848
4878
|
optimized
|
|
4849
4879
|
);
|
|
4850
4880
|
}
|
|
@@ -4852,7 +4882,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4852
4882
|
updateComponent(n1, n2, optimized);
|
|
4853
4883
|
}
|
|
4854
4884
|
};
|
|
4855
|
-
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense,
|
|
4885
|
+
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => {
|
|
4856
4886
|
const instance = (initialVNode.component = createComponentInstance$1(
|
|
4857
4887
|
initialVNode,
|
|
4858
4888
|
parentComponent,
|
|
@@ -4883,17 +4913,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4883
4913
|
const placeholder = instance.subTree = createVNode(Comment);
|
|
4884
4914
|
processCommentNode(null, placeholder, container, anchor);
|
|
4885
4915
|
}
|
|
4886
|
-
|
|
4916
|
+
} else {
|
|
4917
|
+
setupRenderEffect(
|
|
4918
|
+
instance,
|
|
4919
|
+
initialVNode,
|
|
4920
|
+
container,
|
|
4921
|
+
anchor,
|
|
4922
|
+
parentSuspense,
|
|
4923
|
+
namespace,
|
|
4924
|
+
optimized
|
|
4925
|
+
);
|
|
4887
4926
|
}
|
|
4888
|
-
setupRenderEffect(
|
|
4889
|
-
instance,
|
|
4890
|
-
initialVNode,
|
|
4891
|
-
container,
|
|
4892
|
-
anchor,
|
|
4893
|
-
parentSuspense,
|
|
4894
|
-
isSVG,
|
|
4895
|
-
optimized
|
|
4896
|
-
);
|
|
4897
4927
|
{
|
|
4898
4928
|
popWarningContext();
|
|
4899
4929
|
endMeasure(instance, `mount`);
|
|
@@ -4922,7 +4952,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4922
4952
|
instance.vnode = n2;
|
|
4923
4953
|
}
|
|
4924
4954
|
};
|
|
4925
|
-
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense,
|
|
4955
|
+
const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => {
|
|
4926
4956
|
const componentUpdateFn = () => {
|
|
4927
4957
|
if (!instance.isMounted) {
|
|
4928
4958
|
let vnodeHook;
|
|
@@ -4989,7 +5019,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4989
5019
|
anchor,
|
|
4990
5020
|
instance,
|
|
4991
5021
|
parentSuspense,
|
|
4992
|
-
|
|
5022
|
+
namespace
|
|
4993
5023
|
);
|
|
4994
5024
|
{
|
|
4995
5025
|
endMeasure(instance, `patch`);
|
|
@@ -5016,6 +5046,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5016
5046
|
initialVNode = container = anchor = null;
|
|
5017
5047
|
} else {
|
|
5018
5048
|
let { next, bu, u, parent, vnode } = instance;
|
|
5049
|
+
{
|
|
5050
|
+
const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance);
|
|
5051
|
+
if (nonHydratedAsyncRoot) {
|
|
5052
|
+
if (next) {
|
|
5053
|
+
next.el = vnode.el;
|
|
5054
|
+
updateComponentPreRender(instance, next, optimized);
|
|
5055
|
+
}
|
|
5056
|
+
nonHydratedAsyncRoot.asyncDep.then(() => {
|
|
5057
|
+
if (!instance.isUnmounted) {
|
|
5058
|
+
componentUpdateFn();
|
|
5059
|
+
}
|
|
5060
|
+
});
|
|
5061
|
+
return;
|
|
5062
|
+
}
|
|
5063
|
+
}
|
|
5019
5064
|
let originNext = next;
|
|
5020
5065
|
let vnodeHook;
|
|
5021
5066
|
{
|
|
@@ -5056,7 +5101,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5056
5101
|
getNextHostNode(prevTree),
|
|
5057
5102
|
instance,
|
|
5058
5103
|
parentSuspense,
|
|
5059
|
-
|
|
5104
|
+
namespace
|
|
5060
5105
|
);
|
|
5061
5106
|
{
|
|
5062
5107
|
endMeasure(instance, `patch`);
|
|
@@ -5111,10 +5156,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5111
5156
|
updateProps(instance, nextVNode.props, prevProps, optimized);
|
|
5112
5157
|
updateSlots(instance, nextVNode.children, optimized);
|
|
5113
5158
|
pauseTracking();
|
|
5114
|
-
flushPreFlushCbs();
|
|
5159
|
+
flushPreFlushCbs(instance);
|
|
5115
5160
|
resetTracking();
|
|
5116
5161
|
};
|
|
5117
|
-
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense,
|
|
5162
|
+
const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => {
|
|
5118
5163
|
const c1 = n1 && n1.children;
|
|
5119
5164
|
const prevShapeFlag = n1 ? n1.shapeFlag : 0;
|
|
5120
5165
|
const c2 = n2.children;
|
|
@@ -5128,7 +5173,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5128
5173
|
anchor,
|
|
5129
5174
|
parentComponent,
|
|
5130
5175
|
parentSuspense,
|
|
5131
|
-
|
|
5176
|
+
namespace,
|
|
5132
5177
|
slotScopeIds,
|
|
5133
5178
|
optimized
|
|
5134
5179
|
);
|
|
@@ -5141,7 +5186,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5141
5186
|
anchor,
|
|
5142
5187
|
parentComponent,
|
|
5143
5188
|
parentSuspense,
|
|
5144
|
-
|
|
5189
|
+
namespace,
|
|
5145
5190
|
slotScopeIds,
|
|
5146
5191
|
optimized
|
|
5147
5192
|
);
|
|
@@ -5165,7 +5210,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5165
5210
|
anchor,
|
|
5166
5211
|
parentComponent,
|
|
5167
5212
|
parentSuspense,
|
|
5168
|
-
|
|
5213
|
+
namespace,
|
|
5169
5214
|
slotScopeIds,
|
|
5170
5215
|
optimized
|
|
5171
5216
|
);
|
|
@@ -5183,7 +5228,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5183
5228
|
anchor,
|
|
5184
5229
|
parentComponent,
|
|
5185
5230
|
parentSuspense,
|
|
5186
|
-
|
|
5231
|
+
namespace,
|
|
5187
5232
|
slotScopeIds,
|
|
5188
5233
|
optimized
|
|
5189
5234
|
);
|
|
@@ -5191,7 +5236,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5191
5236
|
}
|
|
5192
5237
|
}
|
|
5193
5238
|
};
|
|
5194
|
-
const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense,
|
|
5239
|
+
const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
5195
5240
|
c1 = c1 || EMPTY_ARR;
|
|
5196
5241
|
c2 = c2 || EMPTY_ARR;
|
|
5197
5242
|
const oldLength = c1.length;
|
|
@@ -5207,7 +5252,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5207
5252
|
null,
|
|
5208
5253
|
parentComponent,
|
|
5209
5254
|
parentSuspense,
|
|
5210
|
-
|
|
5255
|
+
namespace,
|
|
5211
5256
|
slotScopeIds,
|
|
5212
5257
|
optimized
|
|
5213
5258
|
);
|
|
@@ -5228,14 +5273,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5228
5273
|
anchor,
|
|
5229
5274
|
parentComponent,
|
|
5230
5275
|
parentSuspense,
|
|
5231
|
-
|
|
5276
|
+
namespace,
|
|
5232
5277
|
slotScopeIds,
|
|
5233
5278
|
optimized,
|
|
5234
5279
|
commonLength
|
|
5235
5280
|
);
|
|
5236
5281
|
}
|
|
5237
5282
|
};
|
|
5238
|
-
const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense,
|
|
5283
|
+
const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
|
|
5239
5284
|
let i = 0;
|
|
5240
5285
|
const l2 = c2.length;
|
|
5241
5286
|
let e1 = c1.length - 1;
|
|
@@ -5251,7 +5296,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5251
5296
|
null,
|
|
5252
5297
|
parentComponent,
|
|
5253
5298
|
parentSuspense,
|
|
5254
|
-
|
|
5299
|
+
namespace,
|
|
5255
5300
|
slotScopeIds,
|
|
5256
5301
|
optimized
|
|
5257
5302
|
);
|
|
@@ -5271,7 +5316,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5271
5316
|
null,
|
|
5272
5317
|
parentComponent,
|
|
5273
5318
|
parentSuspense,
|
|
5274
|
-
|
|
5319
|
+
namespace,
|
|
5275
5320
|
slotScopeIds,
|
|
5276
5321
|
optimized
|
|
5277
5322
|
);
|
|
@@ -5293,7 +5338,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5293
5338
|
anchor,
|
|
5294
5339
|
parentComponent,
|
|
5295
5340
|
parentSuspense,
|
|
5296
|
-
|
|
5341
|
+
namespace,
|
|
5297
5342
|
slotScopeIds,
|
|
5298
5343
|
optimized
|
|
5299
5344
|
);
|
|
@@ -5363,7 +5408,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5363
5408
|
null,
|
|
5364
5409
|
parentComponent,
|
|
5365
5410
|
parentSuspense,
|
|
5366
|
-
|
|
5411
|
+
namespace,
|
|
5367
5412
|
slotScopeIds,
|
|
5368
5413
|
optimized
|
|
5369
5414
|
);
|
|
@@ -5384,7 +5429,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5384
5429
|
anchor,
|
|
5385
5430
|
parentComponent,
|
|
5386
5431
|
parentSuspense,
|
|
5387
|
-
|
|
5432
|
+
namespace,
|
|
5388
5433
|
slotScopeIds,
|
|
5389
5434
|
optimized
|
|
5390
5435
|
);
|
|
@@ -5605,13 +5650,21 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5605
5650
|
}
|
|
5606
5651
|
return hostNextSibling(vnode.anchor || vnode.el);
|
|
5607
5652
|
};
|
|
5608
|
-
const render = (vnode, container,
|
|
5653
|
+
const render = (vnode, container, namespace) => {
|
|
5609
5654
|
if (vnode == null) {
|
|
5610
5655
|
if (container._vnode) {
|
|
5611
5656
|
unmount(container._vnode, null, null, true);
|
|
5612
5657
|
}
|
|
5613
5658
|
} else {
|
|
5614
|
-
patch(
|
|
5659
|
+
patch(
|
|
5660
|
+
container._vnode || null,
|
|
5661
|
+
vnode,
|
|
5662
|
+
container,
|
|
5663
|
+
null,
|
|
5664
|
+
null,
|
|
5665
|
+
null,
|
|
5666
|
+
namespace
|
|
5667
|
+
);
|
|
5615
5668
|
}
|
|
5616
5669
|
flushPreFlushCbs();
|
|
5617
5670
|
flushPostFlushCbs();
|
|
@@ -5642,6 +5695,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5642
5695
|
createApp: createAppAPI(render, hydrate)
|
|
5643
5696
|
};
|
|
5644
5697
|
}
|
|
5698
|
+
function resolveChildrenNamespace({ type, props }, currentNamespace) {
|
|
5699
|
+
return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace;
|
|
5700
|
+
}
|
|
5645
5701
|
function toggleRecurse({ effect, update }, allowed) {
|
|
5646
5702
|
effect.allowRecurse = update.allowRecurse = allowed;
|
|
5647
5703
|
}
|
|
@@ -5712,6 +5768,16 @@ function getSequence(arr) {
|
|
|
5712
5768
|
}
|
|
5713
5769
|
return result;
|
|
5714
5770
|
}
|
|
5771
|
+
function locateNonHydratedAsyncRoot(instance) {
|
|
5772
|
+
const subComponent = instance.subTree.component;
|
|
5773
|
+
if (subComponent) {
|
|
5774
|
+
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
5775
|
+
return subComponent;
|
|
5776
|
+
} else {
|
|
5777
|
+
return locateNonHydratedAsyncRoot(subComponent);
|
|
5778
|
+
}
|
|
5779
|
+
}
|
|
5780
|
+
}
|
|
5715
5781
|
|
|
5716
5782
|
const isTeleport = (type) => type.__isTeleport;
|
|
5717
5783
|
|
|
@@ -6120,20 +6186,29 @@ function createComponentInstance$1(vnode, parent, suspense) {
|
|
|
6120
6186
|
}
|
|
6121
6187
|
let currentInstance = null;
|
|
6122
6188
|
let internalSetCurrentInstance;
|
|
6123
|
-
let
|
|
6124
|
-
let settersKey = "__VUE_INSTANCE_SETTERS__";
|
|
6189
|
+
let setInSSRSetupState;
|
|
6125
6190
|
{
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6132
|
-
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6191
|
+
const g = getGlobalThis();
|
|
6192
|
+
const registerGlobalSetter = (key, setter) => {
|
|
6193
|
+
let setters;
|
|
6194
|
+
if (!(setters = g[key]))
|
|
6195
|
+
setters = g[key] = [];
|
|
6196
|
+
setters.push(setter);
|
|
6197
|
+
return (v) => {
|
|
6198
|
+
if (setters.length > 1)
|
|
6199
|
+
setters.forEach((set) => set(v));
|
|
6200
|
+
else
|
|
6201
|
+
setters[0](v);
|
|
6202
|
+
};
|
|
6136
6203
|
};
|
|
6204
|
+
internalSetCurrentInstance = registerGlobalSetter(
|
|
6205
|
+
`__VUE_INSTANCE_SETTERS__`,
|
|
6206
|
+
(v) => currentInstance = v
|
|
6207
|
+
);
|
|
6208
|
+
setInSSRSetupState = registerGlobalSetter(
|
|
6209
|
+
`__VUE_SSR_SETTERS__`,
|
|
6210
|
+
(v) => isInSSRComponentSetup = v
|
|
6211
|
+
);
|
|
6137
6212
|
}
|
|
6138
6213
|
const setCurrentInstance = (instance) => {
|
|
6139
6214
|
internalSetCurrentInstance(instance);
|
|
@@ -6157,13 +6232,13 @@ function isStatefulComponent(instance) {
|
|
|
6157
6232
|
}
|
|
6158
6233
|
let isInSSRComponentSetup = false;
|
|
6159
6234
|
function setupComponent$1(instance, isSSR = false) {
|
|
6160
|
-
|
|
6235
|
+
isSSR && setInSSRSetupState(isSSR);
|
|
6161
6236
|
const { props, children } = instance.vnode;
|
|
6162
6237
|
const isStateful = isStatefulComponent(instance);
|
|
6163
6238
|
initProps(instance, props, isStateful, isSSR);
|
|
6164
6239
|
initSlots(instance, children);
|
|
6165
6240
|
const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0;
|
|
6166
|
-
|
|
6241
|
+
isSSR && setInSSRSetupState(false);
|
|
6167
6242
|
return setupResult;
|
|
6168
6243
|
}
|
|
6169
6244
|
function setupStatefulComponent(instance, isSSR) {
|
|
@@ -6443,7 +6518,7 @@ const useSSRContext = () => {
|
|
|
6443
6518
|
}
|
|
6444
6519
|
};
|
|
6445
6520
|
|
|
6446
|
-
const version = "3.4.0-
|
|
6521
|
+
const version = "3.4.0-beta.1";
|
|
6447
6522
|
const _ssrUtils = {
|
|
6448
6523
|
createComponentInstance: createComponentInstance$1,
|
|
6449
6524
|
setupComponent: setupComponent$1,
|
|
@@ -6455,6 +6530,7 @@ const _ssrUtils = {
|
|
|
6455
6530
|
const ssrUtils = _ssrUtils ;
|
|
6456
6531
|
|
|
6457
6532
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
6533
|
+
const mathmlNS = "http://www.w3.org/1998/Math/MathML";
|
|
6458
6534
|
const doc = typeof document !== "undefined" ? document : null;
|
|
6459
6535
|
const templateContainer = doc && /* @__PURE__ */ doc.createElement("template");
|
|
6460
6536
|
const nodeOps = {
|
|
@@ -6467,8 +6543,8 @@ const nodeOps = {
|
|
|
6467
6543
|
parent.removeChild(child);
|
|
6468
6544
|
}
|
|
6469
6545
|
},
|
|
6470
|
-
createElement: (tag,
|
|
6471
|
-
const el =
|
|
6546
|
+
createElement: (tag, namespace, is, props) => {
|
|
6547
|
+
const el = namespace === "svg" ? doc.createElementNS(svgNS, tag) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag) : doc.createElement(tag, is ? { is } : void 0);
|
|
6472
6548
|
if (tag === "select" && props && props.multiple != null) {
|
|
6473
6549
|
el.setAttribute("multiple", props.multiple);
|
|
6474
6550
|
}
|
|
@@ -6492,7 +6568,7 @@ const nodeOps = {
|
|
|
6492
6568
|
// Reason: innerHTML.
|
|
6493
6569
|
// Static content here can only come from compiled templates.
|
|
6494
6570
|
// As long as the user only uses trusted templates, this is safe.
|
|
6495
|
-
insertStaticContent(content, parent, anchor,
|
|
6571
|
+
insertStaticContent(content, parent, anchor, namespace, start, end) {
|
|
6496
6572
|
const before = anchor ? anchor.previousSibling : parent.lastChild;
|
|
6497
6573
|
if (start && (start === end || start.nextSibling)) {
|
|
6498
6574
|
while (true) {
|
|
@@ -6501,9 +6577,9 @@ const nodeOps = {
|
|
|
6501
6577
|
break;
|
|
6502
6578
|
}
|
|
6503
6579
|
} else {
|
|
6504
|
-
templateContainer.innerHTML =
|
|
6580
|
+
templateContainer.innerHTML = namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content;
|
|
6505
6581
|
const template = templateContainer.content;
|
|
6506
|
-
if (
|
|
6582
|
+
if (namespace === "svg" || namespace === "mathml") {
|
|
6507
6583
|
const wrapper = template.firstChild;
|
|
6508
6584
|
while (wrapper.firstChild) {
|
|
6509
6585
|
template.appendChild(wrapper.firstChild);
|
|
@@ -6801,8 +6877,10 @@ function patchStopImmediatePropagation(e, value) {
|
|
|
6801
6877
|
}
|
|
6802
6878
|
}
|
|
6803
6879
|
|
|
6804
|
-
const
|
|
6805
|
-
|
|
6880
|
+
const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
|
|
6881
|
+
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
|
|
6882
|
+
const patchProp = (el, key, prevValue, nextValue, namespace, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
|
|
6883
|
+
const isSVG = namespace === "svg";
|
|
6806
6884
|
if (key === "class") {
|
|
6807
6885
|
patchClass(el, nextValue, isSVG);
|
|
6808
6886
|
} else if (key === "style") {
|
|
@@ -6835,7 +6913,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
6835
6913
|
if (key === "innerHTML" || key === "textContent") {
|
|
6836
6914
|
return true;
|
|
6837
6915
|
}
|
|
6838
|
-
if (key in el &&
|
|
6916
|
+
if (key in el && isNativeOn(key) && isFunction(value)) {
|
|
6839
6917
|
return true;
|
|
6840
6918
|
}
|
|
6841
6919
|
return false;
|
|
@@ -6852,7 +6930,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
6852
6930
|
if (key === "type" && el.tagName === "TEXTAREA") {
|
|
6853
6931
|
return false;
|
|
6854
6932
|
}
|
|
6855
|
-
if (
|
|
6933
|
+
if (key === "width" || key === "height") {
|
|
6934
|
+
const tag = el.tagName;
|
|
6935
|
+
if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
|
|
6936
|
+
return false;
|
|
6937
|
+
}
|
|
6938
|
+
}
|
|
6939
|
+
if (isNativeOn(key) && isString(value)) {
|
|
6856
6940
|
return false;
|
|
6857
6941
|
}
|
|
6858
6942
|
return key in el;
|
|
@@ -6949,7 +7033,7 @@ const createApp = (...args) => {
|
|
|
6949
7033
|
component.template = container.innerHTML;
|
|
6950
7034
|
}
|
|
6951
7035
|
container.innerHTML = "";
|
|
6952
|
-
const proxy = mount(container, false, container
|
|
7036
|
+
const proxy = mount(container, false, resolveRootNamespace(container));
|
|
6953
7037
|
if (container instanceof Element) {
|
|
6954
7038
|
container.removeAttribute("v-cloak");
|
|
6955
7039
|
container.setAttribute("data-v-app", "");
|
|
@@ -6958,9 +7042,17 @@ const createApp = (...args) => {
|
|
|
6958
7042
|
};
|
|
6959
7043
|
return app;
|
|
6960
7044
|
};
|
|
7045
|
+
function resolveRootNamespace(container) {
|
|
7046
|
+
if (container instanceof SVGElement) {
|
|
7047
|
+
return "svg";
|
|
7048
|
+
}
|
|
7049
|
+
if (typeof MathMLElement === "function" && container instanceof MathMLElement) {
|
|
7050
|
+
return "mathml";
|
|
7051
|
+
}
|
|
7052
|
+
}
|
|
6961
7053
|
function injectNativeTagCheck(app) {
|
|
6962
7054
|
Object.defineProperty(app.config, "isNativeTag", {
|
|
6963
|
-
value: (tag) => isHTMLTag(tag) || isSVGTag(tag),
|
|
7055
|
+
value: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
|
|
6964
7056
|
writable: false
|
|
6965
7057
|
});
|
|
6966
7058
|
}
|
|
@@ -7334,8 +7426,10 @@ function renderComponentSubTree(instance, slotScopeId) {
|
|
|
7334
7426
|
comp.ssrRender = ssrCompile(comp.template);
|
|
7335
7427
|
}
|
|
7336
7428
|
for (const e of instance.scope.effects) {
|
|
7337
|
-
if (e.computed)
|
|
7429
|
+
if (e.computed) {
|
|
7430
|
+
e.computed._dirty = true;
|
|
7338
7431
|
e.computed._cacheable = true;
|
|
7432
|
+
}
|
|
7339
7433
|
}
|
|
7340
7434
|
const ssrRender = instance.ssrRender || comp.ssrRender;
|
|
7341
7435
|
if (ssrRender) {
|