vue 3.4.0-alpha.3 → 3.4.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler-sfc/register-ts.js +1 -3
- package/dist/vue.cjs.js +12 -3
- package/dist/vue.cjs.prod.js +12 -3
- package/dist/vue.esm-browser.js +139 -64
- package/dist/vue.esm-browser.prod.js +5 -5
- package/dist/vue.esm-bundler.js +13 -4
- package/dist/vue.global.js +138 -63
- package/dist/vue.global.prod.js +5 -5
- package/dist/vue.runtime.esm-browser.js +72 -30
- package/dist/vue.runtime.esm-browser.prod.js +5 -5
- package/dist/vue.runtime.global.js +75 -29
- package/dist/vue.runtime.global.prod.js +5 -5
- package/package.json +6 -6
package/dist/vue.cjs.js
CHANGED
|
@@ -19,7 +19,15 @@ function _interopNamespaceDefault(e) {
|
|
|
19
19
|
|
|
20
20
|
var runtimeDom__namespace = /*#__PURE__*/_interopNamespaceDefault(runtimeDom);
|
|
21
21
|
|
|
22
|
-
const compileCache = /* @__PURE__ */
|
|
22
|
+
const compileCache = /* @__PURE__ */ new WeakMap();
|
|
23
|
+
function getCache(options) {
|
|
24
|
+
let c = compileCache.get(options != null ? options : shared.EMPTY_OBJ);
|
|
25
|
+
if (!c) {
|
|
26
|
+
c = /* @__PURE__ */ Object.create(null);
|
|
27
|
+
compileCache.set(options != null ? options : shared.EMPTY_OBJ, c);
|
|
28
|
+
}
|
|
29
|
+
return c;
|
|
30
|
+
}
|
|
23
31
|
function compileToFunction(template, options) {
|
|
24
32
|
if (!shared.isString(template)) {
|
|
25
33
|
if (template.nodeType) {
|
|
@@ -30,7 +38,8 @@ function compileToFunction(template, options) {
|
|
|
30
38
|
}
|
|
31
39
|
}
|
|
32
40
|
const key = template;
|
|
33
|
-
const
|
|
41
|
+
const cache = getCache(options);
|
|
42
|
+
const cached = cache[key];
|
|
34
43
|
if (cached) {
|
|
35
44
|
return cached;
|
|
36
45
|
}
|
|
@@ -65,7 +74,7 @@ ${codeFrame}` : message);
|
|
|
65
74
|
}
|
|
66
75
|
const render = new Function("Vue", code)(runtimeDom__namespace);
|
|
67
76
|
render._rc = true;
|
|
68
|
-
return
|
|
77
|
+
return cache[key] = render;
|
|
69
78
|
}
|
|
70
79
|
runtimeDom.registerRuntimeCompiler(compileToFunction);
|
|
71
80
|
|
package/dist/vue.cjs.prod.js
CHANGED
|
@@ -19,7 +19,15 @@ function _interopNamespaceDefault(e) {
|
|
|
19
19
|
|
|
20
20
|
var runtimeDom__namespace = /*#__PURE__*/_interopNamespaceDefault(runtimeDom);
|
|
21
21
|
|
|
22
|
-
const compileCache = /* @__PURE__ */
|
|
22
|
+
const compileCache = /* @__PURE__ */ new WeakMap();
|
|
23
|
+
function getCache(options) {
|
|
24
|
+
let c = compileCache.get(options != null ? options : shared.EMPTY_OBJ);
|
|
25
|
+
if (!c) {
|
|
26
|
+
c = /* @__PURE__ */ Object.create(null);
|
|
27
|
+
compileCache.set(options != null ? options : shared.EMPTY_OBJ, c);
|
|
28
|
+
}
|
|
29
|
+
return c;
|
|
30
|
+
}
|
|
23
31
|
function compileToFunction(template, options) {
|
|
24
32
|
if (!shared.isString(template)) {
|
|
25
33
|
if (template.nodeType) {
|
|
@@ -29,7 +37,8 @@ function compileToFunction(template, options) {
|
|
|
29
37
|
}
|
|
30
38
|
}
|
|
31
39
|
const key = template;
|
|
32
|
-
const
|
|
40
|
+
const cache = getCache(options);
|
|
41
|
+
const cached = cache[key];
|
|
33
42
|
if (cached) {
|
|
34
43
|
return cached;
|
|
35
44
|
}
|
|
@@ -51,7 +60,7 @@ function compileToFunction(template, options) {
|
|
|
51
60
|
const { code } = compilerDom.compile(template, opts);
|
|
52
61
|
const render = new Function("Vue", code)(runtimeDom__namespace);
|
|
53
62
|
render._rc = true;
|
|
54
|
-
return
|
|
63
|
+
return cache[key] = render;
|
|
55
64
|
}
|
|
56
65
|
runtimeDom.registerRuntimeCompiler(compileToFunction);
|
|
57
66
|
|
package/dist/vue.esm-browser.js
CHANGED
|
@@ -8,8 +8,8 @@ const EMPTY_ARR = Object.freeze([]) ;
|
|
|
8
8
|
const NOOP = () => {
|
|
9
9
|
};
|
|
10
10
|
const NO = () => false;
|
|
11
|
-
const
|
|
12
|
-
|
|
11
|
+
const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
|
|
12
|
+
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
|
|
13
13
|
const isModelListener = (key) => key.startsWith("onUpdate:");
|
|
14
14
|
const extend = Object.assign;
|
|
15
15
|
const remove = (arr, el) => {
|
|
@@ -117,7 +117,7 @@ const slotFlagsText = {
|
|
|
117
117
|
[3]: "FORWARDED"
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
-
const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";
|
|
120
|
+
const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
|
|
121
121
|
const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
|
|
122
122
|
|
|
123
123
|
const range = 2;
|
|
@@ -1498,6 +1498,18 @@ function propertyToRef(source, key, defaultValue) {
|
|
|
1498
1498
|
return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
|
|
1499
1499
|
}
|
|
1500
1500
|
|
|
1501
|
+
const TrackOpTypes = {
|
|
1502
|
+
"GET": "get",
|
|
1503
|
+
"HAS": "has",
|
|
1504
|
+
"ITERATE": "iterate"
|
|
1505
|
+
};
|
|
1506
|
+
const TriggerOpTypes = {
|
|
1507
|
+
"SET": "set",
|
|
1508
|
+
"ADD": "add",
|
|
1509
|
+
"DELETE": "delete",
|
|
1510
|
+
"CLEAR": "clear"
|
|
1511
|
+
};
|
|
1512
|
+
|
|
1501
1513
|
const stack$1 = [];
|
|
1502
1514
|
function pushWarningContext(vnode) {
|
|
1503
1515
|
stack$1.push(vnode);
|
|
@@ -1612,6 +1624,38 @@ function assertNumber(val, type) {
|
|
|
1612
1624
|
}
|
|
1613
1625
|
}
|
|
1614
1626
|
|
|
1627
|
+
const ErrorCodes = {
|
|
1628
|
+
"SETUP_FUNCTION": 0,
|
|
1629
|
+
"0": "SETUP_FUNCTION",
|
|
1630
|
+
"RENDER_FUNCTION": 1,
|
|
1631
|
+
"1": "RENDER_FUNCTION",
|
|
1632
|
+
"WATCH_GETTER": 2,
|
|
1633
|
+
"2": "WATCH_GETTER",
|
|
1634
|
+
"WATCH_CALLBACK": 3,
|
|
1635
|
+
"3": "WATCH_CALLBACK",
|
|
1636
|
+
"WATCH_CLEANUP": 4,
|
|
1637
|
+
"4": "WATCH_CLEANUP",
|
|
1638
|
+
"NATIVE_EVENT_HANDLER": 5,
|
|
1639
|
+
"5": "NATIVE_EVENT_HANDLER",
|
|
1640
|
+
"COMPONENT_EVENT_HANDLER": 6,
|
|
1641
|
+
"6": "COMPONENT_EVENT_HANDLER",
|
|
1642
|
+
"VNODE_HOOK": 7,
|
|
1643
|
+
"7": "VNODE_HOOK",
|
|
1644
|
+
"DIRECTIVE_HOOK": 8,
|
|
1645
|
+
"8": "DIRECTIVE_HOOK",
|
|
1646
|
+
"TRANSITION_HOOK": 9,
|
|
1647
|
+
"9": "TRANSITION_HOOK",
|
|
1648
|
+
"APP_ERROR_HANDLER": 10,
|
|
1649
|
+
"10": "APP_ERROR_HANDLER",
|
|
1650
|
+
"APP_WARN_HANDLER": 11,
|
|
1651
|
+
"11": "APP_WARN_HANDLER",
|
|
1652
|
+
"FUNCTION_REF": 12,
|
|
1653
|
+
"12": "FUNCTION_REF",
|
|
1654
|
+
"ASYNC_COMPONENT_LOADER": 13,
|
|
1655
|
+
"13": "ASYNC_COMPONENT_LOADER",
|
|
1656
|
+
"SCHEDULER": 14,
|
|
1657
|
+
"14": "SCHEDULER"
|
|
1658
|
+
};
|
|
1615
1659
|
const ErrorTypeStrings$1 = {
|
|
1616
1660
|
["sp"]: "serverPrefetch hook",
|
|
1617
1661
|
["bc"]: "beforeCreate hook",
|
|
@@ -2931,7 +2975,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2931
2975
|
if (delayEnter) {
|
|
2932
2976
|
activeBranch.transition.afterLeave = () => {
|
|
2933
2977
|
if (pendingId === suspense.pendingId) {
|
|
2934
|
-
move(
|
|
2978
|
+
move(
|
|
2979
|
+
pendingBranch,
|
|
2980
|
+
container2,
|
|
2981
|
+
next(activeBranch),
|
|
2982
|
+
0
|
|
2983
|
+
);
|
|
2935
2984
|
queuePostFlushCb(effects);
|
|
2936
2985
|
}
|
|
2937
2986
|
};
|
|
@@ -2978,7 +3027,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2978
3027
|
}
|
|
2979
3028
|
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, isSVG: isSVG2 } = suspense;
|
|
2980
3029
|
triggerEvent(vnode2, "onFallback");
|
|
2981
|
-
const anchor2 = next(activeBranch);
|
|
2982
3030
|
const mountFallback = () => {
|
|
2983
3031
|
if (!suspense.isInFallback) {
|
|
2984
3032
|
return;
|
|
@@ -2987,7 +3035,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
2987
3035
|
null,
|
|
2988
3036
|
fallbackVNode,
|
|
2989
3037
|
container2,
|
|
2990
|
-
|
|
3038
|
+
next(activeBranch),
|
|
2991
3039
|
parentComponent2,
|
|
2992
3040
|
null,
|
|
2993
3041
|
// fallback tree will not have suspense context
|
|
@@ -5215,18 +5263,6 @@ function createAppAPI(render, hydrate) {
|
|
|
5215
5263
|
rootProps = null;
|
|
5216
5264
|
}
|
|
5217
5265
|
const context = createAppContext();
|
|
5218
|
-
{
|
|
5219
|
-
Object.defineProperty(context.config, "unwrapInjectedRef", {
|
|
5220
|
-
get() {
|
|
5221
|
-
return true;
|
|
5222
|
-
},
|
|
5223
|
-
set() {
|
|
5224
|
-
warn(
|
|
5225
|
-
`app.config.unwrapInjectedRef has been deprecated. 3.3 now always unwraps injected refs in Options API.`
|
|
5226
|
-
);
|
|
5227
|
-
}
|
|
5228
|
-
});
|
|
5229
|
-
}
|
|
5230
5266
|
const installedPlugins = /* @__PURE__ */ new WeakSet();
|
|
5231
5267
|
let isMounted = false;
|
|
5232
5268
|
const app = context.app = {
|
|
@@ -9033,9 +9069,9 @@ function initCustomFormatter() {
|
|
|
9033
9069
|
return;
|
|
9034
9070
|
}
|
|
9035
9071
|
const vueStyle = { style: "color:#3ba776" };
|
|
9036
|
-
const numberStyle = { style: "color:#
|
|
9037
|
-
const stringStyle = { style: "color:#
|
|
9038
|
-
const keywordStyle = { style: "color:#
|
|
9072
|
+
const numberStyle = { style: "color:#1677ff" };
|
|
9073
|
+
const stringStyle = { style: "color:#f5222d" };
|
|
9074
|
+
const keywordStyle = { style: "color:#eb2f96" };
|
|
9039
9075
|
const formatter = {
|
|
9040
9076
|
header(obj) {
|
|
9041
9077
|
if (!isObject(obj)) {
|
|
@@ -9229,11 +9265,12 @@ function isMemoSame(cached, memo) {
|
|
|
9229
9265
|
return true;
|
|
9230
9266
|
}
|
|
9231
9267
|
|
|
9232
|
-
const version = "3.4.0-alpha.
|
|
9268
|
+
const version = "3.4.0-alpha.4";
|
|
9233
9269
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
9234
9270
|
const ssrUtils = null;
|
|
9235
9271
|
const resolveFilter = null;
|
|
9236
9272
|
const compatUtils = null;
|
|
9273
|
+
const DeprecationTypes = null;
|
|
9237
9274
|
|
|
9238
9275
|
const svgNS = "http://www.w3.org/2000/svg";
|
|
9239
9276
|
const doc = typeof document !== "undefined" ? document : null;
|
|
@@ -9842,7 +9879,8 @@ function patchStopImmediatePropagation(e, value) {
|
|
|
9842
9879
|
}
|
|
9843
9880
|
}
|
|
9844
9881
|
|
|
9845
|
-
const
|
|
9882
|
+
const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
|
|
9883
|
+
key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
|
|
9846
9884
|
const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
|
|
9847
9885
|
if (key === "class") {
|
|
9848
9886
|
patchClass(el, nextValue, isSVG);
|
|
@@ -9876,7 +9914,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
9876
9914
|
if (key === "innerHTML" || key === "textContent") {
|
|
9877
9915
|
return true;
|
|
9878
9916
|
}
|
|
9879
|
-
if (key in el &&
|
|
9917
|
+
if (key in el && isNativeOn(key) && isFunction(value)) {
|
|
9880
9918
|
return true;
|
|
9881
9919
|
}
|
|
9882
9920
|
return false;
|
|
@@ -9893,7 +9931,11 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
9893
9931
|
if (key === "type" && el.tagName === "TEXTAREA") {
|
|
9894
9932
|
return false;
|
|
9895
9933
|
}
|
|
9896
|
-
if (
|
|
9934
|
+
if (key === "width" || key === "height") {
|
|
9935
|
+
const tag = el.tagName;
|
|
9936
|
+
return !(tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE");
|
|
9937
|
+
}
|
|
9938
|
+
if (isNativeOn(key) && isString(value)) {
|
|
9897
9939
|
return false;
|
|
9898
9940
|
}
|
|
9899
9941
|
return key in el;
|
|
@@ -10574,14 +10616,14 @@ const modifierGuards = {
|
|
|
10574
10616
|
exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
|
|
10575
10617
|
};
|
|
10576
10618
|
const withModifiers = (fn, modifiers) => {
|
|
10577
|
-
return (event, ...args) => {
|
|
10619
|
+
return fn._withMods || (fn._withMods = (event, ...args) => {
|
|
10578
10620
|
for (let i = 0; i < modifiers.length; i++) {
|
|
10579
10621
|
const guard = modifierGuards[modifiers[i]];
|
|
10580
10622
|
if (guard && guard(event, modifiers))
|
|
10581
10623
|
return;
|
|
10582
10624
|
}
|
|
10583
10625
|
return fn(event, ...args);
|
|
10584
|
-
};
|
|
10626
|
+
});
|
|
10585
10627
|
};
|
|
10586
10628
|
const keyNames = {
|
|
10587
10629
|
esc: "escape",
|
|
@@ -10593,7 +10635,7 @@ const keyNames = {
|
|
|
10593
10635
|
delete: "backspace"
|
|
10594
10636
|
};
|
|
10595
10637
|
const withKeys = (fn, modifiers) => {
|
|
10596
|
-
return (event) => {
|
|
10638
|
+
return fn._withKeys || (fn._withKeys = (event) => {
|
|
10597
10639
|
if (!("key" in event)) {
|
|
10598
10640
|
return;
|
|
10599
10641
|
}
|
|
@@ -10601,7 +10643,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
10601
10643
|
if (modifiers.some((k) => k === eventKey || keyNames[k] === eventKey)) {
|
|
10602
10644
|
return fn(event);
|
|
10603
10645
|
}
|
|
10604
|
-
};
|
|
10646
|
+
});
|
|
10605
10647
|
};
|
|
10606
10648
|
|
|
10607
10649
|
const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
|
|
@@ -10720,7 +10762,9 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
10720
10762
|
BaseTransition: BaseTransition,
|
|
10721
10763
|
BaseTransitionPropsValidators: BaseTransitionPropsValidators,
|
|
10722
10764
|
Comment: Comment,
|
|
10765
|
+
DeprecationTypes: DeprecationTypes,
|
|
10723
10766
|
EffectScope: EffectScope,
|
|
10767
|
+
ErrorCodes: ErrorCodes,
|
|
10724
10768
|
ErrorTypeStrings: ErrorTypeStrings,
|
|
10725
10769
|
Fragment: Fragment,
|
|
10726
10770
|
KeepAlive: KeepAlive,
|
|
@@ -10729,8 +10773,10 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
10729
10773
|
Suspense: Suspense,
|
|
10730
10774
|
Teleport: Teleport,
|
|
10731
10775
|
Text: Text,
|
|
10776
|
+
TrackOpTypes: TrackOpTypes,
|
|
10732
10777
|
Transition: Transition,
|
|
10733
10778
|
TransitionGroup: TransitionGroup,
|
|
10779
|
+
TriggerOpTypes: TriggerOpTypes,
|
|
10734
10780
|
VueElement: VueElement,
|
|
10735
10781
|
assertNumber: assertNumber,
|
|
10736
10782
|
callWithAsyncErrorHandling: callWithAsyncErrorHandling,
|
|
@@ -11182,7 +11228,9 @@ class Tokenizer {
|
|
|
11182
11228
|
this.inRCDATA = false;
|
|
11183
11229
|
/** For disabling RCDATA tags handling */
|
|
11184
11230
|
this.inXML = false;
|
|
11185
|
-
/**
|
|
11231
|
+
/** For disabling interpolation parsing in v-pre */
|
|
11232
|
+
this.inVPre = false;
|
|
11233
|
+
/** Record newline positions for fast line / column calculation */
|
|
11186
11234
|
this.newlines = [];
|
|
11187
11235
|
this.mode = 0;
|
|
11188
11236
|
this.delimiterOpen = defaultDelimitersOpen;
|
|
@@ -11201,6 +11249,7 @@ class Tokenizer {
|
|
|
11201
11249
|
this.sectionStart = 0;
|
|
11202
11250
|
this.index = 0;
|
|
11203
11251
|
this.baseState = 1;
|
|
11252
|
+
this.inRCDATA = false;
|
|
11204
11253
|
this.currentSequence = void 0;
|
|
11205
11254
|
this.newlines.length = 0;
|
|
11206
11255
|
this.delimiterOpen = defaultDelimitersOpen;
|
|
@@ -11239,7 +11288,7 @@ class Tokenizer {
|
|
|
11239
11288
|
}
|
|
11240
11289
|
this.state = 5;
|
|
11241
11290
|
this.sectionStart = this.index;
|
|
11242
|
-
} else if (c === this.delimiterOpen[0]) {
|
|
11291
|
+
} else if (!this.inVPre && c === this.delimiterOpen[0]) {
|
|
11243
11292
|
this.state = 2;
|
|
11244
11293
|
this.delimiterIndex = 0;
|
|
11245
11294
|
this.stateInterpolationOpen(c);
|
|
@@ -11986,16 +12035,14 @@ const errorMessages = {
|
|
|
11986
12035
|
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
|
|
11987
12036
|
[45]: `Error parsing JavaScript expression: `,
|
|
11988
12037
|
[46]: `<KeepAlive> expects exactly one child component.`,
|
|
12038
|
+
[47]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
|
|
11989
12039
|
// generic errors
|
|
11990
|
-
[
|
|
11991
|
-
[
|
|
11992
|
-
[
|
|
11993
|
-
[
|
|
11994
|
-
// deprecations
|
|
11995
|
-
[51]: `@vnode-* hooks in templates are deprecated. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support will be removed in 3.4.`,
|
|
11996
|
-
[52]: `v-is="component-name" has been deprecated. Use is="vue:component-name" instead. v-is support will be removed in 3.4.`,
|
|
12040
|
+
[48]: `"prefixIdentifiers" option is not supported in this build of compiler.`,
|
|
12041
|
+
[49]: `ES module mode is not supported in this build of compiler.`,
|
|
12042
|
+
[50]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
|
|
12043
|
+
[51]: `"scopeId" option is only supported in module mode.`,
|
|
11997
12044
|
// just to fulfill types
|
|
11998
|
-
[
|
|
12045
|
+
[52]: ``
|
|
11999
12046
|
};
|
|
12000
12047
|
|
|
12001
12048
|
const isStaticExp = (p) => p.type === 4 && p.isStatic;
|
|
@@ -12238,7 +12285,8 @@ const defaultParserOptions = {
|
|
|
12238
12285
|
isCustomElement: NO,
|
|
12239
12286
|
onError: defaultOnError,
|
|
12240
12287
|
onWarn: defaultOnWarn,
|
|
12241
|
-
comments: true
|
|
12288
|
+
comments: true,
|
|
12289
|
+
prefixIdentifiers: false
|
|
12242
12290
|
};
|
|
12243
12291
|
let currentOptions = defaultParserOptions;
|
|
12244
12292
|
let currentRoot = null;
|
|
@@ -12280,7 +12328,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
12280
12328
|
}
|
|
12281
12329
|
addNode({
|
|
12282
12330
|
type: 5,
|
|
12283
|
-
content:
|
|
12331
|
+
content: createExp(exp, false, getLoc(innerStart, innerEnd)),
|
|
12284
12332
|
loc: getLoc(start, end)
|
|
12285
12333
|
});
|
|
12286
12334
|
},
|
|
@@ -12373,7 +12421,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
12373
12421
|
loc: getLoc(start)
|
|
12374
12422
|
};
|
|
12375
12423
|
if (name === "pre") {
|
|
12376
|
-
inVPre = true;
|
|
12424
|
+
inVPre = tokenizer.inVPre = true;
|
|
12377
12425
|
currentVPreBoundary = currentOpenTag;
|
|
12378
12426
|
const props = currentOpenTag.props;
|
|
12379
12427
|
for (let i = 0; i < props.length; i++) {
|
|
@@ -12393,7 +12441,7 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
12393
12441
|
setLocEnd(currentProp.nameLoc, end);
|
|
12394
12442
|
} else {
|
|
12395
12443
|
const isStatic = arg[0] !== `[`;
|
|
12396
|
-
currentProp.arg =
|
|
12444
|
+
currentProp.arg = createExp(
|
|
12397
12445
|
isStatic ? arg : arg.slice(1, -1),
|
|
12398
12446
|
isStatic,
|
|
12399
12447
|
getLoc(start, end),
|
|
@@ -12466,10 +12514,13 @@ const tokenizer = new Tokenizer(stack, {
|
|
|
12466
12514
|
tokenizer.enterRCDATA(toCharCodes(`</template`), 0);
|
|
12467
12515
|
}
|
|
12468
12516
|
} else {
|
|
12469
|
-
|
|
12517
|
+
let expParseMode = 0 /* Normal */;
|
|
12518
|
+
currentProp.exp = createExp(
|
|
12470
12519
|
currentAttrValue,
|
|
12471
12520
|
false,
|
|
12472
|
-
getLoc(currentAttrStartIndex, currentAttrEndIndex)
|
|
12521
|
+
getLoc(currentAttrStartIndex, currentAttrEndIndex),
|
|
12522
|
+
0,
|
|
12523
|
+
expParseMode
|
|
12473
12524
|
);
|
|
12474
12525
|
if (currentProp.name === "for") {
|
|
12475
12526
|
currentProp.forParseResult = parseForExpression(currentProp.exp);
|
|
@@ -12562,10 +12613,16 @@ function parseForExpression(input) {
|
|
|
12562
12613
|
if (!inMatch)
|
|
12563
12614
|
return;
|
|
12564
12615
|
const [, LHS, RHS] = inMatch;
|
|
12565
|
-
const createAliasExpression = (content, offset) => {
|
|
12616
|
+
const createAliasExpression = (content, offset, asParam = false) => {
|
|
12566
12617
|
const start = loc.start.offset + offset;
|
|
12567
12618
|
const end = start + content.length;
|
|
12568
|
-
return
|
|
12619
|
+
return createExp(
|
|
12620
|
+
content,
|
|
12621
|
+
false,
|
|
12622
|
+
getLoc(start, end),
|
|
12623
|
+
0,
|
|
12624
|
+
asParam ? 1 /* Params */ : 0 /* Normal */
|
|
12625
|
+
);
|
|
12569
12626
|
};
|
|
12570
12627
|
const result = {
|
|
12571
12628
|
source: createAliasExpression(RHS.trim(), exp.indexOf(RHS, LHS.length)),
|
|
@@ -12583,7 +12640,7 @@ function parseForExpression(input) {
|
|
|
12583
12640
|
let keyOffset;
|
|
12584
12641
|
if (keyContent) {
|
|
12585
12642
|
keyOffset = exp.indexOf(keyContent, trimmedOffset + valueContent.length);
|
|
12586
|
-
result.key = createAliasExpression(keyContent, keyOffset);
|
|
12643
|
+
result.key = createAliasExpression(keyContent, keyOffset, true);
|
|
12587
12644
|
}
|
|
12588
12645
|
if (iteratorMatch[2]) {
|
|
12589
12646
|
const indexContent = iteratorMatch[2].trim();
|
|
@@ -12593,13 +12650,14 @@ function parseForExpression(input) {
|
|
|
12593
12650
|
exp.indexOf(
|
|
12594
12651
|
indexContent,
|
|
12595
12652
|
result.key ? keyOffset + keyContent.length : trimmedOffset + valueContent.length
|
|
12596
|
-
)
|
|
12653
|
+
),
|
|
12654
|
+
true
|
|
12597
12655
|
);
|
|
12598
12656
|
}
|
|
12599
12657
|
}
|
|
12600
12658
|
}
|
|
12601
12659
|
if (valueContent) {
|
|
12602
|
-
result.value = createAliasExpression(valueContent, trimmedOffset);
|
|
12660
|
+
result.value = createAliasExpression(valueContent, trimmedOffset, true);
|
|
12603
12661
|
}
|
|
12604
12662
|
return result;
|
|
12605
12663
|
}
|
|
@@ -12677,7 +12735,7 @@ function onCloseTag(el, end, isImplied = false) {
|
|
|
12677
12735
|
inPre--;
|
|
12678
12736
|
}
|
|
12679
12737
|
if (currentVPreBoundary === el) {
|
|
12680
|
-
inVPre = false;
|
|
12738
|
+
inVPre = tokenizer.inVPre = false;
|
|
12681
12739
|
currentVPreBoundary = null;
|
|
12682
12740
|
}
|
|
12683
12741
|
if (tokenizer.inXML && (stack[0] ? stack[0].ns : currentOptions.ns) === 0) {
|
|
@@ -12841,8 +12899,14 @@ function dirToAttr(dir) {
|
|
|
12841
12899
|
}
|
|
12842
12900
|
return attr;
|
|
12843
12901
|
}
|
|
12844
|
-
function
|
|
12845
|
-
|
|
12902
|
+
function createExp(content, isStatic = false, loc, constType = 0, parseMode = 0 /* Normal */) {
|
|
12903
|
+
const exp = createSimpleExpression(content, isStatic, loc, constType);
|
|
12904
|
+
return exp;
|
|
12905
|
+
}
|
|
12906
|
+
function emitError(code, index, message) {
|
|
12907
|
+
currentOptions.onError(
|
|
12908
|
+
createCompilerError(code, getLoc(index, index), void 0, message)
|
|
12909
|
+
);
|
|
12846
12910
|
}
|
|
12847
12911
|
function reset() {
|
|
12848
12912
|
tokenizer.reset();
|
|
@@ -12873,6 +12937,7 @@ function baseParse(input, options) {
|
|
|
12873
12937
|
}
|
|
12874
12938
|
}
|
|
12875
12939
|
tokenizer.mode = currentOptions.parseMode === "html" ? 1 : currentOptions.parseMode === "sfc" ? 2 : 0;
|
|
12940
|
+
tokenizer.inXML = currentOptions.ns === 1 || currentOptions.ns === 2;
|
|
12876
12941
|
const delimiters = options == null ? void 0 : options.delimiters;
|
|
12877
12942
|
if (delimiters) {
|
|
12878
12943
|
tokenizer.delimiterOpen = toCharCodes(delimiters[0]);
|
|
@@ -14899,6 +14964,9 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
|
|
|
14899
14964
|
if (isEventHandler && isReservedProp(name)) {
|
|
14900
14965
|
hasVnodeHook = true;
|
|
14901
14966
|
}
|
|
14967
|
+
if (isEventHandler && value.type === 14) {
|
|
14968
|
+
value = value.arguments[0];
|
|
14969
|
+
}
|
|
14902
14970
|
if (value.type === 20 || (value.type === 4 || value.type === 8) && getConstantType(value, context) > 0) {
|
|
14903
14971
|
return;
|
|
14904
14972
|
}
|
|
@@ -15315,9 +15383,7 @@ const transformOn$1 = (dir, node, context, augmentor) => {
|
|
|
15315
15383
|
if (arg.isStatic) {
|
|
15316
15384
|
let rawName = arg.content;
|
|
15317
15385
|
if (rawName.startsWith("vnode")) {
|
|
15318
|
-
context.
|
|
15319
|
-
createCompilerError(51, arg.loc)
|
|
15320
|
-
);
|
|
15386
|
+
context.onError(createCompilerError(47, arg.loc));
|
|
15321
15387
|
}
|
|
15322
15388
|
if (rawName.startsWith("vue:")) {
|
|
15323
15389
|
rawName = `vnode-${rawName.slice(4)}`;
|
|
@@ -15651,17 +15717,17 @@ function baseCompile(source, options = {}) {
|
|
|
15651
15717
|
const isModuleMode = options.mode === "module";
|
|
15652
15718
|
{
|
|
15653
15719
|
if (options.prefixIdentifiers === true) {
|
|
15654
|
-
onError(createCompilerError(47));
|
|
15655
|
-
} else if (isModuleMode) {
|
|
15656
15720
|
onError(createCompilerError(48));
|
|
15721
|
+
} else if (isModuleMode) {
|
|
15722
|
+
onError(createCompilerError(49));
|
|
15657
15723
|
}
|
|
15658
15724
|
}
|
|
15659
15725
|
const prefixIdentifiers = false;
|
|
15660
15726
|
if (options.cacheHandlers) {
|
|
15661
|
-
onError(createCompilerError(
|
|
15727
|
+
onError(createCompilerError(50));
|
|
15662
15728
|
}
|
|
15663
15729
|
if (options.scopeId && !isModuleMode) {
|
|
15664
|
-
onError(createCompilerError(
|
|
15730
|
+
onError(createCompilerError(51));
|
|
15665
15731
|
}
|
|
15666
15732
|
const ast = isString(source) ? baseParse(source, options) : source;
|
|
15667
15733
|
const [nodeTransforms, directiveTransforms] = getBaseTransformPreset();
|
|
@@ -16156,7 +16222,15 @@ function compile(src, options = {}) {
|
|
|
16156
16222
|
{
|
|
16157
16223
|
initDev();
|
|
16158
16224
|
}
|
|
16159
|
-
const compileCache = /* @__PURE__ */
|
|
16225
|
+
const compileCache = /* @__PURE__ */ new WeakMap();
|
|
16226
|
+
function getCache(options) {
|
|
16227
|
+
let c = compileCache.get(options != null ? options : EMPTY_OBJ);
|
|
16228
|
+
if (!c) {
|
|
16229
|
+
c = /* @__PURE__ */ Object.create(null);
|
|
16230
|
+
compileCache.set(options != null ? options : EMPTY_OBJ, c);
|
|
16231
|
+
}
|
|
16232
|
+
return c;
|
|
16233
|
+
}
|
|
16160
16234
|
function compileToFunction(template, options) {
|
|
16161
16235
|
if (!isString(template)) {
|
|
16162
16236
|
if (template.nodeType) {
|
|
@@ -16167,7 +16241,8 @@ function compileToFunction(template, options) {
|
|
|
16167
16241
|
}
|
|
16168
16242
|
}
|
|
16169
16243
|
const key = template;
|
|
16170
|
-
const
|
|
16244
|
+
const cache = getCache(options);
|
|
16245
|
+
const cached = cache[key];
|
|
16171
16246
|
if (cached) {
|
|
16172
16247
|
return cached;
|
|
16173
16248
|
}
|
|
@@ -16202,8 +16277,8 @@ ${codeFrame}` : message);
|
|
|
16202
16277
|
}
|
|
16203
16278
|
const render = new Function("Vue", code)(runtimeDom);
|
|
16204
16279
|
render._rc = true;
|
|
16205
|
-
return
|
|
16280
|
+
return cache[key] = render;
|
|
16206
16281
|
}
|
|
16207
16282
|
registerRuntimeCompiler(compileToFunction);
|
|
16208
16283
|
|
|
16209
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|
|
16284
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|