@vue/server-renderer 3.2.44 → 3.2.46
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.
|
@@ -94,7 +94,7 @@ function normalizeClass(value) {
|
|
|
94
94
|
// These tag configs are shared between compiler-dom and runtime-dom, so they
|
|
95
95
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element
|
|
96
96
|
const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,aside,footer,' +
|
|
97
|
-
'header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
|
|
97
|
+
'header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,' +
|
|
98
98
|
'figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,' +
|
|
99
99
|
'data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,' +
|
|
100
100
|
'time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,' +
|
|
@@ -106,7 +106,7 @@ const HTML_TAGS = 'html,body,base,head,link,meta,style,title,address,article,asi
|
|
|
106
106
|
const SVG_TAGS = 'svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,' +
|
|
107
107
|
'defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,' +
|
|
108
108
|
'feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,' +
|
|
109
|
-
'
|
|
109
|
+
'feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,' +
|
|
110
110
|
'feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,' +
|
|
111
111
|
'fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,' +
|
|
112
112
|
'foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,' +
|
|
@@ -333,8 +333,8 @@ const remove = (arr, el) => {
|
|
|
333
333
|
arr.splice(i, 1);
|
|
334
334
|
}
|
|
335
335
|
};
|
|
336
|
-
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
337
|
-
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
|
|
336
|
+
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
337
|
+
const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
338
338
|
const isArray = Array.isArray;
|
|
339
339
|
const isMap = (val) => toTypeString(val) === '[object Map]';
|
|
340
340
|
const isSet = (val) => toTypeString(val) === '[object Set]';
|
|
@@ -405,7 +405,11 @@ const def = (obj, key, value) => {
|
|
|
405
405
|
value
|
|
406
406
|
});
|
|
407
407
|
};
|
|
408
|
-
|
|
408
|
+
/**
|
|
409
|
+
* "123-foo" will be parsed to 123
|
|
410
|
+
* This is used for the .number modifier in v-model
|
|
411
|
+
*/
|
|
412
|
+
const looseToNumber = (val) => {
|
|
409
413
|
const n = parseFloat(val);
|
|
410
414
|
return isNaN(n) ? val : n;
|
|
411
415
|
};
|
|
@@ -424,7 +428,7 @@ const getGlobalThis = () => {
|
|
|
424
428
|
: {}));
|
|
425
429
|
};
|
|
426
430
|
|
|
427
|
-
function warn(msg, ...args) {
|
|
431
|
+
function warn$1(msg, ...args) {
|
|
428
432
|
console.warn(`[Vue warn] ${msg}`, ...args);
|
|
429
433
|
}
|
|
430
434
|
|
|
@@ -435,7 +439,7 @@ class EffectScope {
|
|
|
435
439
|
/**
|
|
436
440
|
* @internal
|
|
437
441
|
*/
|
|
438
|
-
this.
|
|
442
|
+
this._active = true;
|
|
439
443
|
/**
|
|
440
444
|
* @internal
|
|
441
445
|
*/
|
|
@@ -450,8 +454,11 @@ class EffectScope {
|
|
|
450
454
|
(activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(this) - 1;
|
|
451
455
|
}
|
|
452
456
|
}
|
|
457
|
+
get active() {
|
|
458
|
+
return this._active;
|
|
459
|
+
}
|
|
453
460
|
run(fn) {
|
|
454
|
-
if (this.
|
|
461
|
+
if (this._active) {
|
|
455
462
|
const currentEffectScope = activeEffectScope;
|
|
456
463
|
try {
|
|
457
464
|
activeEffectScope = this;
|
|
@@ -462,7 +469,7 @@ class EffectScope {
|
|
|
462
469
|
}
|
|
463
470
|
}
|
|
464
471
|
else {
|
|
465
|
-
warn(`cannot run an inactive effect scope.`);
|
|
472
|
+
warn$1(`cannot run an inactive effect scope.`);
|
|
466
473
|
}
|
|
467
474
|
}
|
|
468
475
|
/**
|
|
@@ -480,7 +487,7 @@ class EffectScope {
|
|
|
480
487
|
activeEffectScope = this.parent;
|
|
481
488
|
}
|
|
482
489
|
stop(fromParent) {
|
|
483
|
-
if (this.
|
|
490
|
+
if (this._active) {
|
|
484
491
|
let i, l;
|
|
485
492
|
for (i = 0, l = this.effects.length; i < l; i++) {
|
|
486
493
|
this.effects[i].stop();
|
|
@@ -503,7 +510,7 @@ class EffectScope {
|
|
|
503
510
|
}
|
|
504
511
|
}
|
|
505
512
|
this.parent = undefined;
|
|
506
|
-
this.
|
|
513
|
+
this._active = false;
|
|
507
514
|
}
|
|
508
515
|
}
|
|
509
516
|
}
|
|
@@ -512,6 +519,9 @@ function recordEffectScope(effect, scope = activeEffectScope) {
|
|
|
512
519
|
scope.effects.push(effect);
|
|
513
520
|
}
|
|
514
521
|
}
|
|
522
|
+
function getCurrentScope() {
|
|
523
|
+
return activeEffectScope;
|
|
524
|
+
}
|
|
515
525
|
|
|
516
526
|
const createDep = (effects) => {
|
|
517
527
|
const dep = new Set(effects);
|
|
@@ -692,7 +702,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
692
702
|
deps = [...depsMap.values()];
|
|
693
703
|
}
|
|
694
704
|
else if (key === 'length' && isArray(target)) {
|
|
695
|
-
const newLength =
|
|
705
|
+
const newLength = Number(newValue);
|
|
696
706
|
depsMap.forEach((dep, key) => {
|
|
697
707
|
if (key === 'length' || key >= newLength) {
|
|
698
708
|
deps.push(dep);
|
|
@@ -792,7 +802,7 @@ Object.getOwnPropertyNames(Symbol)
|
|
|
792
802
|
.filter(key => key !== 'arguments' && key !== 'caller')
|
|
793
803
|
.map(key => Symbol[key])
|
|
794
804
|
.filter(isSymbol));
|
|
795
|
-
const get = /*#__PURE__*/ createGetter();
|
|
805
|
+
const get$1 = /*#__PURE__*/ createGetter();
|
|
796
806
|
const shallowGet = /*#__PURE__*/ createGetter(false, true);
|
|
797
807
|
const readonlyGet = /*#__PURE__*/ createGetter(true);
|
|
798
808
|
const shallowReadonlyGet = /*#__PURE__*/ createGetter(true, true);
|
|
@@ -826,6 +836,11 @@ function createArrayInstrumentations() {
|
|
|
826
836
|
});
|
|
827
837
|
return instrumentations;
|
|
828
838
|
}
|
|
839
|
+
function hasOwnProperty(key) {
|
|
840
|
+
const obj = toRaw(this);
|
|
841
|
+
track(obj, "has" /* TrackOpTypes.HAS */, key);
|
|
842
|
+
return obj.hasOwnProperty(key);
|
|
843
|
+
}
|
|
829
844
|
function createGetter(isReadonly = false, shallow = false) {
|
|
830
845
|
return function get(target, key, receiver) {
|
|
831
846
|
if (key === "__v_isReactive" /* ReactiveFlags.IS_REACTIVE */) {
|
|
@@ -849,8 +864,13 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
849
864
|
return target;
|
|
850
865
|
}
|
|
851
866
|
const targetIsArray = isArray(target);
|
|
852
|
-
if (!isReadonly
|
|
853
|
-
|
|
867
|
+
if (!isReadonly) {
|
|
868
|
+
if (targetIsArray && hasOwn(arrayInstrumentations, key)) {
|
|
869
|
+
return Reflect.get(arrayInstrumentations, key, receiver);
|
|
870
|
+
}
|
|
871
|
+
if (key === 'hasOwnProperty') {
|
|
872
|
+
return hasOwnProperty;
|
|
873
|
+
}
|
|
854
874
|
}
|
|
855
875
|
const res = Reflect.get(target, key, receiver);
|
|
856
876
|
if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
|
|
@@ -875,7 +895,7 @@ function createGetter(isReadonly = false, shallow = false) {
|
|
|
875
895
|
return res;
|
|
876
896
|
};
|
|
877
897
|
}
|
|
878
|
-
const set = /*#__PURE__*/ createSetter();
|
|
898
|
+
const set$1 = /*#__PURE__*/ createSetter();
|
|
879
899
|
const shallowSet = /*#__PURE__*/ createSetter(true);
|
|
880
900
|
function createSetter(shallow = false) {
|
|
881
901
|
return function set(target, key, value, receiver) {
|
|
@@ -918,7 +938,7 @@ function deleteProperty(target, key) {
|
|
|
918
938
|
}
|
|
919
939
|
return result;
|
|
920
940
|
}
|
|
921
|
-
function has(target, key) {
|
|
941
|
+
function has$1(target, key) {
|
|
922
942
|
const result = Reflect.has(target, key);
|
|
923
943
|
if (!isSymbol(key) || !builtInSymbols.has(key)) {
|
|
924
944
|
track(target, "has" /* TrackOpTypes.HAS */, key);
|
|
@@ -930,23 +950,23 @@ function ownKeys(target) {
|
|
|
930
950
|
return Reflect.ownKeys(target);
|
|
931
951
|
}
|
|
932
952
|
const mutableHandlers = {
|
|
933
|
-
get,
|
|
934
|
-
set,
|
|
953
|
+
get: get$1,
|
|
954
|
+
set: set$1,
|
|
935
955
|
deleteProperty,
|
|
936
|
-
has,
|
|
956
|
+
has: has$1,
|
|
937
957
|
ownKeys
|
|
938
958
|
};
|
|
939
959
|
const readonlyHandlers = {
|
|
940
960
|
get: readonlyGet,
|
|
941
961
|
set(target, key) {
|
|
942
962
|
{
|
|
943
|
-
warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
963
|
+
warn$1(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
944
964
|
}
|
|
945
965
|
return true;
|
|
946
966
|
},
|
|
947
967
|
deleteProperty(target, key) {
|
|
948
968
|
{
|
|
949
|
-
warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
969
|
+
warn$1(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
950
970
|
}
|
|
951
971
|
return true;
|
|
952
972
|
}
|
|
@@ -964,7 +984,7 @@ const shallowReadonlyHandlers = /*#__PURE__*/ extend({}, readonlyHandlers, {
|
|
|
964
984
|
|
|
965
985
|
const toShallow = (value) => value;
|
|
966
986
|
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
967
|
-
function get
|
|
987
|
+
function get(target, key, isReadonly = false, isShallow = false) {
|
|
968
988
|
// #1772: readonly(reactive(Map)) should return readonly + reactive version
|
|
969
989
|
// of the value
|
|
970
990
|
target = target["__v_raw" /* ReactiveFlags.RAW */];
|
|
@@ -990,7 +1010,7 @@ function get$1(target, key, isReadonly = false, isShallow = false) {
|
|
|
990
1010
|
target.get(key);
|
|
991
1011
|
}
|
|
992
1012
|
}
|
|
993
|
-
function has
|
|
1013
|
+
function has(key, isReadonly = false) {
|
|
994
1014
|
const target = this["__v_raw" /* ReactiveFlags.RAW */];
|
|
995
1015
|
const rawTarget = toRaw(target);
|
|
996
1016
|
const rawKey = toRaw(key);
|
|
@@ -1020,7 +1040,7 @@ function add(value) {
|
|
|
1020
1040
|
}
|
|
1021
1041
|
return this;
|
|
1022
1042
|
}
|
|
1023
|
-
function set
|
|
1043
|
+
function set(key, value) {
|
|
1024
1044
|
value = toRaw(value);
|
|
1025
1045
|
const target = toRaw(this);
|
|
1026
1046
|
const { has, get } = getProto(target);
|
|
@@ -1133,41 +1153,41 @@ function createReadonlyMethod(type) {
|
|
|
1133
1153
|
function createInstrumentations() {
|
|
1134
1154
|
const mutableInstrumentations = {
|
|
1135
1155
|
get(key) {
|
|
1136
|
-
return get
|
|
1156
|
+
return get(this, key);
|
|
1137
1157
|
},
|
|
1138
1158
|
get size() {
|
|
1139
1159
|
return size(this);
|
|
1140
1160
|
},
|
|
1141
|
-
has
|
|
1161
|
+
has,
|
|
1142
1162
|
add,
|
|
1143
|
-
set
|
|
1163
|
+
set,
|
|
1144
1164
|
delete: deleteEntry,
|
|
1145
1165
|
clear,
|
|
1146
1166
|
forEach: createForEach(false, false)
|
|
1147
1167
|
};
|
|
1148
1168
|
const shallowInstrumentations = {
|
|
1149
1169
|
get(key) {
|
|
1150
|
-
return get
|
|
1170
|
+
return get(this, key, false, true);
|
|
1151
1171
|
},
|
|
1152
1172
|
get size() {
|
|
1153
1173
|
return size(this);
|
|
1154
1174
|
},
|
|
1155
|
-
has
|
|
1175
|
+
has,
|
|
1156
1176
|
add,
|
|
1157
|
-
set
|
|
1177
|
+
set,
|
|
1158
1178
|
delete: deleteEntry,
|
|
1159
1179
|
clear,
|
|
1160
1180
|
forEach: createForEach(false, true)
|
|
1161
1181
|
};
|
|
1162
1182
|
const readonlyInstrumentations = {
|
|
1163
1183
|
get(key) {
|
|
1164
|
-
return get
|
|
1184
|
+
return get(this, key, true);
|
|
1165
1185
|
},
|
|
1166
1186
|
get size() {
|
|
1167
1187
|
return size(this, true);
|
|
1168
1188
|
},
|
|
1169
1189
|
has(key) {
|
|
1170
|
-
return has
|
|
1190
|
+
return has.call(this, key, true);
|
|
1171
1191
|
},
|
|
1172
1192
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1173
1193
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1177,13 +1197,13 @@ function createInstrumentations() {
|
|
|
1177
1197
|
};
|
|
1178
1198
|
const shallowReadonlyInstrumentations = {
|
|
1179
1199
|
get(key) {
|
|
1180
|
-
return get
|
|
1200
|
+
return get(this, key, true, true);
|
|
1181
1201
|
},
|
|
1182
1202
|
get size() {
|
|
1183
1203
|
return size(this, true);
|
|
1184
1204
|
},
|
|
1185
1205
|
has(key) {
|
|
1186
|
-
return has
|
|
1206
|
+
return has.call(this, key, true);
|
|
1187
1207
|
},
|
|
1188
1208
|
add: createReadonlyMethod("add" /* TriggerOpTypes.ADD */),
|
|
1189
1209
|
set: createReadonlyMethod("set" /* TriggerOpTypes.SET */),
|
|
@@ -1374,9 +1394,10 @@ function trackRefValue(ref) {
|
|
|
1374
1394
|
}
|
|
1375
1395
|
function triggerRefValue(ref, newVal) {
|
|
1376
1396
|
ref = toRaw(ref);
|
|
1377
|
-
|
|
1397
|
+
const dep = ref.dep;
|
|
1398
|
+
if (dep) {
|
|
1378
1399
|
{
|
|
1379
|
-
triggerEffects(
|
|
1400
|
+
triggerEffects(dep, {
|
|
1380
1401
|
target: ref,
|
|
1381
1402
|
type: "set" /* TriggerOpTypes.SET */,
|
|
1382
1403
|
key: 'value',
|
|
@@ -1443,7 +1464,7 @@ class ComputedRefImpl {
|
|
|
1443
1464
|
}
|
|
1444
1465
|
}
|
|
1445
1466
|
_a = "__v_isReadonly" /* ReactiveFlags.IS_READONLY */;
|
|
1446
|
-
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
1467
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1447
1468
|
let getter;
|
|
1448
1469
|
let setter;
|
|
1449
1470
|
const onlyGetter = isFunction(getterOrOptions);
|
|
@@ -1473,7 +1494,7 @@ function pushWarningContext(vnode) {
|
|
|
1473
1494
|
function popWarningContext() {
|
|
1474
1495
|
stack.pop();
|
|
1475
1496
|
}
|
|
1476
|
-
function warn
|
|
1497
|
+
function warn(msg, ...args) {
|
|
1477
1498
|
// avoid props formatting or warn handler tracking deps that might be mutated
|
|
1478
1499
|
// during patch, leading to infinite recursion.
|
|
1479
1500
|
pauseTracking();
|
|
@@ -1672,7 +1693,7 @@ function logError(err, type, contextVNode, throwInDev = true) {
|
|
|
1672
1693
|
if (contextVNode) {
|
|
1673
1694
|
pushWarningContext(contextVNode);
|
|
1674
1695
|
}
|
|
1675
|
-
warn
|
|
1696
|
+
warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
1676
1697
|
if (contextVNode) {
|
|
1677
1698
|
popWarningContext();
|
|
1678
1699
|
}
|
|
@@ -1868,7 +1889,7 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
1868
1889
|
if (count > RECURSION_LIMIT) {
|
|
1869
1890
|
const instance = fn.ownerInstance;
|
|
1870
1891
|
const componentName = instance && getComponentName(instance.type);
|
|
1871
|
-
warn
|
|
1892
|
+
warn(`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. ` +
|
|
1872
1893
|
`This means you have a reactive effect that is mutating its own ` +
|
|
1873
1894
|
`dependencies and thus recursively triggering itself. Possible sources ` +
|
|
1874
1895
|
`include component template, render function, updated hook or ` +
|
|
@@ -1975,12 +1996,6 @@ function reload(id, newComp) {
|
|
|
1975
1996
|
// components to be unmounted and re-mounted. Queue the update so that we
|
|
1976
1997
|
// don't end up forcing the same parent to re-render multiple times.
|
|
1977
1998
|
queueJob(instance.parent.update);
|
|
1978
|
-
// instance is the inner component of an async custom element
|
|
1979
|
-
// invoke to reset styles
|
|
1980
|
-
if (instance.parent.type.__asyncLoader &&
|
|
1981
|
-
instance.parent.ceReload) {
|
|
1982
|
-
instance.parent.ceReload(newComp.styles);
|
|
1983
|
-
}
|
|
1984
1999
|
}
|
|
1985
2000
|
else if (instance.appContext.reload) {
|
|
1986
2001
|
// root instance mounted via createApp() has a reload method
|
|
@@ -2025,7 +2040,7 @@ function tryWrap(fn) {
|
|
|
2025
2040
|
let devtools;
|
|
2026
2041
|
let buffer = [];
|
|
2027
2042
|
let devtoolsNotInstalled = false;
|
|
2028
|
-
function emit(event, ...args) {
|
|
2043
|
+
function emit$1(event, ...args) {
|
|
2029
2044
|
if (devtools) {
|
|
2030
2045
|
devtools.emit(event, ...args);
|
|
2031
2046
|
}
|
|
@@ -2072,7 +2087,7 @@ function setDevtoolsHook(hook, target) {
|
|
|
2072
2087
|
}
|
|
2073
2088
|
}
|
|
2074
2089
|
function devtoolsInitApp(app, version) {
|
|
2075
|
-
emit("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2090
|
+
emit$1("app:init" /* DevtoolsHooks.APP_INIT */, app, version, {
|
|
2076
2091
|
Fragment,
|
|
2077
2092
|
Text,
|
|
2078
2093
|
Comment,
|
|
@@ -2080,7 +2095,7 @@ function devtoolsInitApp(app, version) {
|
|
|
2080
2095
|
});
|
|
2081
2096
|
}
|
|
2082
2097
|
function devtoolsUnmountApp(app) {
|
|
2083
|
-
emit("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2098
|
+
emit$1("app:unmount" /* DevtoolsHooks.APP_UNMOUNT */, app);
|
|
2084
2099
|
}
|
|
2085
2100
|
const devtoolsComponentAdded = /*#__PURE__*/ createDevtoolsComponentHook("component:added" /* DevtoolsHooks.COMPONENT_ADDED */);
|
|
2086
2101
|
const devtoolsComponentUpdated =
|
|
@@ -2096,21 +2111,21 @@ const devtoolsComponentRemoved = (component) => {
|
|
|
2096
2111
|
};
|
|
2097
2112
|
function createDevtoolsComponentHook(hook) {
|
|
2098
2113
|
return (component) => {
|
|
2099
|
-
emit(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2114
|
+
emit$1(hook, component.appContext.app, component.uid, component.parent ? component.parent.uid : undefined, component);
|
|
2100
2115
|
};
|
|
2101
2116
|
}
|
|
2102
2117
|
const devtoolsPerfStart = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:start" /* DevtoolsHooks.PERFORMANCE_START */);
|
|
2103
2118
|
const devtoolsPerfEnd = /*#__PURE__*/ createDevtoolsPerformanceHook("perf:end" /* DevtoolsHooks.PERFORMANCE_END */);
|
|
2104
2119
|
function createDevtoolsPerformanceHook(hook) {
|
|
2105
2120
|
return (component, type, time) => {
|
|
2106
|
-
emit(hook, component.appContext.app, component.uid, component, type, time);
|
|
2121
|
+
emit$1(hook, component.appContext.app, component.uid, component, type, time);
|
|
2107
2122
|
};
|
|
2108
2123
|
}
|
|
2109
2124
|
function devtoolsComponentEmit(component, event, params) {
|
|
2110
|
-
emit("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2125
|
+
emit$1("component:emit" /* DevtoolsHooks.COMPONENT_EMIT */, component.appContext.app, component, event, params);
|
|
2111
2126
|
}
|
|
2112
2127
|
|
|
2113
|
-
function emit
|
|
2128
|
+
function emit(instance, event, ...rawArgs) {
|
|
2114
2129
|
if (instance.isUnmounted)
|
|
2115
2130
|
return;
|
|
2116
2131
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
@@ -2120,7 +2135,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
2120
2135
|
if (!(event in emitsOptions) &&
|
|
2121
2136
|
!(false )) {
|
|
2122
2137
|
if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
|
|
2123
|
-
warn
|
|
2138
|
+
warn(`Component emitted event "${event}" but it is neither declared in ` +
|
|
2124
2139
|
`the emits option nor as an "${toHandlerKey(event)}" prop.`);
|
|
2125
2140
|
}
|
|
2126
2141
|
}
|
|
@@ -2129,7 +2144,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
2129
2144
|
if (isFunction(validator)) {
|
|
2130
2145
|
const isValid = validator(...rawArgs);
|
|
2131
2146
|
if (!isValid) {
|
|
2132
|
-
warn
|
|
2147
|
+
warn(`Invalid event arguments: event validation failed for event "${event}".`);
|
|
2133
2148
|
}
|
|
2134
2149
|
}
|
|
2135
2150
|
}
|
|
@@ -2146,7 +2161,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
2146
2161
|
args = rawArgs.map(a => (isString(a) ? a.trim() : a));
|
|
2147
2162
|
}
|
|
2148
2163
|
if (number) {
|
|
2149
|
-
args = rawArgs.map(
|
|
2164
|
+
args = rawArgs.map(looseToNumber);
|
|
2150
2165
|
}
|
|
2151
2166
|
}
|
|
2152
2167
|
{
|
|
@@ -2155,7 +2170,7 @@ function emit$1(instance, event, ...rawArgs) {
|
|
|
2155
2170
|
{
|
|
2156
2171
|
const lowerCaseEvent = event.toLowerCase();
|
|
2157
2172
|
if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
|
|
2158
|
-
warn
|
|
2173
|
+
warn(`Event "${lowerCaseEvent}" is emitted in component ` +
|
|
2159
2174
|
`${formatComponentName(instance, instance.type)} but the handler is registered for "${event}". ` +
|
|
2160
2175
|
`Note that HTML attributes are case-insensitive and you cannot use ` +
|
|
2161
2176
|
`v-on to listen to camelCase events when using in-DOM templates. ` +
|
|
@@ -2260,7 +2275,7 @@ let currentScopeId = null;
|
|
|
2260
2275
|
* setCurrentRenderingInstance(prev)
|
|
2261
2276
|
* ```
|
|
2262
2277
|
*/
|
|
2263
|
-
function setCurrentRenderingInstance(instance) {
|
|
2278
|
+
function setCurrentRenderingInstance$1(instance) {
|
|
2264
2279
|
const prev = currentRenderingInstance;
|
|
2265
2280
|
currentRenderingInstance = instance;
|
|
2266
2281
|
currentScopeId = (instance && instance.type.__scopeId) || null;
|
|
@@ -2287,13 +2302,13 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot // false on
|
|
|
2287
2302
|
if (renderFnWithContext._d) {
|
|
2288
2303
|
setBlockTracking(-1);
|
|
2289
2304
|
}
|
|
2290
|
-
const prevInstance = setCurrentRenderingInstance(ctx);
|
|
2305
|
+
const prevInstance = setCurrentRenderingInstance$1(ctx);
|
|
2291
2306
|
let res;
|
|
2292
2307
|
try {
|
|
2293
2308
|
res = fn(...args);
|
|
2294
2309
|
}
|
|
2295
2310
|
finally {
|
|
2296
|
-
setCurrentRenderingInstance(prevInstance);
|
|
2311
|
+
setCurrentRenderingInstance$1(prevInstance);
|
|
2297
2312
|
if (renderFnWithContext._d) {
|
|
2298
2313
|
setBlockTracking(1);
|
|
2299
2314
|
}
|
|
@@ -2323,11 +2338,11 @@ let accessedAttrs = false;
|
|
|
2323
2338
|
function markAttrsAccessed() {
|
|
2324
2339
|
accessedAttrs = true;
|
|
2325
2340
|
}
|
|
2326
|
-
function renderComponentRoot(instance) {
|
|
2341
|
+
function renderComponentRoot$1(instance) {
|
|
2327
2342
|
const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance;
|
|
2328
2343
|
let result;
|
|
2329
2344
|
let fallthroughAttrs;
|
|
2330
|
-
const prev = setCurrentRenderingInstance(instance);
|
|
2345
|
+
const prev = setCurrentRenderingInstance$1(instance);
|
|
2331
2346
|
{
|
|
2332
2347
|
accessedAttrs = false;
|
|
2333
2348
|
}
|
|
@@ -2336,7 +2351,7 @@ function renderComponentRoot(instance) {
|
|
|
2336
2351
|
// withProxy is a proxy with a different `has` trap only for
|
|
2337
2352
|
// runtime-compiled render functions using `with` block.
|
|
2338
2353
|
const proxyToUse = withProxy || proxy;
|
|
2339
|
-
result = normalizeVNode(render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx));
|
|
2354
|
+
result = normalizeVNode$1(render.call(proxyToUse, proxyToUse, renderCache, props, setupState, data, ctx));
|
|
2340
2355
|
fallthroughAttrs = attrs;
|
|
2341
2356
|
}
|
|
2342
2357
|
else {
|
|
@@ -2346,7 +2361,7 @@ function renderComponentRoot(instance) {
|
|
|
2346
2361
|
if (true && attrs === props) {
|
|
2347
2362
|
markAttrsAccessed();
|
|
2348
2363
|
}
|
|
2349
|
-
result = normalizeVNode(render.length > 1
|
|
2364
|
+
result = normalizeVNode$1(render.length > 1
|
|
2350
2365
|
? render(props, true
|
|
2351
2366
|
? {
|
|
2352
2367
|
get attrs() {
|
|
@@ -2364,7 +2379,6 @@ function renderComponentRoot(instance) {
|
|
|
2364
2379
|
}
|
|
2365
2380
|
}
|
|
2366
2381
|
catch (err) {
|
|
2367
|
-
blockStack.length = 0;
|
|
2368
2382
|
handleError(err, instance, 1 /* ErrorCodes.RENDER_FUNCTION */);
|
|
2369
2383
|
result = createVNode(Comment);
|
|
2370
2384
|
}
|
|
@@ -2410,13 +2424,13 @@ function renderComponentRoot(instance) {
|
|
|
2410
2424
|
}
|
|
2411
2425
|
}
|
|
2412
2426
|
if (extraAttrs.length) {
|
|
2413
|
-
warn
|
|
2427
|
+
warn(`Extraneous non-props attributes (` +
|
|
2414
2428
|
`${extraAttrs.join(', ')}) ` +
|
|
2415
2429
|
`were passed to component but could not be automatically inherited ` +
|
|
2416
2430
|
`because component renders fragment or text root nodes.`);
|
|
2417
2431
|
}
|
|
2418
2432
|
if (eventAttrs.length) {
|
|
2419
|
-
warn
|
|
2433
|
+
warn(`Extraneous non-emits event listeners (` +
|
|
2420
2434
|
`${eventAttrs.join(', ')}) ` +
|
|
2421
2435
|
`were passed to component but could not be automatically inherited ` +
|
|
2422
2436
|
`because component renders fragment or text root nodes. ` +
|
|
@@ -2429,7 +2443,7 @@ function renderComponentRoot(instance) {
|
|
|
2429
2443
|
// inherit directives
|
|
2430
2444
|
if (vnode.dirs) {
|
|
2431
2445
|
if (!isElementRoot(root)) {
|
|
2432
|
-
warn
|
|
2446
|
+
warn(`Runtime directive used on component with non-element root node. ` +
|
|
2433
2447
|
`The directives will not function as intended.`);
|
|
2434
2448
|
}
|
|
2435
2449
|
// clone before mutating since the root may be a hoisted vnode
|
|
@@ -2439,7 +2453,7 @@ function renderComponentRoot(instance) {
|
|
|
2439
2453
|
// inherit transition data
|
|
2440
2454
|
if (vnode.transition) {
|
|
2441
2455
|
if (!isElementRoot(root)) {
|
|
2442
|
-
warn
|
|
2456
|
+
warn(`Component inside <Transition> renders non-element root node ` +
|
|
2443
2457
|
`that cannot be animated.`);
|
|
2444
2458
|
}
|
|
2445
2459
|
root.transition = vnode.transition;
|
|
@@ -2450,7 +2464,7 @@ function renderComponentRoot(instance) {
|
|
|
2450
2464
|
else {
|
|
2451
2465
|
result = root;
|
|
2452
2466
|
}
|
|
2453
|
-
setCurrentRenderingInstance(prev);
|
|
2467
|
+
setCurrentRenderingInstance$1(prev);
|
|
2454
2468
|
return result;
|
|
2455
2469
|
}
|
|
2456
2470
|
/**
|
|
@@ -2479,13 +2493,13 @@ const getChildRoot = (vnode) => {
|
|
|
2479
2493
|
}
|
|
2480
2494
|
}
|
|
2481
2495
|
};
|
|
2482
|
-
return [normalizeVNode(childRoot), setRoot];
|
|
2496
|
+
return [normalizeVNode$1(childRoot), setRoot];
|
|
2483
2497
|
};
|
|
2484
2498
|
function filterSingleRoot(children) {
|
|
2485
2499
|
let singleRoot;
|
|
2486
2500
|
for (let i = 0; i < children.length; i++) {
|
|
2487
2501
|
const child = children[i];
|
|
2488
|
-
if (isVNode(child)) {
|
|
2502
|
+
if (isVNode$2(child)) {
|
|
2489
2503
|
// ignore user comment
|
|
2490
2504
|
if (child.type !== Comment || child.children === 'v-if') {
|
|
2491
2505
|
if (singleRoot) {
|
|
@@ -2625,7 +2639,7 @@ function queueEffectWithSuspense(fn, suspense) {
|
|
|
2625
2639
|
function provide(key, value) {
|
|
2626
2640
|
if (!currentInstance) {
|
|
2627
2641
|
{
|
|
2628
|
-
warn
|
|
2642
|
+
warn(`provide() can only be used inside setup().`);
|
|
2629
2643
|
}
|
|
2630
2644
|
}
|
|
2631
2645
|
else {
|
|
@@ -2664,11 +2678,11 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
2664
2678
|
: defaultValue;
|
|
2665
2679
|
}
|
|
2666
2680
|
else {
|
|
2667
|
-
warn
|
|
2681
|
+
warn(`injection "${String(key)}" not found.`);
|
|
2668
2682
|
}
|
|
2669
2683
|
}
|
|
2670
2684
|
else {
|
|
2671
|
-
warn
|
|
2685
|
+
warn(`inject() can only be used inside setup() or functional components.`);
|
|
2672
2686
|
}
|
|
2673
2687
|
}
|
|
2674
2688
|
|
|
@@ -2677,7 +2691,7 @@ const INITIAL_WATCHER_VALUE = {};
|
|
|
2677
2691
|
// implementation
|
|
2678
2692
|
function watch(source, cb, options) {
|
|
2679
2693
|
if (!isFunction(cb)) {
|
|
2680
|
-
warn
|
|
2694
|
+
warn(`\`watch(fn, options?)\` signature has been moved to a separate API. ` +
|
|
2681
2695
|
`Use \`watchEffect(fn, options?)\` instead. \`watch\` now only ` +
|
|
2682
2696
|
`supports \`watch(source, cb, options?) signature.`);
|
|
2683
2697
|
}
|
|
@@ -2686,19 +2700,20 @@ function watch(source, cb, options) {
|
|
|
2686
2700
|
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
2687
2701
|
if (!cb) {
|
|
2688
2702
|
if (immediate !== undefined) {
|
|
2689
|
-
warn
|
|
2703
|
+
warn(`watch() "immediate" option is only respected when using the ` +
|
|
2690
2704
|
`watch(source, callback, options?) signature.`);
|
|
2691
2705
|
}
|
|
2692
2706
|
if (deep !== undefined) {
|
|
2693
|
-
warn
|
|
2707
|
+
warn(`watch() "deep" option is only respected when using the ` +
|
|
2694
2708
|
`watch(source, callback, options?) signature.`);
|
|
2695
2709
|
}
|
|
2696
2710
|
}
|
|
2697
2711
|
const warnInvalidSource = (s) => {
|
|
2698
|
-
warn
|
|
2712
|
+
warn(`Invalid watch source: `, s, `A watch source can only be a getter/effect function, a ref, ` +
|
|
2699
2713
|
`a reactive object, or an array of these types.`);
|
|
2700
2714
|
};
|
|
2701
|
-
const instance = currentInstance;
|
|
2715
|
+
const instance = getCurrentScope() === (currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope) ? currentInstance : null;
|
|
2716
|
+
// const instance = currentInstance
|
|
2702
2717
|
let getter;
|
|
2703
2718
|
let forceTrigger = false;
|
|
2704
2719
|
let isMultiSource = false;
|
|
@@ -2809,7 +2824,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
2809
2824
|
// pass undefined as the old value when it's changed for the first time
|
|
2810
2825
|
oldValue === INITIAL_WATCHER_VALUE
|
|
2811
2826
|
? undefined
|
|
2812
|
-
:
|
|
2827
|
+
: isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE
|
|
2813
2828
|
? []
|
|
2814
2829
|
: oldValue,
|
|
2815
2830
|
onCleanup
|
|
@@ -3019,7 +3034,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
3019
3034
|
}
|
|
3020
3035
|
else {
|
|
3021
3036
|
const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ''));
|
|
3022
|
-
warn
|
|
3037
|
+
warn(`${apiName} is called when there is no active component instance to be ` +
|
|
3023
3038
|
`associated with. ` +
|
|
3024
3039
|
`Lifecycle injection APIs can only be used during execution of setup().` +
|
|
3025
3040
|
(` If you are using async setup(), make sure to register lifecycle ` +
|
|
@@ -3058,7 +3073,7 @@ return withDirectives(h(comp), [
|
|
|
3058
3073
|
*/
|
|
3059
3074
|
function validateDirectiveName(name) {
|
|
3060
3075
|
if (isBuiltInDirective(name)) {
|
|
3061
|
-
warn
|
|
3076
|
+
warn('Do not use built-in directive ids as custom directive id: ' + name);
|
|
3062
3077
|
}
|
|
3063
3078
|
}
|
|
3064
3079
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
@@ -3119,6 +3134,7 @@ const publicPropertiesMap =
|
|
|
3119
3134
|
$watch: i => (instanceWatch.bind(i) )
|
|
3120
3135
|
});
|
|
3121
3136
|
const isReservedPrefix = (key) => key === '_' || key === '$';
|
|
3137
|
+
const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
|
|
3122
3138
|
const PublicInstanceProxyHandlers = {
|
|
3123
3139
|
get({ _: instance }, key) {
|
|
3124
3140
|
const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
|
|
@@ -3126,15 +3142,6 @@ const PublicInstanceProxyHandlers = {
|
|
|
3126
3142
|
if (key === '__isVue') {
|
|
3127
3143
|
return true;
|
|
3128
3144
|
}
|
|
3129
|
-
// prioritize <script setup> bindings during dev.
|
|
3130
|
-
// this allows even properties that start with _ or $ to be used - so that
|
|
3131
|
-
// it aligns with the production behavior where the render fn is inlined and
|
|
3132
|
-
// indeed has access to all declared variables.
|
|
3133
|
-
if (setupState !== EMPTY_OBJ &&
|
|
3134
|
-
setupState.__isScriptSetup &&
|
|
3135
|
-
hasOwn(setupState, key)) {
|
|
3136
|
-
return setupState[key];
|
|
3137
|
-
}
|
|
3138
3145
|
// data / props / ctx
|
|
3139
3146
|
// This getter gets called for every property access on the render context
|
|
3140
3147
|
// during render and is a major hotspot. The most expensive part of this
|
|
@@ -3157,7 +3164,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
3157
3164
|
// default: just fallthrough
|
|
3158
3165
|
}
|
|
3159
3166
|
}
|
|
3160
|
-
else if (
|
|
3167
|
+
else if (hasSetupBinding(setupState, key)) {
|
|
3161
3168
|
accessCache[key] = 1 /* AccessTypes.SETUP */;
|
|
3162
3169
|
return setupState[key];
|
|
3163
3170
|
}
|
|
@@ -3216,32 +3223,37 @@ const PublicInstanceProxyHandlers = {
|
|
|
3216
3223
|
// to infinite warning loop
|
|
3217
3224
|
key.indexOf('__v') !== 0)) {
|
|
3218
3225
|
if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn(data, key)) {
|
|
3219
|
-
warn
|
|
3226
|
+
warn(`Property ${JSON.stringify(key)} must be accessed via $data because it starts with a reserved ` +
|
|
3220
3227
|
`character ("$" or "_") and is not proxied on the render context.`);
|
|
3221
3228
|
}
|
|
3222
3229
|
else if (instance === currentRenderingInstance) {
|
|
3223
|
-
warn
|
|
3230
|
+
warn(`Property ${JSON.stringify(key)} was accessed during render ` +
|
|
3224
3231
|
`but is not defined on instance.`);
|
|
3225
3232
|
}
|
|
3226
3233
|
}
|
|
3227
3234
|
},
|
|
3228
3235
|
set({ _: instance }, key, value) {
|
|
3229
3236
|
const { data, setupState, ctx } = instance;
|
|
3230
|
-
if (
|
|
3237
|
+
if (hasSetupBinding(setupState, key)) {
|
|
3231
3238
|
setupState[key] = value;
|
|
3232
3239
|
return true;
|
|
3233
3240
|
}
|
|
3241
|
+
else if (setupState.__isScriptSetup &&
|
|
3242
|
+
hasOwn(setupState, key)) {
|
|
3243
|
+
warn(`Cannot mutate <script setup> binding "${key}" from Options API.`);
|
|
3244
|
+
return false;
|
|
3245
|
+
}
|
|
3234
3246
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
3235
3247
|
data[key] = value;
|
|
3236
3248
|
return true;
|
|
3237
3249
|
}
|
|
3238
3250
|
else if (hasOwn(instance.props, key)) {
|
|
3239
|
-
warn
|
|
3251
|
+
warn(`Attempting to mutate prop "${key}". Props are readonly.`);
|
|
3240
3252
|
return false;
|
|
3241
3253
|
}
|
|
3242
3254
|
if (key[0] === '$' && key.slice(1) in instance) {
|
|
3243
|
-
warn
|
|
3244
|
-
`Properties starting with $ are reserved and readonly
|
|
3255
|
+
warn(`Attempting to mutate public property "${key}". ` +
|
|
3256
|
+
`Properties starting with $ are reserved and readonly.`);
|
|
3245
3257
|
return false;
|
|
3246
3258
|
}
|
|
3247
3259
|
else {
|
|
@@ -3262,7 +3274,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
3262
3274
|
let normalizedProps;
|
|
3263
3275
|
return (!!accessCache[key] ||
|
|
3264
3276
|
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
|
|
3265
|
-
(setupState
|
|
3277
|
+
hasSetupBinding(setupState, key) ||
|
|
3266
3278
|
((normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key)) ||
|
|
3267
3279
|
hasOwn(ctx, key) ||
|
|
3268
3280
|
hasOwn(publicPropertiesMap, key) ||
|
|
@@ -3281,7 +3293,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
3281
3293
|
};
|
|
3282
3294
|
{
|
|
3283
3295
|
PublicInstanceProxyHandlers.ownKeys = (target) => {
|
|
3284
|
-
warn
|
|
3296
|
+
warn(`Avoid app logic that relies on enumerating keys on a component instance. ` +
|
|
3285
3297
|
`The keys will be empty in production mode to avoid performance overhead.`);
|
|
3286
3298
|
return Reflect.ownKeys(target);
|
|
3287
3299
|
};
|
|
@@ -3331,7 +3343,7 @@ function exposeSetupStateOnRenderContext(instance) {
|
|
|
3331
3343
|
Object.keys(toRaw(setupState)).forEach(key => {
|
|
3332
3344
|
if (!setupState.__isScriptSetup) {
|
|
3333
3345
|
if (isReservedPrefix(key[0])) {
|
|
3334
|
-
warn
|
|
3346
|
+
warn(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
|
|
3335
3347
|
`which are reserved prefixes for Vue internals.`);
|
|
3336
3348
|
return;
|
|
3337
3349
|
}
|
|
@@ -3349,7 +3361,7 @@ function createDuplicateChecker() {
|
|
|
3349
3361
|
const cache = Object.create(null);
|
|
3350
3362
|
return (type, key) => {
|
|
3351
3363
|
if (cache[key]) {
|
|
3352
|
-
warn
|
|
3364
|
+
warn(`${type} property "${key}" is already defined in ${cache[key]}.`);
|
|
3353
3365
|
}
|
|
3354
3366
|
else {
|
|
3355
3367
|
cache[key] = type;
|
|
@@ -3416,24 +3428,24 @@ function applyOptions(instance) {
|
|
|
3416
3428
|
}
|
|
3417
3429
|
}
|
|
3418
3430
|
else {
|
|
3419
|
-
warn
|
|
3431
|
+
warn(`Method "${key}" has type "${typeof methodHandler}" in the component definition. ` +
|
|
3420
3432
|
`Did you reference the function correctly?`);
|
|
3421
3433
|
}
|
|
3422
3434
|
}
|
|
3423
3435
|
}
|
|
3424
3436
|
if (dataOptions) {
|
|
3425
3437
|
if (!isFunction(dataOptions)) {
|
|
3426
|
-
warn
|
|
3438
|
+
warn(`The data option must be a function. ` +
|
|
3427
3439
|
`Plain object usage is no longer supported.`);
|
|
3428
3440
|
}
|
|
3429
3441
|
const data = dataOptions.call(publicThis, publicThis);
|
|
3430
3442
|
if (isPromise(data)) {
|
|
3431
|
-
warn
|
|
3443
|
+
warn(`data() returned a Promise - note data() cannot be async; If you ` +
|
|
3432
3444
|
`intend to perform data fetching before component renders, use ` +
|
|
3433
3445
|
`async setup() + <Suspense>.`);
|
|
3434
3446
|
}
|
|
3435
3447
|
if (!isObject(data)) {
|
|
3436
|
-
warn
|
|
3448
|
+
warn(`data() should return an object.`);
|
|
3437
3449
|
}
|
|
3438
3450
|
else {
|
|
3439
3451
|
instance.data = reactive(data);
|
|
@@ -3464,15 +3476,15 @@ function applyOptions(instance) {
|
|
|
3464
3476
|
? opt.get.bind(publicThis, publicThis)
|
|
3465
3477
|
: NOOP;
|
|
3466
3478
|
if (get === NOOP) {
|
|
3467
|
-
warn
|
|
3479
|
+
warn(`Computed property "${key}" has no getter.`);
|
|
3468
3480
|
}
|
|
3469
3481
|
const set = !isFunction(opt) && isFunction(opt.set)
|
|
3470
3482
|
? opt.set.bind(publicThis)
|
|
3471
3483
|
: () => {
|
|
3472
|
-
warn
|
|
3484
|
+
warn(`Write operation failed: computed property "${key}" is readonly.`);
|
|
3473
3485
|
}
|
|
3474
3486
|
;
|
|
3475
|
-
const c = computed
|
|
3487
|
+
const c = computed({
|
|
3476
3488
|
get,
|
|
3477
3489
|
set
|
|
3478
3490
|
});
|
|
@@ -3581,7 +3593,7 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
3581
3593
|
}
|
|
3582
3594
|
else {
|
|
3583
3595
|
{
|
|
3584
|
-
warn
|
|
3596
|
+
warn(`injected property "${key}" is a ref and will be auto-unwrapped ` +
|
|
3585
3597
|
`and no longer needs \`.value\` in the next minor release. ` +
|
|
3586
3598
|
`To opt-in to the new behavior now, ` +
|
|
3587
3599
|
`set \`app.config.unwrapInjectedRef = true\` (this config is ` +
|
|
@@ -3613,7 +3625,7 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3613
3625
|
watch(getter, handler);
|
|
3614
3626
|
}
|
|
3615
3627
|
else {
|
|
3616
|
-
warn
|
|
3628
|
+
warn(`Invalid watch handler specified by key "${raw}"`, handler);
|
|
3617
3629
|
}
|
|
3618
3630
|
}
|
|
3619
3631
|
else if (isFunction(raw)) {
|
|
@@ -3631,12 +3643,12 @@ function createWatcher(raw, ctx, publicThis, key) {
|
|
|
3631
3643
|
watch(getter, handler, raw);
|
|
3632
3644
|
}
|
|
3633
3645
|
else {
|
|
3634
|
-
warn
|
|
3646
|
+
warn(`Invalid watch handler specified by key "${raw.handler}"`, handler);
|
|
3635
3647
|
}
|
|
3636
3648
|
}
|
|
3637
3649
|
}
|
|
3638
3650
|
else {
|
|
3639
|
-
warn
|
|
3651
|
+
warn(`Invalid watch option: "${key}"`, raw);
|
|
3640
3652
|
}
|
|
3641
3653
|
}
|
|
3642
3654
|
/**
|
|
@@ -3680,7 +3692,7 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
3680
3692
|
}
|
|
3681
3693
|
for (const key in from) {
|
|
3682
3694
|
if (asMixin && key === 'expose') {
|
|
3683
|
-
warn
|
|
3695
|
+
warn(`"expose" option is ignored when declared in mixins or extends. ` +
|
|
3684
3696
|
`It should only be declared in the base component itself.`);
|
|
3685
3697
|
}
|
|
3686
3698
|
else {
|
|
@@ -4013,7 +4025,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
4013
4025
|
if (isArray(raw)) {
|
|
4014
4026
|
for (let i = 0; i < raw.length; i++) {
|
|
4015
4027
|
if (!isString(raw[i])) {
|
|
4016
|
-
warn
|
|
4028
|
+
warn(`props must be strings when using array syntax.`, raw[i]);
|
|
4017
4029
|
}
|
|
4018
4030
|
const normalizedKey = camelize(raw[i]);
|
|
4019
4031
|
if (validatePropName(normalizedKey)) {
|
|
@@ -4023,7 +4035,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
|
|
|
4023
4035
|
}
|
|
4024
4036
|
else if (raw) {
|
|
4025
4037
|
if (!isObject(raw)) {
|
|
4026
|
-
warn
|
|
4038
|
+
warn(`invalid props options`, raw);
|
|
4027
4039
|
}
|
|
4028
4040
|
for (const key in raw) {
|
|
4029
4041
|
const normalizedKey = camelize(key);
|
|
@@ -4056,15 +4068,15 @@ function validatePropName(key) {
|
|
|
4056
4068
|
return true;
|
|
4057
4069
|
}
|
|
4058
4070
|
else {
|
|
4059
|
-
warn
|
|
4071
|
+
warn(`Invalid prop name: "${key}" is a reserved property.`);
|
|
4060
4072
|
}
|
|
4061
4073
|
return false;
|
|
4062
4074
|
}
|
|
4063
4075
|
// use function string name to check type constructors
|
|
4064
4076
|
// so that it works across vms / iframes.
|
|
4065
4077
|
function getType(ctor) {
|
|
4066
|
-
const match = ctor && ctor.toString().match(/^\s*function (\w+)/);
|
|
4067
|
-
return match ? match[
|
|
4078
|
+
const match = ctor && ctor.toString().match(/^\s*(function|class) (\w+)/);
|
|
4079
|
+
return match ? match[2] : ctor === null ? 'null' : '';
|
|
4068
4080
|
}
|
|
4069
4081
|
function isSameType(a, b) {
|
|
4070
4082
|
return getType(a) === getType(b);
|
|
@@ -4098,7 +4110,7 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
4098
4110
|
const { type, required, validator } = prop;
|
|
4099
4111
|
// required!
|
|
4100
4112
|
if (required && isAbsent) {
|
|
4101
|
-
warn
|
|
4113
|
+
warn('Missing required prop: "' + name + '"');
|
|
4102
4114
|
return;
|
|
4103
4115
|
}
|
|
4104
4116
|
// missing but optional
|
|
@@ -4117,13 +4129,13 @@ function validateProp(name, value, prop, isAbsent) {
|
|
|
4117
4129
|
isValid = valid;
|
|
4118
4130
|
}
|
|
4119
4131
|
if (!isValid) {
|
|
4120
|
-
warn
|
|
4132
|
+
warn(getInvalidTypeMessage(name, value, expectedTypes));
|
|
4121
4133
|
return;
|
|
4122
4134
|
}
|
|
4123
4135
|
}
|
|
4124
4136
|
// custom validator
|
|
4125
4137
|
if (validator && !validator(value)) {
|
|
4126
|
-
warn
|
|
4138
|
+
warn('Invalid prop: custom validator check failed for prop "' + name + '".');
|
|
4127
4139
|
}
|
|
4128
4140
|
}
|
|
4129
4141
|
const isSimpleType = /*#__PURE__*/ makeMap('String,Number,Boolean,Function,Symbol,BigInt');
|
|
@@ -4211,8 +4223,8 @@ function isBoolean(...args) {
|
|
|
4211
4223
|
|
|
4212
4224
|
const isInternalKey = (key) => key[0] === '_' || key === '$stable';
|
|
4213
4225
|
const normalizeSlotValue = (value) => isArray(value)
|
|
4214
|
-
? value.map(normalizeVNode)
|
|
4215
|
-
: [normalizeVNode(value)];
|
|
4226
|
+
? value.map(normalizeVNode$1)
|
|
4227
|
+
: [normalizeVNode$1(value)];
|
|
4216
4228
|
const normalizeSlot = (key, rawSlot, ctx) => {
|
|
4217
4229
|
if (rawSlot._n) {
|
|
4218
4230
|
// already normalized - #5353
|
|
@@ -4220,7 +4232,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
|
|
|
4220
4232
|
}
|
|
4221
4233
|
const normalized = withCtx((...args) => {
|
|
4222
4234
|
if (true && currentInstance) {
|
|
4223
|
-
warn
|
|
4235
|
+
warn(`Slot "${key}" invoked outside of the render function: ` +
|
|
4224
4236
|
`this will not track dependencies used in the slot. ` +
|
|
4225
4237
|
`Invoke the slot function inside the render function instead.`);
|
|
4226
4238
|
}
|
|
@@ -4240,7 +4252,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
4240
4252
|
}
|
|
4241
4253
|
else if (value != null) {
|
|
4242
4254
|
{
|
|
4243
|
-
warn
|
|
4255
|
+
warn(`Non-function value encountered for slot "${key}". ` +
|
|
4244
4256
|
`Prefer function slots for better performance.`);
|
|
4245
4257
|
}
|
|
4246
4258
|
const normalized = normalizeSlotValue(value);
|
|
@@ -4251,7 +4263,7 @@ const normalizeObjectSlots = (rawSlots, slots, instance) => {
|
|
|
4251
4263
|
const normalizeVNodeSlots = (instance, children) => {
|
|
4252
4264
|
if (!isKeepAlive(instance.vnode) &&
|
|
4253
4265
|
!(false )) {
|
|
4254
|
-
warn
|
|
4266
|
+
warn(`Non-function value encountered for default slot. ` +
|
|
4255
4267
|
`Prefer function slots for better performance.`);
|
|
4256
4268
|
}
|
|
4257
4269
|
const normalized = normalizeSlotValue(children);
|
|
@@ -4352,21 +4364,21 @@ function createAppContext() {
|
|
|
4352
4364
|
emitsCache: new WeakMap()
|
|
4353
4365
|
};
|
|
4354
4366
|
}
|
|
4355
|
-
let uid = 0;
|
|
4367
|
+
let uid$1 = 0;
|
|
4356
4368
|
function createAppAPI(render, hydrate) {
|
|
4357
4369
|
return function createApp(rootComponent, rootProps = null) {
|
|
4358
4370
|
if (!isFunction(rootComponent)) {
|
|
4359
4371
|
rootComponent = { ...rootComponent };
|
|
4360
4372
|
}
|
|
4361
4373
|
if (rootProps != null && !isObject(rootProps)) {
|
|
4362
|
-
warn
|
|
4374
|
+
warn(`root props passed to app.mount() must be an object.`);
|
|
4363
4375
|
rootProps = null;
|
|
4364
4376
|
}
|
|
4365
4377
|
const context = createAppContext();
|
|
4366
4378
|
const installedPlugins = new Set();
|
|
4367
4379
|
let isMounted = false;
|
|
4368
4380
|
const app = (context.app = {
|
|
4369
|
-
_uid: uid++,
|
|
4381
|
+
_uid: uid$1++,
|
|
4370
4382
|
_component: rootComponent,
|
|
4371
4383
|
_props: rootProps,
|
|
4372
4384
|
_container: null,
|
|
@@ -4378,12 +4390,12 @@ function createAppAPI(render, hydrate) {
|
|
|
4378
4390
|
},
|
|
4379
4391
|
set config(v) {
|
|
4380
4392
|
{
|
|
4381
|
-
warn
|
|
4393
|
+
warn(`app.config cannot be replaced. Modify individual options instead.`);
|
|
4382
4394
|
}
|
|
4383
4395
|
},
|
|
4384
4396
|
use(plugin, ...options) {
|
|
4385
4397
|
if (installedPlugins.has(plugin)) {
|
|
4386
|
-
warn
|
|
4398
|
+
warn(`Plugin has already been applied to target app.`);
|
|
4387
4399
|
}
|
|
4388
4400
|
else if (plugin && isFunction(plugin.install)) {
|
|
4389
4401
|
installedPlugins.add(plugin);
|
|
@@ -4394,7 +4406,7 @@ function createAppAPI(render, hydrate) {
|
|
|
4394
4406
|
plugin(app, ...options);
|
|
4395
4407
|
}
|
|
4396
4408
|
else {
|
|
4397
|
-
warn
|
|
4409
|
+
warn(`A plugin must either be a function or an object with an "install" ` +
|
|
4398
4410
|
`function.`);
|
|
4399
4411
|
}
|
|
4400
4412
|
return app;
|
|
@@ -4405,7 +4417,7 @@ function createAppAPI(render, hydrate) {
|
|
|
4405
4417
|
context.mixins.push(mixin);
|
|
4406
4418
|
}
|
|
4407
4419
|
else {
|
|
4408
|
-
warn
|
|
4420
|
+
warn('Mixin has already been applied to target app' +
|
|
4409
4421
|
(mixin.name ? `: ${mixin.name}` : ''));
|
|
4410
4422
|
}
|
|
4411
4423
|
}
|
|
@@ -4419,7 +4431,7 @@ function createAppAPI(render, hydrate) {
|
|
|
4419
4431
|
return context.components[name];
|
|
4420
4432
|
}
|
|
4421
4433
|
if (context.components[name]) {
|
|
4422
|
-
warn
|
|
4434
|
+
warn(`Component "${name}" has already been registered in target app.`);
|
|
4423
4435
|
}
|
|
4424
4436
|
context.components[name] = component;
|
|
4425
4437
|
return app;
|
|
@@ -4432,7 +4444,7 @@ function createAppAPI(render, hydrate) {
|
|
|
4432
4444
|
return context.directives[name];
|
|
4433
4445
|
}
|
|
4434
4446
|
if (context.directives[name]) {
|
|
4435
|
-
warn
|
|
4447
|
+
warn(`Directive "${name}" has already been registered in target app.`);
|
|
4436
4448
|
}
|
|
4437
4449
|
context.directives[name] = directive;
|
|
4438
4450
|
return app;
|
|
@@ -4441,7 +4453,7 @@ function createAppAPI(render, hydrate) {
|
|
|
4441
4453
|
if (!isMounted) {
|
|
4442
4454
|
// #5571
|
|
4443
4455
|
if (rootContainer.__vue_app__) {
|
|
4444
|
-
warn
|
|
4456
|
+
warn(`There is already an app instance mounted on the host container.\n` +
|
|
4445
4457
|
` If you want to mount another app on the same host container,` +
|
|
4446
4458
|
` you need to unmount the previous app by calling \`app.unmount()\` first.`);
|
|
4447
4459
|
}
|
|
@@ -4471,7 +4483,7 @@ function createAppAPI(render, hydrate) {
|
|
|
4471
4483
|
return getExposeProxy(vnode.component) || vnode.component.proxy;
|
|
4472
4484
|
}
|
|
4473
4485
|
else {
|
|
4474
|
-
warn
|
|
4486
|
+
warn(`App has already been mounted.\n` +
|
|
4475
4487
|
`If you want to remount the same app, move your app creation logic ` +
|
|
4476
4488
|
`into a factory function and create fresh app instances for each ` +
|
|
4477
4489
|
`mount - e.g. \`const createMyApp = () => createApp(App)\``);
|
|
@@ -4487,12 +4499,12 @@ function createAppAPI(render, hydrate) {
|
|
|
4487
4499
|
delete app._container.__vue_app__;
|
|
4488
4500
|
}
|
|
4489
4501
|
else {
|
|
4490
|
-
warn
|
|
4502
|
+
warn(`Cannot unmount an app that is not mounted.`);
|
|
4491
4503
|
}
|
|
4492
4504
|
},
|
|
4493
4505
|
provide(key, value) {
|
|
4494
4506
|
if (key in context.provides) {
|
|
4495
|
-
warn
|
|
4507
|
+
warn(`App already provides property with key "${String(key)}". ` +
|
|
4496
4508
|
`It will be overwritten with the new value.`);
|
|
4497
4509
|
}
|
|
4498
4510
|
context.provides[key] = value;
|
|
@@ -4522,7 +4534,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4522
4534
|
const value = isUnmount ? null : refValue;
|
|
4523
4535
|
const { i: owner, r: ref } = rawRef;
|
|
4524
4536
|
if (!owner) {
|
|
4525
|
-
warn
|
|
4537
|
+
warn(`Missing ref owner context. ref cannot be used on hoisted vnodes. ` +
|
|
4526
4538
|
`A vnode with ref must be created inside the render function.`);
|
|
4527
4539
|
return;
|
|
4528
4540
|
}
|
|
@@ -4589,7 +4601,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4589
4601
|
refs[rawRef.k] = value;
|
|
4590
4602
|
}
|
|
4591
4603
|
else {
|
|
4592
|
-
warn
|
|
4604
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
4593
4605
|
}
|
|
4594
4606
|
};
|
|
4595
4607
|
if (value) {
|
|
@@ -4601,7 +4613,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
4601
4613
|
}
|
|
4602
4614
|
}
|
|
4603
4615
|
else {
|
|
4604
|
-
warn
|
|
4616
|
+
warn('Invalid template ref type:', ref, `(${typeof ref})`);
|
|
4605
4617
|
}
|
|
4606
4618
|
}
|
|
4607
4619
|
}
|
|
@@ -4721,7 +4733,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4721
4733
|
type.process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals);
|
|
4722
4734
|
}
|
|
4723
4735
|
else {
|
|
4724
|
-
warn
|
|
4736
|
+
warn('Invalid VNode type:', type, `(${typeof type})`);
|
|
4725
4737
|
}
|
|
4726
4738
|
}
|
|
4727
4739
|
// set ref
|
|
@@ -4811,6 +4823,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4811
4823
|
if (dirs) {
|
|
4812
4824
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
4813
4825
|
}
|
|
4826
|
+
// scopeId
|
|
4827
|
+
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
4814
4828
|
// props
|
|
4815
4829
|
if (props) {
|
|
4816
4830
|
for (const key in props) {
|
|
@@ -4834,8 +4848,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4834
4848
|
invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
4835
4849
|
}
|
|
4836
4850
|
}
|
|
4837
|
-
// scopeId
|
|
4838
|
-
setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent);
|
|
4839
4851
|
{
|
|
4840
4852
|
Object.defineProperty(el, '__vnode', {
|
|
4841
4853
|
value: vnode,
|
|
@@ -4894,7 +4906,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4894
4906
|
for (let i = start; i < children.length; i++) {
|
|
4895
4907
|
const child = (children[i] = optimized
|
|
4896
4908
|
? cloneIfMounted(children[i])
|
|
4897
|
-
: normalizeVNode(children[i]));
|
|
4909
|
+
: normalizeVNode$1(children[i]));
|
|
4898
4910
|
patch(null, child, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
4899
4911
|
}
|
|
4900
4912
|
};
|
|
@@ -5116,7 +5128,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5116
5128
|
}
|
|
5117
5129
|
};
|
|
5118
5130
|
const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, isSVG, optimized) => {
|
|
5119
|
-
const instance = (initialVNode.component = createComponentInstance(initialVNode, parentComponent, parentSuspense));
|
|
5131
|
+
const instance = (initialVNode.component = createComponentInstance$1(initialVNode, parentComponent, parentSuspense));
|
|
5120
5132
|
if (instance.type.__hmrId) {
|
|
5121
5133
|
registerHMR(instance);
|
|
5122
5134
|
}
|
|
@@ -5133,7 +5145,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5133
5145
|
{
|
|
5134
5146
|
startMeasure(instance, `init`);
|
|
5135
5147
|
}
|
|
5136
|
-
setupComponent(instance);
|
|
5148
|
+
setupComponent$1(instance);
|
|
5137
5149
|
{
|
|
5138
5150
|
endMeasure(instance, `init`);
|
|
5139
5151
|
}
|
|
@@ -5212,7 +5224,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5212
5224
|
{
|
|
5213
5225
|
startMeasure(instance, `render`);
|
|
5214
5226
|
}
|
|
5215
|
-
instance.subTree = renderComponentRoot(instance);
|
|
5227
|
+
instance.subTree = renderComponentRoot$1(instance);
|
|
5216
5228
|
{
|
|
5217
5229
|
endMeasure(instance, `render`);
|
|
5218
5230
|
}
|
|
@@ -5240,7 +5252,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5240
5252
|
{
|
|
5241
5253
|
startMeasure(instance, `render`);
|
|
5242
5254
|
}
|
|
5243
|
-
const subTree = (instance.subTree = renderComponentRoot(instance));
|
|
5255
|
+
const subTree = (instance.subTree = renderComponentRoot$1(instance));
|
|
5244
5256
|
{
|
|
5245
5257
|
endMeasure(instance, `render`);
|
|
5246
5258
|
}
|
|
@@ -5311,7 +5323,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5311
5323
|
{
|
|
5312
5324
|
startMeasure(instance, `render`);
|
|
5313
5325
|
}
|
|
5314
|
-
const nextTree = renderComponentRoot(instance);
|
|
5326
|
+
const nextTree = renderComponentRoot$1(instance);
|
|
5315
5327
|
{
|
|
5316
5328
|
endMeasure(instance, `render`);
|
|
5317
5329
|
}
|
|
@@ -5447,7 +5459,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5447
5459
|
for (i = 0; i < commonLength; i++) {
|
|
5448
5460
|
const nextChild = (c2[i] = optimized
|
|
5449
5461
|
? cloneIfMounted(c2[i])
|
|
5450
|
-
: normalizeVNode(c2[i]));
|
|
5462
|
+
: normalizeVNode$1(c2[i]));
|
|
5451
5463
|
patch(c1[i], nextChild, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
5452
5464
|
}
|
|
5453
5465
|
if (oldLength > newLength) {
|
|
@@ -5472,7 +5484,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5472
5484
|
const n1 = c1[i];
|
|
5473
5485
|
const n2 = (c2[i] = optimized
|
|
5474
5486
|
? cloneIfMounted(c2[i])
|
|
5475
|
-
: normalizeVNode(c2[i]));
|
|
5487
|
+
: normalizeVNode$1(c2[i]));
|
|
5476
5488
|
if (isSameVNodeType(n1, n2)) {
|
|
5477
5489
|
patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
5478
5490
|
}
|
|
@@ -5488,7 +5500,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5488
5500
|
const n1 = c1[e1];
|
|
5489
5501
|
const n2 = (c2[e2] = optimized
|
|
5490
5502
|
? cloneIfMounted(c2[e2])
|
|
5491
|
-
: normalizeVNode(c2[e2]));
|
|
5503
|
+
: normalizeVNode$1(c2[e2]));
|
|
5492
5504
|
if (isSameVNodeType(n1, n2)) {
|
|
5493
5505
|
patch(n1, n2, container, null, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
5494
5506
|
}
|
|
@@ -5512,7 +5524,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5512
5524
|
while (i <= e2) {
|
|
5513
5525
|
patch(null, (c2[i] = optimized
|
|
5514
5526
|
? cloneIfMounted(c2[i])
|
|
5515
|
-
: normalizeVNode(c2[i])), container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
5527
|
+
: normalizeVNode$1(c2[i])), container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized);
|
|
5516
5528
|
i++;
|
|
5517
5529
|
}
|
|
5518
5530
|
}
|
|
@@ -5542,10 +5554,10 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5542
5554
|
for (i = s2; i <= e2; i++) {
|
|
5543
5555
|
const nextChild = (c2[i] = optimized
|
|
5544
5556
|
? cloneIfMounted(c2[i])
|
|
5545
|
-
: normalizeVNode(c2[i]));
|
|
5557
|
+
: normalizeVNode$1(c2[i]));
|
|
5546
5558
|
if (nextChild.key != null) {
|
|
5547
5559
|
if (keyToNewIndexMap.has(nextChild.key)) {
|
|
5548
|
-
warn
|
|
5560
|
+
warn(`Duplicate keys found during update:`, JSON.stringify(nextChild.key), `Make sure keys are unique.`);
|
|
5549
5561
|
}
|
|
5550
5562
|
keyToNewIndexMap.set(nextChild.key, i);
|
|
5551
5563
|
}
|
|
@@ -5928,6 +5940,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
5928
5940
|
if (!shallow)
|
|
5929
5941
|
traverseStaticChildren(c1, c2);
|
|
5930
5942
|
}
|
|
5943
|
+
// #6852 also inherit for text nodes
|
|
5944
|
+
if (c2.type === Text) {
|
|
5945
|
+
c2.el = c1.el;
|
|
5946
|
+
}
|
|
5931
5947
|
// also inherit for comment nodes, but not placeholders (e.g. v-if which
|
|
5932
5948
|
// would have received .el during block patch)
|
|
5933
5949
|
if (c2.type === Comment && !c2.el) {
|
|
@@ -5985,12 +6001,6 @@ const Fragment = Symbol('Fragment' );
|
|
|
5985
6001
|
const Text = Symbol('Text' );
|
|
5986
6002
|
const Comment = Symbol('Comment' );
|
|
5987
6003
|
const Static = Symbol('Static' );
|
|
5988
|
-
// Since v-if and v-for are the two possible ways node structure can dynamically
|
|
5989
|
-
// change, once we consider v-if branches and each v-for fragment a block, we
|
|
5990
|
-
// can divide a template into nested blocks, and within each block the node
|
|
5991
|
-
// structure would be stable. This allows us to skip most children diffing
|
|
5992
|
-
// and only worry about the dynamic nodes (indicated by patch flags).
|
|
5993
|
-
const blockStack = [];
|
|
5994
6004
|
let currentBlock = null;
|
|
5995
6005
|
// Whether we should be tracking dynamic child nodes inside a block.
|
|
5996
6006
|
// Only tracks when this value is > 0
|
|
@@ -6016,12 +6026,16 @@ let isBlockTreeEnabled = 1;
|
|
|
6016
6026
|
function setBlockTracking(value) {
|
|
6017
6027
|
isBlockTreeEnabled += value;
|
|
6018
6028
|
}
|
|
6019
|
-
function isVNode(value) {
|
|
6029
|
+
function isVNode$2(value) {
|
|
6020
6030
|
return value ? value.__v_isVNode === true : false;
|
|
6021
6031
|
}
|
|
6022
6032
|
function isSameVNodeType(n1, n2) {
|
|
6023
6033
|
if (n2.shapeFlag & 6 /* ShapeFlags.COMPONENT */ &&
|
|
6024
6034
|
hmrDirtyComponents.has(n2.type)) {
|
|
6035
|
+
// #7042, ensure the vnode being unmounted during HMR
|
|
6036
|
+
// bitwise operations to remove keep alive flags
|
|
6037
|
+
n1.shapeFlag &= ~256 /* ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
6038
|
+
n2.shapeFlag &= ~512 /* ShapeFlags.COMPONENT_KEPT_ALIVE */;
|
|
6025
6039
|
// HMR only: if the component has been hot-updated, force a reload.
|
|
6026
6040
|
return false;
|
|
6027
6041
|
}
|
|
@@ -6065,7 +6079,8 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
6065
6079
|
patchFlag,
|
|
6066
6080
|
dynamicProps,
|
|
6067
6081
|
dynamicChildren: null,
|
|
6068
|
-
appContext: null
|
|
6082
|
+
appContext: null,
|
|
6083
|
+
ctx: currentRenderingInstance
|
|
6069
6084
|
};
|
|
6070
6085
|
if (needFullChildrenNormalization) {
|
|
6071
6086
|
normalizeChildren(vnode, children);
|
|
@@ -6083,7 +6098,7 @@ function createBaseVNode(type, props = null, children = null, patchFlag = 0, dyn
|
|
|
6083
6098
|
}
|
|
6084
6099
|
// validate key
|
|
6085
6100
|
if (vnode.key !== vnode.key) {
|
|
6086
|
-
warn
|
|
6101
|
+
warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type);
|
|
6087
6102
|
}
|
|
6088
6103
|
// track vnode for block tree
|
|
6089
6104
|
if (isBlockTreeEnabled > 0 &&
|
|
@@ -6107,11 +6122,11 @@ const createVNode = (createVNodeWithArgsTransform );
|
|
|
6107
6122
|
function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) {
|
|
6108
6123
|
if (!type || type === NULL_DYNAMIC_COMPONENT) {
|
|
6109
6124
|
if (!type) {
|
|
6110
|
-
warn
|
|
6125
|
+
warn(`Invalid vnode type when creating vnode: ${type}.`);
|
|
6111
6126
|
}
|
|
6112
6127
|
type = Comment;
|
|
6113
6128
|
}
|
|
6114
|
-
if (isVNode(type)) {
|
|
6129
|
+
if (isVNode$2(type)) {
|
|
6115
6130
|
// createVNode receiving an existing vnode. This happens in cases like
|
|
6116
6131
|
// <component :is="vnode"/>
|
|
6117
6132
|
// #2078 make sure to merge refs during the clone instead of overwriting it
|
|
@@ -6165,7 +6180,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
6165
6180
|
: 0;
|
|
6166
6181
|
if (shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */ && isProxy(type)) {
|
|
6167
6182
|
type = toRaw(type);
|
|
6168
|
-
warn
|
|
6183
|
+
warn(`Vue received a Component which was made a reactive object. This can ` +
|
|
6169
6184
|
`lead to unnecessary performance overhead, and should be avoided by ` +
|
|
6170
6185
|
`marking the component with \`markRaw\` or using \`shallowRef\` ` +
|
|
6171
6186
|
`instead of \`ref\`.`, `\nComponent that was made reactive: `, type);
|
|
@@ -6232,7 +6247,9 @@ function cloneVNode(vnode, extraProps, mergeRef = false) {
|
|
|
6232
6247
|
ssContent: vnode.ssContent && cloneVNode(vnode.ssContent),
|
|
6233
6248
|
ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback),
|
|
6234
6249
|
el: vnode.el,
|
|
6235
|
-
anchor: vnode.anchor
|
|
6250
|
+
anchor: vnode.anchor,
|
|
6251
|
+
ctx: vnode.ctx,
|
|
6252
|
+
ce: vnode.ce
|
|
6236
6253
|
};
|
|
6237
6254
|
return cloned;
|
|
6238
6255
|
}
|
|
@@ -6253,7 +6270,7 @@ function deepCloneVNode(vnode) {
|
|
|
6253
6270
|
function createTextVNode(text = ' ', flag = 0) {
|
|
6254
6271
|
return createVNode(Text, null, text, flag);
|
|
6255
6272
|
}
|
|
6256
|
-
function normalizeVNode(child) {
|
|
6273
|
+
function normalizeVNode$1(child) {
|
|
6257
6274
|
if (child == null || typeof child === 'boolean') {
|
|
6258
6275
|
// empty placeholder
|
|
6259
6276
|
return createVNode(Comment);
|
|
@@ -6378,13 +6395,13 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
6378
6395
|
}
|
|
6379
6396
|
|
|
6380
6397
|
const emptyAppContext = createAppContext();
|
|
6381
|
-
let uid
|
|
6382
|
-
function createComponentInstance(vnode, parent, suspense) {
|
|
6398
|
+
let uid = 0;
|
|
6399
|
+
function createComponentInstance$1(vnode, parent, suspense) {
|
|
6383
6400
|
const type = vnode.type;
|
|
6384
6401
|
// inherit parent app context - or - if root, adopt from root vnode
|
|
6385
6402
|
const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext;
|
|
6386
6403
|
const instance = {
|
|
6387
|
-
uid: uid
|
|
6404
|
+
uid: uid++,
|
|
6388
6405
|
vnode,
|
|
6389
6406
|
type,
|
|
6390
6407
|
parent,
|
|
@@ -6454,7 +6471,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
6454
6471
|
instance.ctx = createDevRenderContext(instance);
|
|
6455
6472
|
}
|
|
6456
6473
|
instance.root = parent ? parent.root : instance;
|
|
6457
|
-
instance.emit = emit
|
|
6474
|
+
instance.emit = emit.bind(null, instance);
|
|
6458
6475
|
// apply custom element special handling
|
|
6459
6476
|
if (vnode.ce) {
|
|
6460
6477
|
vnode.ce(instance);
|
|
@@ -6474,14 +6491,14 @@ const isBuiltInTag = /*#__PURE__*/ makeMap('slot,component');
|
|
|
6474
6491
|
function validateComponentName(name, config) {
|
|
6475
6492
|
const appIsNativeTag = config.isNativeTag || NO;
|
|
6476
6493
|
if (isBuiltInTag(name) || appIsNativeTag(name)) {
|
|
6477
|
-
warn
|
|
6494
|
+
warn('Do not use built-in or reserved HTML elements as component id: ' + name);
|
|
6478
6495
|
}
|
|
6479
6496
|
}
|
|
6480
6497
|
function isStatefulComponent(instance) {
|
|
6481
6498
|
return instance.vnode.shapeFlag & 4 /* ShapeFlags.STATEFUL_COMPONENT */;
|
|
6482
6499
|
}
|
|
6483
6500
|
let isInSSRComponentSetup = false;
|
|
6484
|
-
function setupComponent(instance, isSSR = false) {
|
|
6501
|
+
function setupComponent$1(instance, isSSR = false) {
|
|
6485
6502
|
isInSSRComponentSetup = isSSR;
|
|
6486
6503
|
const { props, children } = instance.vnode;
|
|
6487
6504
|
const isStateful = isStatefulComponent(instance);
|
|
@@ -6513,7 +6530,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6513
6530
|
}
|
|
6514
6531
|
}
|
|
6515
6532
|
if (Component.compilerOptions && isRuntimeOnly()) {
|
|
6516
|
-
warn
|
|
6533
|
+
warn(`"compilerOptions" is only supported when using a build of Vue that ` +
|
|
6517
6534
|
`includes the runtime compiler. Since you are using a runtime-only ` +
|
|
6518
6535
|
`build, the options should be passed via your build tool config instead.`);
|
|
6519
6536
|
}
|
|
@@ -6554,7 +6571,7 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6554
6571
|
instance.asyncDep = setupResult;
|
|
6555
6572
|
if (!instance.suspense) {
|
|
6556
6573
|
const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
|
|
6557
|
-
warn
|
|
6574
|
+
warn(`Component <${name}>: setup function returned a promise, but no ` +
|
|
6558
6575
|
`<Suspense> boundary was found in the parent component tree. ` +
|
|
6559
6576
|
`A component with async setup() must be nested in a <Suspense> ` +
|
|
6560
6577
|
`in order to be rendered.`);
|
|
@@ -6582,8 +6599,8 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
6582
6599
|
}
|
|
6583
6600
|
}
|
|
6584
6601
|
else if (isObject(setupResult)) {
|
|
6585
|
-
if (isVNode(setupResult)) {
|
|
6586
|
-
warn
|
|
6602
|
+
if (isVNode$2(setupResult)) {
|
|
6603
|
+
warn(`setup() should not return VNodes directly - ` +
|
|
6587
6604
|
`return a render function instead.`);
|
|
6588
6605
|
}
|
|
6589
6606
|
// setup returned bindings.
|
|
@@ -6597,7 +6614,7 @@ function handleSetupResult(instance, setupResult, isSSR) {
|
|
|
6597
6614
|
}
|
|
6598
6615
|
}
|
|
6599
6616
|
else if (setupResult !== undefined) {
|
|
6600
|
-
warn
|
|
6617
|
+
warn(`setup() should return an object. Received: ${setupResult === null ? 'null' : typeof setupResult}`);
|
|
6601
6618
|
}
|
|
6602
6619
|
finishComponentSetup(instance, isSSR);
|
|
6603
6620
|
}
|
|
@@ -6620,11 +6637,11 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
6620
6637
|
}
|
|
6621
6638
|
const { isCustomElement, compilerOptions } = instance.appContext.config;
|
|
6622
6639
|
const { delimiters, compilerOptions: componentCompilerOptions } = Component;
|
|
6623
|
-
extend(extend({
|
|
6640
|
+
const finalCompilerOptions = extend(extend({
|
|
6624
6641
|
isCustomElement,
|
|
6625
6642
|
delimiters
|
|
6626
6643
|
}, compilerOptions), componentCompilerOptions);
|
|
6627
|
-
Component.render = compile();
|
|
6644
|
+
Component.render = compile(template, finalCompilerOptions);
|
|
6628
6645
|
{
|
|
6629
6646
|
endMeasure(instance, `compile`);
|
|
6630
6647
|
}
|
|
@@ -6645,13 +6662,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
6645
6662
|
if (!Component.render && instance.render === NOOP && !isSSR) {
|
|
6646
6663
|
/* istanbul ignore if */
|
|
6647
6664
|
if (Component.template) {
|
|
6648
|
-
warn
|
|
6665
|
+
warn(`Component provided template option but ` +
|
|
6649
6666
|
`runtime compilation is not supported in this build of Vue.` +
|
|
6650
6667
|
(` Use "vue.esm-browser.js" instead.`
|
|
6651
6668
|
) /* should not happen */);
|
|
6652
6669
|
}
|
|
6653
6670
|
else {
|
|
6654
|
-
warn
|
|
6671
|
+
warn(`Component is missing template or render function.`);
|
|
6655
6672
|
}
|
|
6656
6673
|
}
|
|
6657
6674
|
}
|
|
@@ -6663,11 +6680,11 @@ function createAttrsProxy(instance) {
|
|
|
6663
6680
|
return target[key];
|
|
6664
6681
|
},
|
|
6665
6682
|
set() {
|
|
6666
|
-
warn
|
|
6683
|
+
warn(`setupContext.attrs is readonly.`);
|
|
6667
6684
|
return false;
|
|
6668
6685
|
},
|
|
6669
6686
|
deleteProperty() {
|
|
6670
|
-
warn
|
|
6687
|
+
warn(`setupContext.attrs is readonly.`);
|
|
6671
6688
|
return false;
|
|
6672
6689
|
}
|
|
6673
6690
|
}
|
|
@@ -6675,8 +6692,24 @@ function createAttrsProxy(instance) {
|
|
|
6675
6692
|
}
|
|
6676
6693
|
function createSetupContext(instance) {
|
|
6677
6694
|
const expose = exposed => {
|
|
6678
|
-
|
|
6679
|
-
|
|
6695
|
+
{
|
|
6696
|
+
if (instance.exposed) {
|
|
6697
|
+
warn(`expose() should be called only once per setup().`);
|
|
6698
|
+
}
|
|
6699
|
+
if (exposed != null) {
|
|
6700
|
+
let exposedType = typeof exposed;
|
|
6701
|
+
if (exposedType === 'object') {
|
|
6702
|
+
if (isArray(exposed)) {
|
|
6703
|
+
exposedType = 'array';
|
|
6704
|
+
}
|
|
6705
|
+
else if (isRef(exposed)) {
|
|
6706
|
+
exposedType = 'ref';
|
|
6707
|
+
}
|
|
6708
|
+
}
|
|
6709
|
+
if (exposedType !== 'object') {
|
|
6710
|
+
warn(`expose() should be passed a plain object, received ${exposedType}.`);
|
|
6711
|
+
}
|
|
6712
|
+
}
|
|
6680
6713
|
}
|
|
6681
6714
|
instance.exposed = exposed || {};
|
|
6682
6715
|
};
|
|
@@ -6751,9 +6784,9 @@ function isClassComponent(value) {
|
|
|
6751
6784
|
return isFunction(value) && '__vccOpts' in value;
|
|
6752
6785
|
}
|
|
6753
6786
|
|
|
6754
|
-
const computed
|
|
6787
|
+
const computed = ((getterOrOptions, debugOptions) => {
|
|
6755
6788
|
// @ts-ignore
|
|
6756
|
-
return computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
6789
|
+
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
6757
6790
|
});
|
|
6758
6791
|
|
|
6759
6792
|
const ssrContextKey = Symbol(`ssrContext` );
|
|
@@ -6761,7 +6794,7 @@ const useSSRContext = () => {
|
|
|
6761
6794
|
{
|
|
6762
6795
|
const ctx = inject(ssrContextKey);
|
|
6763
6796
|
if (!ctx) {
|
|
6764
|
-
warn
|
|
6797
|
+
warn(`Server rendering context not provided. Make sure to only call ` +
|
|
6765
6798
|
`useSSRContext() conditionally in the server build.`);
|
|
6766
6799
|
}
|
|
6767
6800
|
return ctx;
|
|
@@ -6769,14 +6802,14 @@ const useSSRContext = () => {
|
|
|
6769
6802
|
};
|
|
6770
6803
|
|
|
6771
6804
|
// Core API ------------------------------------------------------------------
|
|
6772
|
-
const version = "3.2.
|
|
6805
|
+
const version = "3.2.46";
|
|
6773
6806
|
const _ssrUtils = {
|
|
6774
|
-
createComponentInstance,
|
|
6775
|
-
setupComponent,
|
|
6776
|
-
renderComponentRoot,
|
|
6777
|
-
setCurrentRenderingInstance,
|
|
6778
|
-
isVNode,
|
|
6779
|
-
normalizeVNode
|
|
6807
|
+
createComponentInstance: createComponentInstance$1,
|
|
6808
|
+
setupComponent: setupComponent$1,
|
|
6809
|
+
renderComponentRoot: renderComponentRoot$1,
|
|
6810
|
+
setCurrentRenderingInstance: setCurrentRenderingInstance$1,
|
|
6811
|
+
isVNode: isVNode$2,
|
|
6812
|
+
normalizeVNode: normalizeVNode$1
|
|
6780
6813
|
};
|
|
6781
6814
|
/**
|
|
6782
6815
|
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
@@ -6886,9 +6919,6 @@ function patchStyle(el, prev, next) {
|
|
|
6886
6919
|
const style = el.style;
|
|
6887
6920
|
const isCssString = isString(next);
|
|
6888
6921
|
if (next && !isCssString) {
|
|
6889
|
-
for (const key in next) {
|
|
6890
|
-
setStyle(style, key, next[key]);
|
|
6891
|
-
}
|
|
6892
6922
|
if (prev && !isString(prev)) {
|
|
6893
6923
|
for (const key in prev) {
|
|
6894
6924
|
if (next[key] == null) {
|
|
@@ -6896,6 +6926,9 @@ function patchStyle(el, prev, next) {
|
|
|
6896
6926
|
}
|
|
6897
6927
|
}
|
|
6898
6928
|
}
|
|
6929
|
+
for (const key in next) {
|
|
6930
|
+
setStyle(style, key, next[key]);
|
|
6931
|
+
}
|
|
6899
6932
|
}
|
|
6900
6933
|
else {
|
|
6901
6934
|
const currentDisplay = style.display;
|
|
@@ -6926,7 +6959,7 @@ function setStyle(style, name, val) {
|
|
|
6926
6959
|
val = '';
|
|
6927
6960
|
{
|
|
6928
6961
|
if (semicolonRE.test(val)) {
|
|
6929
|
-
warn
|
|
6962
|
+
warn(`Unexpected semicolon at the end of '${name}' style value: '${val}'`);
|
|
6930
6963
|
}
|
|
6931
6964
|
}
|
|
6932
6965
|
if (name.startsWith('--')) {
|
|
@@ -7050,7 +7083,7 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
7050
7083
|
catch (e) {
|
|
7051
7084
|
// do not warn if value is auto-coerced from nullish values
|
|
7052
7085
|
if (!needRemove) {
|
|
7053
|
-
warn
|
|
7086
|
+
warn(`Failed setting prop "${key}" on <${el.tagName.toLowerCase()}>: ` +
|
|
7054
7087
|
`value ${value} is invalid.`, e);
|
|
7055
7088
|
}
|
|
7056
7089
|
}
|
|
@@ -7221,6 +7254,138 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
7221
7254
|
return key in el;
|
|
7222
7255
|
}
|
|
7223
7256
|
|
|
7257
|
+
const getModelAssigner = (vnode) => {
|
|
7258
|
+
const fn = vnode.props['onUpdate:modelValue'] ||
|
|
7259
|
+
(false );
|
|
7260
|
+
return isArray(fn) ? value => invokeArrayFns(fn, value) : fn;
|
|
7261
|
+
};
|
|
7262
|
+
function onCompositionStart(e) {
|
|
7263
|
+
e.target.composing = true;
|
|
7264
|
+
}
|
|
7265
|
+
function onCompositionEnd(e) {
|
|
7266
|
+
const target = e.target;
|
|
7267
|
+
if (target.composing) {
|
|
7268
|
+
target.composing = false;
|
|
7269
|
+
target.dispatchEvent(new Event('input'));
|
|
7270
|
+
}
|
|
7271
|
+
}
|
|
7272
|
+
// We are exporting the v-model runtime directly as vnode hooks so that it can
|
|
7273
|
+
// be tree-shaken in case v-model is never used.
|
|
7274
|
+
const vModelText = {
|
|
7275
|
+
created(el, { modifiers: { lazy, trim, number } }, vnode) {
|
|
7276
|
+
el._assign = getModelAssigner(vnode);
|
|
7277
|
+
const castToNumber = number || (vnode.props && vnode.props.type === 'number');
|
|
7278
|
+
addEventListener(el, lazy ? 'change' : 'input', e => {
|
|
7279
|
+
if (e.target.composing)
|
|
7280
|
+
return;
|
|
7281
|
+
let domValue = el.value;
|
|
7282
|
+
if (trim) {
|
|
7283
|
+
domValue = domValue.trim();
|
|
7284
|
+
}
|
|
7285
|
+
if (castToNumber) {
|
|
7286
|
+
domValue = looseToNumber(domValue);
|
|
7287
|
+
}
|
|
7288
|
+
el._assign(domValue);
|
|
7289
|
+
});
|
|
7290
|
+
if (trim) {
|
|
7291
|
+
addEventListener(el, 'change', () => {
|
|
7292
|
+
el.value = el.value.trim();
|
|
7293
|
+
});
|
|
7294
|
+
}
|
|
7295
|
+
if (!lazy) {
|
|
7296
|
+
addEventListener(el, 'compositionstart', onCompositionStart);
|
|
7297
|
+
addEventListener(el, 'compositionend', onCompositionEnd);
|
|
7298
|
+
// Safari < 10.2 & UIWebView doesn't fire compositionend when
|
|
7299
|
+
// switching focus before confirming composition choice
|
|
7300
|
+
// this also fixes the issue where some browsers e.g. iOS Chrome
|
|
7301
|
+
// fires "change" instead of "input" on autocomplete.
|
|
7302
|
+
addEventListener(el, 'change', onCompositionEnd);
|
|
7303
|
+
}
|
|
7304
|
+
},
|
|
7305
|
+
// set value on mounted so it's after min/max for type="range"
|
|
7306
|
+
mounted(el, { value }) {
|
|
7307
|
+
el.value = value == null ? '' : value;
|
|
7308
|
+
},
|
|
7309
|
+
beforeUpdate(el, { value, modifiers: { lazy, trim, number } }, vnode) {
|
|
7310
|
+
el._assign = getModelAssigner(vnode);
|
|
7311
|
+
// avoid clearing unresolved text. #2302
|
|
7312
|
+
if (el.composing)
|
|
7313
|
+
return;
|
|
7314
|
+
if (document.activeElement === el && el.type !== 'range') {
|
|
7315
|
+
if (lazy) {
|
|
7316
|
+
return;
|
|
7317
|
+
}
|
|
7318
|
+
if (trim && el.value.trim() === value) {
|
|
7319
|
+
return;
|
|
7320
|
+
}
|
|
7321
|
+
if ((number || el.type === 'number') &&
|
|
7322
|
+
looseToNumber(el.value) === value) {
|
|
7323
|
+
return;
|
|
7324
|
+
}
|
|
7325
|
+
}
|
|
7326
|
+
const newValue = value == null ? '' : value;
|
|
7327
|
+
if (el.value !== newValue) {
|
|
7328
|
+
el.value = newValue;
|
|
7329
|
+
}
|
|
7330
|
+
}
|
|
7331
|
+
};
|
|
7332
|
+
// SSR vnode transforms, only used when user includes client-oriented render
|
|
7333
|
+
// function in SSR
|
|
7334
|
+
function initVModelForSSR() {
|
|
7335
|
+
vModelText.getSSRProps = ({ value }) => ({ value });
|
|
7336
|
+
}
|
|
7337
|
+
|
|
7338
|
+
const vShow = {
|
|
7339
|
+
beforeMount(el, { value }, { transition }) {
|
|
7340
|
+
el._vod = el.style.display === 'none' ? '' : el.style.display;
|
|
7341
|
+
if (transition && value) {
|
|
7342
|
+
transition.beforeEnter(el);
|
|
7343
|
+
}
|
|
7344
|
+
else {
|
|
7345
|
+
setDisplay(el, value);
|
|
7346
|
+
}
|
|
7347
|
+
},
|
|
7348
|
+
mounted(el, { value }, { transition }) {
|
|
7349
|
+
if (transition && value) {
|
|
7350
|
+
transition.enter(el);
|
|
7351
|
+
}
|
|
7352
|
+
},
|
|
7353
|
+
updated(el, { value, oldValue }, { transition }) {
|
|
7354
|
+
if (!value === !oldValue)
|
|
7355
|
+
return;
|
|
7356
|
+
if (transition) {
|
|
7357
|
+
if (value) {
|
|
7358
|
+
transition.beforeEnter(el);
|
|
7359
|
+
setDisplay(el, true);
|
|
7360
|
+
transition.enter(el);
|
|
7361
|
+
}
|
|
7362
|
+
else {
|
|
7363
|
+
transition.leave(el, () => {
|
|
7364
|
+
setDisplay(el, false);
|
|
7365
|
+
});
|
|
7366
|
+
}
|
|
7367
|
+
}
|
|
7368
|
+
else {
|
|
7369
|
+
setDisplay(el, value);
|
|
7370
|
+
}
|
|
7371
|
+
},
|
|
7372
|
+
beforeUnmount(el, { value }) {
|
|
7373
|
+
setDisplay(el, value);
|
|
7374
|
+
}
|
|
7375
|
+
};
|
|
7376
|
+
function setDisplay(el, value) {
|
|
7377
|
+
el.style.display = value ? el._vod : 'none';
|
|
7378
|
+
}
|
|
7379
|
+
// SSR vnode transforms, only used when user includes client-oriented render
|
|
7380
|
+
// function in SSR
|
|
7381
|
+
function initVShowForSSR() {
|
|
7382
|
+
vShow.getSSRProps = ({ value }) => {
|
|
7383
|
+
if (!value) {
|
|
7384
|
+
return { style: { display: 'none' } };
|
|
7385
|
+
}
|
|
7386
|
+
};
|
|
7387
|
+
}
|
|
7388
|
+
|
|
7224
7389
|
const rendererOptions = /*#__PURE__*/ extend({ patchProp }, nodeOps);
|
|
7225
7390
|
// lazy create the renderer - this makes core renderer logic tree-shakable
|
|
7226
7391
|
// in case the user only imports reactivity utilities from Vue.
|
|
@@ -7276,7 +7441,7 @@ function injectCompilerOptionsCheck(app) {
|
|
|
7276
7441
|
return isCustomElement;
|
|
7277
7442
|
},
|
|
7278
7443
|
set() {
|
|
7279
|
-
warn
|
|
7444
|
+
warn(`The \`isCustomElement\` config option is deprecated. Use ` +
|
|
7280
7445
|
`\`compilerOptions.isCustomElement\` instead.`);
|
|
7281
7446
|
}
|
|
7282
7447
|
});
|
|
@@ -7290,11 +7455,11 @@ function injectCompilerOptionsCheck(app) {
|
|
|
7290
7455
|
`- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom`;
|
|
7291
7456
|
Object.defineProperty(app.config, 'compilerOptions', {
|
|
7292
7457
|
get() {
|
|
7293
|
-
warn
|
|
7458
|
+
warn(msg);
|
|
7294
7459
|
return compilerOptions;
|
|
7295
7460
|
},
|
|
7296
7461
|
set() {
|
|
7297
|
-
warn
|
|
7462
|
+
warn(msg);
|
|
7298
7463
|
}
|
|
7299
7464
|
});
|
|
7300
7465
|
}
|
|
@@ -7303,17 +7468,29 @@ function normalizeContainer(container) {
|
|
|
7303
7468
|
if (isString(container)) {
|
|
7304
7469
|
const res = document.querySelector(container);
|
|
7305
7470
|
if (!res) {
|
|
7306
|
-
warn
|
|
7471
|
+
warn(`Failed to mount app: mount target selector "${container}" returned null.`);
|
|
7307
7472
|
}
|
|
7308
7473
|
return res;
|
|
7309
7474
|
}
|
|
7310
7475
|
if (window.ShadowRoot &&
|
|
7311
7476
|
container instanceof window.ShadowRoot &&
|
|
7312
7477
|
container.mode === 'closed') {
|
|
7313
|
-
warn
|
|
7478
|
+
warn(`mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs`);
|
|
7314
7479
|
}
|
|
7315
7480
|
return container;
|
|
7316
7481
|
}
|
|
7482
|
+
let ssrDirectiveInitialized = false;
|
|
7483
|
+
/**
|
|
7484
|
+
* @internal
|
|
7485
|
+
*/
|
|
7486
|
+
const initDirectivesForSSR = () => {
|
|
7487
|
+
if (!ssrDirectiveInitialized) {
|
|
7488
|
+
ssrDirectiveInitialized = true;
|
|
7489
|
+
initVModelForSSR();
|
|
7490
|
+
initVShowForSSR();
|
|
7491
|
+
}
|
|
7492
|
+
}
|
|
7493
|
+
;
|
|
7317
7494
|
|
|
7318
7495
|
// leading comma for empty string ""
|
|
7319
7496
|
const shouldIgnoreProp = makeMap(`,key,ref,innerHTML,textContent,ref_key,ref_for`);
|
|
@@ -7386,13 +7563,69 @@ function ssrRenderStyle(raw) {
|
|
|
7386
7563
|
return escapeHtml(stringifyStyle(styles));
|
|
7387
7564
|
}
|
|
7388
7565
|
|
|
7389
|
-
function
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7566
|
+
function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
|
|
7567
|
+
return renderComponentVNode(createVNode(comp, props, children), parentComponent, slotScopeId);
|
|
7568
|
+
}
|
|
7569
|
+
|
|
7570
|
+
function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) {
|
|
7571
|
+
// template-compiled slots are always rendered as fragments
|
|
7572
|
+
push(`<!--[-->`);
|
|
7573
|
+
ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId);
|
|
7574
|
+
push(`<!--]-->`);
|
|
7575
|
+
}
|
|
7576
|
+
function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) {
|
|
7577
|
+
const slotFn = slots[slotName];
|
|
7578
|
+
if (slotFn) {
|
|
7579
|
+
const slotBuffer = [];
|
|
7580
|
+
const bufferedPush = (item) => {
|
|
7581
|
+
slotBuffer.push(item);
|
|
7582
|
+
};
|
|
7583
|
+
const ret = slotFn(slotProps, bufferedPush, parentComponent, slotScopeId ? ' ' + slotScopeId : '');
|
|
7584
|
+
if (isArray(ret)) {
|
|
7585
|
+
// normal slot
|
|
7586
|
+
renderVNodeChildren(push, ret, parentComponent, slotScopeId);
|
|
7587
|
+
}
|
|
7588
|
+
else {
|
|
7589
|
+
// ssr slot.
|
|
7590
|
+
// check if the slot renders all comments, in which case use the fallback
|
|
7591
|
+
let isEmptySlot = true;
|
|
7592
|
+
if (transition) {
|
|
7593
|
+
isEmptySlot = false;
|
|
7594
|
+
}
|
|
7595
|
+
else {
|
|
7596
|
+
for (let i = 0; i < slotBuffer.length; i++) {
|
|
7597
|
+
if (!isComment(slotBuffer[i])) {
|
|
7598
|
+
isEmptySlot = false;
|
|
7599
|
+
break;
|
|
7600
|
+
}
|
|
7601
|
+
}
|
|
7602
|
+
}
|
|
7603
|
+
if (isEmptySlot) {
|
|
7604
|
+
if (fallbackRenderFn) {
|
|
7605
|
+
fallbackRenderFn();
|
|
7606
|
+
}
|
|
7607
|
+
}
|
|
7608
|
+
else {
|
|
7609
|
+
for (let i = 0; i < slotBuffer.length; i++) {
|
|
7610
|
+
push(slotBuffer[i]);
|
|
7611
|
+
}
|
|
7612
|
+
}
|
|
7613
|
+
}
|
|
7614
|
+
}
|
|
7615
|
+
else if (fallbackRenderFn) {
|
|
7616
|
+
fallbackRenderFn();
|
|
7394
7617
|
}
|
|
7395
7618
|
}
|
|
7619
|
+
const commentTestRE = /^<!--.*-->$/s;
|
|
7620
|
+
const commentRE = /<!--[^]*?-->/gm;
|
|
7621
|
+
function isComment(item) {
|
|
7622
|
+
if (typeof item !== 'string' || !commentTestRE.test(item))
|
|
7623
|
+
return false;
|
|
7624
|
+
// if item is '<!---->' or '<!--[-->' or '<!--]-->', return true directly
|
|
7625
|
+
if (item.length <= 8)
|
|
7626
|
+
return true;
|
|
7627
|
+
return !item.replace(commentRE, '').trim();
|
|
7628
|
+
}
|
|
7396
7629
|
|
|
7397
7630
|
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
|
|
7398
7631
|
parentPush('<!--teleport start-->');
|
|
@@ -7417,7 +7650,109 @@ function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parent
|
|
|
7417
7650
|
parentPush('<!--teleport end-->');
|
|
7418
7651
|
}
|
|
7419
7652
|
|
|
7420
|
-
|
|
7653
|
+
function ssrInterpolate(value) {
|
|
7654
|
+
return escapeHtml(toDisplayString(value));
|
|
7655
|
+
}
|
|
7656
|
+
|
|
7657
|
+
function ssrRenderList(source, renderItem) {
|
|
7658
|
+
if (isArray(source) || isString(source)) {
|
|
7659
|
+
for (let i = 0, l = source.length; i < l; i++) {
|
|
7660
|
+
renderItem(source[i], i);
|
|
7661
|
+
}
|
|
7662
|
+
}
|
|
7663
|
+
else if (typeof source === 'number') {
|
|
7664
|
+
if (!Number.isInteger(source)) {
|
|
7665
|
+
warn(`The v-for range expect an integer value but got ${source}.`);
|
|
7666
|
+
return;
|
|
7667
|
+
}
|
|
7668
|
+
for (let i = 0; i < source; i++) {
|
|
7669
|
+
renderItem(i + 1, i);
|
|
7670
|
+
}
|
|
7671
|
+
}
|
|
7672
|
+
else if (isObject(source)) {
|
|
7673
|
+
if (source[Symbol.iterator]) {
|
|
7674
|
+
const arr = Array.from(source);
|
|
7675
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
7676
|
+
renderItem(arr[i], i);
|
|
7677
|
+
}
|
|
7678
|
+
}
|
|
7679
|
+
else {
|
|
7680
|
+
const keys = Object.keys(source);
|
|
7681
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
7682
|
+
const key = keys[i];
|
|
7683
|
+
renderItem(source[key], key, i);
|
|
7684
|
+
}
|
|
7685
|
+
}
|
|
7686
|
+
}
|
|
7687
|
+
}
|
|
7688
|
+
|
|
7689
|
+
async function ssrRenderSuspense(push, { default: renderContent }) {
|
|
7690
|
+
if (renderContent) {
|
|
7691
|
+
renderContent();
|
|
7692
|
+
}
|
|
7693
|
+
else {
|
|
7694
|
+
push(`<!---->`);
|
|
7695
|
+
}
|
|
7696
|
+
}
|
|
7697
|
+
|
|
7698
|
+
function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) {
|
|
7699
|
+
if (typeof dir !== 'function' && dir.getSSRProps) {
|
|
7700
|
+
return (dir.getSSRProps({
|
|
7701
|
+
dir,
|
|
7702
|
+
instance,
|
|
7703
|
+
value,
|
|
7704
|
+
oldValue: undefined,
|
|
7705
|
+
arg,
|
|
7706
|
+
modifiers
|
|
7707
|
+
}, null) || {});
|
|
7708
|
+
}
|
|
7709
|
+
return {};
|
|
7710
|
+
}
|
|
7711
|
+
|
|
7712
|
+
const ssrLooseEqual = looseEqual;
|
|
7713
|
+
function ssrLooseContain(arr, value) {
|
|
7714
|
+
return looseIndexOf(arr, value) > -1;
|
|
7715
|
+
}
|
|
7716
|
+
// for <input :type="type" v-model="model" value="value">
|
|
7717
|
+
function ssrRenderDynamicModel(type, model, value) {
|
|
7718
|
+
switch (type) {
|
|
7719
|
+
case 'radio':
|
|
7720
|
+
return looseEqual(model, value) ? ' checked' : '';
|
|
7721
|
+
case 'checkbox':
|
|
7722
|
+
return (isArray(model) ? ssrLooseContain(model, value) : model)
|
|
7723
|
+
? ' checked'
|
|
7724
|
+
: '';
|
|
7725
|
+
default:
|
|
7726
|
+
// text types
|
|
7727
|
+
return ssrRenderAttr('value', model);
|
|
7728
|
+
}
|
|
7729
|
+
}
|
|
7730
|
+
// for <input v-bind="obj" v-model="model">
|
|
7731
|
+
function ssrGetDynamicModelProps(existingProps = {}, model) {
|
|
7732
|
+
const { type, value } = existingProps;
|
|
7733
|
+
switch (type) {
|
|
7734
|
+
case 'radio':
|
|
7735
|
+
return looseEqual(model, value) ? { checked: true } : null;
|
|
7736
|
+
case 'checkbox':
|
|
7737
|
+
return (isArray(model) ? ssrLooseContain(model, value) : model)
|
|
7738
|
+
? { checked: true }
|
|
7739
|
+
: null;
|
|
7740
|
+
default:
|
|
7741
|
+
// text types
|
|
7742
|
+
return { value: model };
|
|
7743
|
+
}
|
|
7744
|
+
}
|
|
7745
|
+
|
|
7746
|
+
function ssrCompile(template, instance) {
|
|
7747
|
+
// TODO: this branch should now work in ESM builds, enable it in a minor
|
|
7748
|
+
{
|
|
7749
|
+
throw new Error(`On-the-fly template compilation is not supported in the ESM build of ` +
|
|
7750
|
+
`@vue/server-renderer. All templates must be pre-compiled into ` +
|
|
7751
|
+
`render functions.`);
|
|
7752
|
+
}
|
|
7753
|
+
}
|
|
7754
|
+
|
|
7755
|
+
const { createComponentInstance, setCurrentRenderingInstance, setupComponent, renderComponentRoot, normalizeVNode } = ssrUtils;
|
|
7421
7756
|
// Each component has a buffer array.
|
|
7422
7757
|
// A buffer array can contain one of the following:
|
|
7423
7758
|
// - plain string
|
|
@@ -7450,8 +7785,8 @@ function createBuffer() {
|
|
|
7450
7785
|
};
|
|
7451
7786
|
}
|
|
7452
7787
|
function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
|
|
7453
|
-
const instance = createComponentInstance
|
|
7454
|
-
const res = setupComponent
|
|
7788
|
+
const instance = createComponentInstance(vnode, parentComponent, null);
|
|
7789
|
+
const res = setupComponent(instance, true /* isSSR */);
|
|
7455
7790
|
const hasAsyncSetup = isPromise(res);
|
|
7456
7791
|
const prefetches = instance.sp; /* LifecycleHooks.SERVER_PREFETCH */
|
|
7457
7792
|
if (hasAsyncSetup || prefetches) {
|
|
@@ -7474,7 +7809,7 @@ function renderComponentSubTree(instance, slotScopeId) {
|
|
|
7474
7809
|
const comp = instance.type;
|
|
7475
7810
|
const { getBuffer, push } = createBuffer();
|
|
7476
7811
|
if (isFunction(comp)) {
|
|
7477
|
-
let root = renderComponentRoot
|
|
7812
|
+
let root = renderComponentRoot(instance);
|
|
7478
7813
|
// #5817 scope ID attrs not falling through if functional component doesn't
|
|
7479
7814
|
// have props
|
|
7480
7815
|
if (!comp.props) {
|
|
@@ -7531,22 +7866,22 @@ function renderComponentSubTree(instance, slotScopeId) {
|
|
|
7531
7866
|
attrs[slotScopeId.trim()] = '';
|
|
7532
7867
|
}
|
|
7533
7868
|
// set current rendering instance for asset resolution
|
|
7534
|
-
const prev = setCurrentRenderingInstance
|
|
7869
|
+
const prev = setCurrentRenderingInstance(instance);
|
|
7535
7870
|
try {
|
|
7536
7871
|
ssrRender(instance.proxy, push, instance, attrs,
|
|
7537
7872
|
// compiler-optimized bindings
|
|
7538
7873
|
instance.props, instance.setupState, instance.data, instance.ctx);
|
|
7539
7874
|
}
|
|
7540
7875
|
finally {
|
|
7541
|
-
setCurrentRenderingInstance
|
|
7876
|
+
setCurrentRenderingInstance(prev);
|
|
7542
7877
|
}
|
|
7543
7878
|
}
|
|
7544
7879
|
else if (instance.render && instance.render !== NOOP) {
|
|
7545
|
-
renderVNode(push, (instance.subTree = renderComponentRoot
|
|
7880
|
+
renderVNode(push, (instance.subTree = renderComponentRoot(instance)), instance, slotScopeId);
|
|
7546
7881
|
}
|
|
7547
7882
|
else {
|
|
7548
7883
|
const componentName = comp.name || comp.__file || `<Anonymous>`;
|
|
7549
|
-
warn
|
|
7884
|
+
warn(`Component ${componentName} is missing template or render function.`);
|
|
7550
7885
|
push(`<!---->`);
|
|
7551
7886
|
}
|
|
7552
7887
|
}
|
|
@@ -7587,13 +7922,13 @@ function renderVNode(push, vnode, parentComponent, slotScopeId) {
|
|
|
7587
7922
|
renderVNode(push, vnode.ssContent, parentComponent, slotScopeId);
|
|
7588
7923
|
}
|
|
7589
7924
|
else {
|
|
7590
|
-
warn
|
|
7925
|
+
warn('[@vue/server-renderer] Invalid VNode type:', type, `(${typeof type})`);
|
|
7591
7926
|
}
|
|
7592
7927
|
}
|
|
7593
7928
|
}
|
|
7594
7929
|
function renderVNodeChildren(push, children, parentComponent, slotScopeId) {
|
|
7595
7930
|
for (let i = 0; i < children.length; i++) {
|
|
7596
|
-
renderVNode(push, normalizeVNode
|
|
7931
|
+
renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId);
|
|
7597
7932
|
}
|
|
7598
7933
|
}
|
|
7599
7934
|
function renderElementVNode(push, vnode, parentComponent, slotScopeId) {
|
|
@@ -7668,12 +8003,12 @@ function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) {
|
|
|
7668
8003
|
const disabled = vnode.props && vnode.props.disabled;
|
|
7669
8004
|
if (!target) {
|
|
7670
8005
|
if (!disabled) {
|
|
7671
|
-
warn
|
|
8006
|
+
warn(`[@vue/server-renderer] Teleport is missing target prop.`);
|
|
7672
8007
|
}
|
|
7673
8008
|
return [];
|
|
7674
8009
|
}
|
|
7675
8010
|
if (!isString(target)) {
|
|
7676
|
-
warn
|
|
8011
|
+
warn(`[@vue/server-renderer] Teleport target must be a query selector string.`);
|
|
7677
8012
|
return [];
|
|
7678
8013
|
}
|
|
7679
8014
|
ssrRenderTeleport(push, push => {
|
|
@@ -7682,7 +8017,7 @@ function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) {
|
|
|
7682
8017
|
}
|
|
7683
8018
|
|
|
7684
8019
|
const { isVNode: isVNode$1 } = ssrUtils;
|
|
7685
|
-
async function unrollBuffer(buffer) {
|
|
8020
|
+
async function unrollBuffer$1(buffer) {
|
|
7686
8021
|
if (buffer.hasAsync) {
|
|
7687
8022
|
let ret = '';
|
|
7688
8023
|
for (let i = 0; i < buffer.length; i++) {
|
|
@@ -7694,7 +8029,7 @@ async function unrollBuffer(buffer) {
|
|
|
7694
8029
|
ret += item;
|
|
7695
8030
|
}
|
|
7696
8031
|
else {
|
|
7697
|
-
ret += await unrollBuffer(item);
|
|
8032
|
+
ret += await unrollBuffer$1(item);
|
|
7698
8033
|
}
|
|
7699
8034
|
}
|
|
7700
8035
|
return ret;
|
|
@@ -7702,10 +8037,10 @@ async function unrollBuffer(buffer) {
|
|
|
7702
8037
|
else {
|
|
7703
8038
|
// sync buffer can be more efficiently unrolled without unnecessary await
|
|
7704
8039
|
// ticks
|
|
7705
|
-
return unrollBufferSync(buffer);
|
|
8040
|
+
return unrollBufferSync$1(buffer);
|
|
7706
8041
|
}
|
|
7707
8042
|
}
|
|
7708
|
-
function unrollBufferSync(buffer) {
|
|
8043
|
+
function unrollBufferSync$1(buffer) {
|
|
7709
8044
|
let ret = '';
|
|
7710
8045
|
for (let i = 0; i < buffer.length; i++) {
|
|
7711
8046
|
let item = buffer[i];
|
|
@@ -7714,7 +8049,7 @@ function unrollBufferSync(buffer) {
|
|
|
7714
8049
|
}
|
|
7715
8050
|
else {
|
|
7716
8051
|
// since this is a sync buffer, child buffers are never promises
|
|
7717
|
-
ret += unrollBufferSync(item);
|
|
8052
|
+
ret += unrollBufferSync$1(item);
|
|
7718
8053
|
}
|
|
7719
8054
|
}
|
|
7720
8055
|
return ret;
|
|
@@ -7730,7 +8065,7 @@ async function renderToString(input, context = {}) {
|
|
|
7730
8065
|
// provide the ssr context to the tree
|
|
7731
8066
|
input.provide(ssrContextKey, context);
|
|
7732
8067
|
const buffer = await renderComponentVNode(vnode);
|
|
7733
|
-
const result = await unrollBuffer(buffer);
|
|
8068
|
+
const result = await unrollBuffer$1(buffer);
|
|
7734
8069
|
await resolveTeleports(context);
|
|
7735
8070
|
if (context.__watcherHandles) {
|
|
7736
8071
|
for (const unwatch of context.__watcherHandles) {
|
|
@@ -7745,13 +8080,13 @@ async function resolveTeleports(context) {
|
|
|
7745
8080
|
for (const key in context.__teleportBuffers) {
|
|
7746
8081
|
// note: it's OK to await sequentially here because the Promises were
|
|
7747
8082
|
// created eagerly in parallel.
|
|
7748
|
-
context.teleports[key] = await unrollBuffer(await Promise.all([context.__teleportBuffers[key]]));
|
|
8083
|
+
context.teleports[key] = await unrollBuffer$1(await Promise.all([context.__teleportBuffers[key]]));
|
|
7749
8084
|
}
|
|
7750
8085
|
}
|
|
7751
8086
|
}
|
|
7752
8087
|
|
|
7753
|
-
const { isVNode
|
|
7754
|
-
async function unrollBuffer
|
|
8088
|
+
const { isVNode } = ssrUtils;
|
|
8089
|
+
async function unrollBuffer(buffer, stream) {
|
|
7755
8090
|
if (buffer.hasAsync) {
|
|
7756
8091
|
for (let i = 0; i < buffer.length; i++) {
|
|
7757
8092
|
let item = buffer[i];
|
|
@@ -7762,17 +8097,17 @@ async function unrollBuffer$1(buffer, stream) {
|
|
|
7762
8097
|
stream.push(item);
|
|
7763
8098
|
}
|
|
7764
8099
|
else {
|
|
7765
|
-
await unrollBuffer
|
|
8100
|
+
await unrollBuffer(item, stream);
|
|
7766
8101
|
}
|
|
7767
8102
|
}
|
|
7768
8103
|
}
|
|
7769
8104
|
else {
|
|
7770
8105
|
// sync buffer can be more efficiently unrolled without unnecessary await
|
|
7771
8106
|
// ticks
|
|
7772
|
-
unrollBufferSync
|
|
8107
|
+
unrollBufferSync(buffer, stream);
|
|
7773
8108
|
}
|
|
7774
8109
|
}
|
|
7775
|
-
function unrollBufferSync
|
|
8110
|
+
function unrollBufferSync(buffer, stream) {
|
|
7776
8111
|
for (let i = 0; i < buffer.length; i++) {
|
|
7777
8112
|
let item = buffer[i];
|
|
7778
8113
|
if (isString(item)) {
|
|
@@ -7780,12 +8115,12 @@ function unrollBufferSync$1(buffer, stream) {
|
|
|
7780
8115
|
}
|
|
7781
8116
|
else {
|
|
7782
8117
|
// since this is a sync buffer, child buffers are never promises
|
|
7783
|
-
unrollBufferSync
|
|
8118
|
+
unrollBufferSync(item, stream);
|
|
7784
8119
|
}
|
|
7785
8120
|
}
|
|
7786
8121
|
}
|
|
7787
8122
|
function renderToSimpleStream(input, context, stream) {
|
|
7788
|
-
if (isVNode
|
|
8123
|
+
if (isVNode(input)) {
|
|
7789
8124
|
// raw vnode, wrap with app (for context)
|
|
7790
8125
|
return renderToSimpleStream(createApp({ render: () => input }), context, stream);
|
|
7791
8126
|
}
|
|
@@ -7795,7 +8130,7 @@ function renderToSimpleStream(input, context, stream) {
|
|
|
7795
8130
|
// provide the ssr context to the tree
|
|
7796
8131
|
input.provide(ssrContextKey, context);
|
|
7797
8132
|
Promise.resolve(renderComponentVNode(vnode))
|
|
7798
|
-
.then(buffer => unrollBuffer
|
|
8133
|
+
.then(buffer => unrollBuffer(buffer, stream))
|
|
7799
8134
|
.then(() => resolveTeleports(context))
|
|
7800
8135
|
.then(() => {
|
|
7801
8136
|
if (context.__watcherHandles) {
|
|
@@ -7818,7 +8153,6 @@ function renderToStream(input, context = {}) {
|
|
|
7818
8153
|
return renderToNodeStream(input, context);
|
|
7819
8154
|
}
|
|
7820
8155
|
function renderToNodeStream(input, context = {}) {
|
|
7821
|
-
const stream = null;
|
|
7822
8156
|
{
|
|
7823
8157
|
throw new Error(`ESM build of renderToStream() does not support renderToNodeStream(). ` +
|
|
7824
8158
|
`Use pipeToNodeWritable() with an existing Node.js Writable stream ` +
|
|
@@ -7900,161 +8234,6 @@ function pipeToWebWritable(input, context = {}, writable) {
|
|
|
7900
8234
|
});
|
|
7901
8235
|
}
|
|
7902
8236
|
|
|
7903
|
-
|
|
7904
|
-
return renderComponentVNode(createVNode(comp, props, children), parentComponent, slotScopeId);
|
|
7905
|
-
}
|
|
7906
|
-
|
|
7907
|
-
function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) {
|
|
7908
|
-
// template-compiled slots are always rendered as fragments
|
|
7909
|
-
push(`<!--[-->`);
|
|
7910
|
-
ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId);
|
|
7911
|
-
push(`<!--]-->`);
|
|
7912
|
-
}
|
|
7913
|
-
function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) {
|
|
7914
|
-
const slotFn = slots[slotName];
|
|
7915
|
-
if (slotFn) {
|
|
7916
|
-
const slotBuffer = [];
|
|
7917
|
-
const bufferedPush = (item) => {
|
|
7918
|
-
slotBuffer.push(item);
|
|
7919
|
-
};
|
|
7920
|
-
const ret = slotFn(slotProps, bufferedPush, parentComponent, slotScopeId ? ' ' + slotScopeId : '');
|
|
7921
|
-
if (isArray(ret)) {
|
|
7922
|
-
// normal slot
|
|
7923
|
-
renderVNodeChildren(push, ret, parentComponent, slotScopeId);
|
|
7924
|
-
}
|
|
7925
|
-
else {
|
|
7926
|
-
// ssr slot.
|
|
7927
|
-
// check if the slot renders all comments, in which case use the fallback
|
|
7928
|
-
let isEmptySlot = true;
|
|
7929
|
-
if (transition) {
|
|
7930
|
-
isEmptySlot = false;
|
|
7931
|
-
}
|
|
7932
|
-
else {
|
|
7933
|
-
for (let i = 0; i < slotBuffer.length; i++) {
|
|
7934
|
-
if (!isComment(slotBuffer[i])) {
|
|
7935
|
-
isEmptySlot = false;
|
|
7936
|
-
break;
|
|
7937
|
-
}
|
|
7938
|
-
}
|
|
7939
|
-
}
|
|
7940
|
-
if (isEmptySlot) {
|
|
7941
|
-
if (fallbackRenderFn) {
|
|
7942
|
-
fallbackRenderFn();
|
|
7943
|
-
}
|
|
7944
|
-
}
|
|
7945
|
-
else {
|
|
7946
|
-
for (let i = 0; i < slotBuffer.length; i++) {
|
|
7947
|
-
push(slotBuffer[i]);
|
|
7948
|
-
}
|
|
7949
|
-
}
|
|
7950
|
-
}
|
|
7951
|
-
}
|
|
7952
|
-
else if (fallbackRenderFn) {
|
|
7953
|
-
fallbackRenderFn();
|
|
7954
|
-
}
|
|
7955
|
-
}
|
|
7956
|
-
const commentTestRE = /^<!--.*-->$/s;
|
|
7957
|
-
const commentRE = /<!--[^]*?-->/gm;
|
|
7958
|
-
function isComment(item) {
|
|
7959
|
-
if (typeof item !== 'string' || !commentTestRE.test(item))
|
|
7960
|
-
return false;
|
|
7961
|
-
// if item is '<!---->' or '<!--[-->' or '<!--]-->', return true directly
|
|
7962
|
-
if (item.length <= 8)
|
|
7963
|
-
return true;
|
|
7964
|
-
return !item.replace(commentRE, '').trim();
|
|
7965
|
-
}
|
|
7966
|
-
|
|
7967
|
-
function ssrInterpolate(value) {
|
|
7968
|
-
return escapeHtml(toDisplayString(value));
|
|
7969
|
-
}
|
|
7970
|
-
|
|
7971
|
-
function ssrRenderList(source, renderItem) {
|
|
7972
|
-
if (isArray(source) || isString(source)) {
|
|
7973
|
-
for (let i = 0, l = source.length; i < l; i++) {
|
|
7974
|
-
renderItem(source[i], i);
|
|
7975
|
-
}
|
|
7976
|
-
}
|
|
7977
|
-
else if (typeof source === 'number') {
|
|
7978
|
-
if (!Number.isInteger(source)) {
|
|
7979
|
-
warn$1(`The v-for range expect an integer value but got ${source}.`);
|
|
7980
|
-
return;
|
|
7981
|
-
}
|
|
7982
|
-
for (let i = 0; i < source; i++) {
|
|
7983
|
-
renderItem(i + 1, i);
|
|
7984
|
-
}
|
|
7985
|
-
}
|
|
7986
|
-
else if (isObject(source)) {
|
|
7987
|
-
if (source[Symbol.iterator]) {
|
|
7988
|
-
const arr = Array.from(source);
|
|
7989
|
-
for (let i = 0, l = arr.length; i < l; i++) {
|
|
7990
|
-
renderItem(arr[i], i);
|
|
7991
|
-
}
|
|
7992
|
-
}
|
|
7993
|
-
else {
|
|
7994
|
-
const keys = Object.keys(source);
|
|
7995
|
-
for (let i = 0, l = keys.length; i < l; i++) {
|
|
7996
|
-
const key = keys[i];
|
|
7997
|
-
renderItem(source[key], key, i);
|
|
7998
|
-
}
|
|
7999
|
-
}
|
|
8000
|
-
}
|
|
8001
|
-
}
|
|
8002
|
-
|
|
8003
|
-
async function ssrRenderSuspense(push, { default: renderContent }) {
|
|
8004
|
-
if (renderContent) {
|
|
8005
|
-
renderContent();
|
|
8006
|
-
}
|
|
8007
|
-
else {
|
|
8008
|
-
push(`<!---->`);
|
|
8009
|
-
}
|
|
8010
|
-
}
|
|
8011
|
-
|
|
8012
|
-
function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) {
|
|
8013
|
-
if (typeof dir !== 'function' && dir.getSSRProps) {
|
|
8014
|
-
return (dir.getSSRProps({
|
|
8015
|
-
dir,
|
|
8016
|
-
instance,
|
|
8017
|
-
value,
|
|
8018
|
-
oldValue: undefined,
|
|
8019
|
-
arg,
|
|
8020
|
-
modifiers
|
|
8021
|
-
}, null) || {});
|
|
8022
|
-
}
|
|
8023
|
-
return {};
|
|
8024
|
-
}
|
|
8025
|
-
|
|
8026
|
-
const ssrLooseEqual = looseEqual;
|
|
8027
|
-
function ssrLooseContain(arr, value) {
|
|
8028
|
-
return looseIndexOf(arr, value) > -1;
|
|
8029
|
-
}
|
|
8030
|
-
// for <input :type="type" v-model="model" value="value">
|
|
8031
|
-
function ssrRenderDynamicModel(type, model, value) {
|
|
8032
|
-
switch (type) {
|
|
8033
|
-
case 'radio':
|
|
8034
|
-
return looseEqual(model, value) ? ' checked' : '';
|
|
8035
|
-
case 'checkbox':
|
|
8036
|
-
return (isArray(model) ? ssrLooseContain(model, value) : model)
|
|
8037
|
-
? ' checked'
|
|
8038
|
-
: '';
|
|
8039
|
-
default:
|
|
8040
|
-
// text types
|
|
8041
|
-
return ssrRenderAttr('value', model);
|
|
8042
|
-
}
|
|
8043
|
-
}
|
|
8044
|
-
// for <input v-bind="obj" v-model="model">
|
|
8045
|
-
function ssrGetDynamicModelProps(existingProps = {}, model) {
|
|
8046
|
-
const { type, value } = existingProps;
|
|
8047
|
-
switch (type) {
|
|
8048
|
-
case 'radio':
|
|
8049
|
-
return looseEqual(model, value) ? { checked: true } : null;
|
|
8050
|
-
case 'checkbox':
|
|
8051
|
-
return (isArray(model) ? ssrLooseContain(model, value) : model)
|
|
8052
|
-
? { checked: true }
|
|
8053
|
-
: null;
|
|
8054
|
-
default:
|
|
8055
|
-
// text types
|
|
8056
|
-
return { value: model };
|
|
8057
|
-
}
|
|
8058
|
-
}
|
|
8237
|
+
initDirectivesForSSR();
|
|
8059
8238
|
|
|
8060
8239
|
export { pipeToNodeWritable, pipeToWebWritable, renderToNodeStream, renderToSimpleStream, renderToStream, renderToString, renderToWebStream, ssrGetDirectiveProps, ssrGetDynamicModelProps, includeBooleanAttr as ssrIncludeBooleanAttr, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, ssrRenderDynamicAttr, ssrRenderDynamicModel, ssrRenderList, ssrRenderSlot, ssrRenderSlotInner, ssrRenderStyle, ssrRenderSuspense, ssrRenderTeleport, renderVNode as ssrRenderVNode };
|