@vue/runtime-core 3.6.0-beta.6 → 3.6.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-core.cjs.js +63 -88
- package/dist/runtime-core.cjs.prod.js +54 -84
- package/dist/runtime-core.d.ts +29 -3
- package/dist/runtime-core.esm-bundler.js +67 -80
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-core v3.6.0-beta.8
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
Object.defineProperties(exports, {
|
|
6
|
+
Object.defineProperties(exports, {
|
|
7
|
+
__esModule: { value: true },
|
|
8
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
9
|
+
});
|
|
7
10
|
let _vue_reactivity = require("@vue/reactivity");
|
|
8
11
|
let _vue_shared = require("@vue/shared");
|
|
9
|
-
|
|
10
12
|
//#region packages/runtime-core/src/warning.ts
|
|
11
13
|
const stack = [];
|
|
12
14
|
/**
|
|
@@ -32,8 +34,8 @@ function warn$1(msg, ...args) {
|
|
|
32
34
|
const trace = getComponentTrace();
|
|
33
35
|
if (appWarnHandler) callWithErrorHandling(appWarnHandler, instance, 11, [
|
|
34
36
|
msg + args.map((a) => {
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
+
const toString = a.toString;
|
|
38
|
+
return toString == null ? JSON.stringify(a) : toString.call(a);
|
|
37
39
|
}).join(""),
|
|
38
40
|
instance && instance.proxy || instance,
|
|
39
41
|
trace.map(({ ctx }) => `at <${formatComponentName(instance, ctx.type)}>`).join("\n"),
|
|
@@ -123,7 +125,6 @@ function assertNumber(val, type) {
|
|
|
123
125
|
else if (isNaN(val)) warn$1(`${type} is NaN - the duration expression might be incorrect.`);
|
|
124
126
|
}
|
|
125
127
|
/* v8 ignore stop */
|
|
126
|
-
|
|
127
128
|
//#endregion
|
|
128
129
|
//#region packages/runtime-core/src/errorHandling.ts
|
|
129
130
|
const ErrorCodes = {
|
|
@@ -246,7 +247,6 @@ function logError(err, type, instance, throwInDev = true, throwInProd = false) {
|
|
|
246
247
|
else console.error(err);
|
|
247
248
|
}
|
|
248
249
|
}
|
|
249
|
-
|
|
250
250
|
//#endregion
|
|
251
251
|
//#region packages/runtime-core/src/scheduler.ts
|
|
252
252
|
const jobs = [];
|
|
@@ -399,7 +399,6 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
399
399
|
seen.set(fn, count + 1);
|
|
400
400
|
return false;
|
|
401
401
|
}
|
|
402
|
-
|
|
403
402
|
//#endregion
|
|
404
403
|
//#region packages/runtime-core/src/hmr.ts
|
|
405
404
|
let isHmrUpdating = false;
|
|
@@ -521,7 +520,6 @@ function tryWrap(fn) {
|
|
|
521
520
|
}
|
|
522
521
|
};
|
|
523
522
|
}
|
|
524
|
-
|
|
525
523
|
//#endregion
|
|
526
524
|
//#region packages/runtime-core/src/devtools.ts
|
|
527
525
|
let devtools$1;
|
|
@@ -590,7 +588,6 @@ function createDevtoolsPerformanceHook(hook) {
|
|
|
590
588
|
function devtoolsComponentEmit(component, event, params) {
|
|
591
589
|
emit$1("component:emit", component.appContext.app, component, event, params);
|
|
592
590
|
}
|
|
593
|
-
|
|
594
591
|
//#endregion
|
|
595
592
|
//#region packages/runtime-core/src/componentRenderContext.ts
|
|
596
593
|
/**
|
|
@@ -660,7 +657,6 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
660
657
|
renderFnWithContext._d = true;
|
|
661
658
|
return renderFnWithContext;
|
|
662
659
|
}
|
|
663
|
-
|
|
664
660
|
//#endregion
|
|
665
661
|
//#region packages/runtime-core/src/directives.ts
|
|
666
662
|
function validateDirectiveName(name) {
|
|
@@ -715,7 +711,6 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
715
711
|
}
|
|
716
712
|
}
|
|
717
713
|
}
|
|
718
|
-
|
|
719
714
|
//#endregion
|
|
720
715
|
//#region packages/runtime-core/src/apiInject.ts
|
|
721
716
|
function provide(key, value) {
|
|
@@ -744,7 +739,6 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
744
739
|
function hasInjectionContext() {
|
|
745
740
|
return !!(getCurrentGenericInstance() || currentApp);
|
|
746
741
|
}
|
|
747
|
-
|
|
748
742
|
//#endregion
|
|
749
743
|
//#region packages/runtime-core/src/helpers/useSsrContext.ts
|
|
750
744
|
const ssrContextKey = Symbol.for("v-scx");
|
|
@@ -755,7 +749,6 @@ const useSSRContext = () => {
|
|
|
755
749
|
return ctx;
|
|
756
750
|
}
|
|
757
751
|
};
|
|
758
|
-
|
|
759
752
|
//#endregion
|
|
760
753
|
//#region packages/runtime-core/src/apiWatch.ts
|
|
761
754
|
function watchEffect(effect, options) {
|
|
@@ -856,7 +849,6 @@ function createPathGetter(ctx, path) {
|
|
|
856
849
|
return cur;
|
|
857
850
|
};
|
|
858
851
|
}
|
|
859
|
-
|
|
860
852
|
//#endregion
|
|
861
853
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
862
854
|
const TeleportEndKey = Symbol("_vte");
|
|
@@ -1054,7 +1046,6 @@ function prepareAnchor(target, vnode, createText, insert, anchor = null) {
|
|
|
1054
1046
|
}
|
|
1055
1047
|
return targetAnchor;
|
|
1056
1048
|
}
|
|
1057
|
-
|
|
1058
1049
|
//#endregion
|
|
1059
1050
|
//#region packages/runtime-core/src/components/BaseTransition.ts
|
|
1060
1051
|
const leaveCbKey = Symbol("_leaveCb");
|
|
@@ -1177,6 +1168,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1177
1168
|
const key = String(vnode.key);
|
|
1178
1169
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
1179
1170
|
return baseResolveTransitionHooks({
|
|
1171
|
+
isLeaving: () => leavingVNodesCache[key] === vnode,
|
|
1180
1172
|
setLeavingNodeCache: () => {
|
|
1181
1173
|
leavingVNodesCache[key] = vnode;
|
|
1182
1174
|
},
|
|
@@ -1195,7 +1187,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1195
1187
|
}, props, state, instance);
|
|
1196
1188
|
}
|
|
1197
1189
|
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
1198
|
-
const { setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
|
|
1190
|
+
const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
|
|
1199
1191
|
const { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props;
|
|
1200
1192
|
const callHook = (hook, args) => {
|
|
1201
1193
|
hook && callWithAsyncErrorHandling(hook, instance, 9, args);
|
|
@@ -1219,6 +1211,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
1219
1211
|
callHook(hook, [el]);
|
|
1220
1212
|
},
|
|
1221
1213
|
enter(el) {
|
|
1214
|
+
if (isLeaving()) return;
|
|
1222
1215
|
let hook = onEnter;
|
|
1223
1216
|
let afterHook = onAfterEnter;
|
|
1224
1217
|
let cancelHook = onEnterCancelled;
|
|
@@ -1315,14 +1308,12 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
1315
1308
|
function checkTransitionMode(mode) {
|
|
1316
1309
|
if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") warn$1(`invalid <transition> mode: ${mode}`);
|
|
1317
1310
|
}
|
|
1318
|
-
|
|
1319
1311
|
//#endregion
|
|
1320
1312
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
1321
1313
|
/* @__NO_SIDE_EFFECTS__ */
|
|
1322
1314
|
function defineComponent(options, extraOptions) {
|
|
1323
1315
|
return (0, _vue_shared.isFunction)(options) ? (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
1324
1316
|
}
|
|
1325
|
-
|
|
1326
1317
|
//#endregion
|
|
1327
1318
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
1328
1319
|
function useId() {
|
|
@@ -1344,7 +1335,6 @@ function markAsyncBoundary(instance) {
|
|
|
1344
1335
|
0
|
|
1345
1336
|
];
|
|
1346
1337
|
}
|
|
1347
|
-
|
|
1348
1338
|
//#endregion
|
|
1349
1339
|
//#region packages/runtime-core/src/helpers/useTemplateRef.ts
|
|
1350
1340
|
const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
|
|
@@ -1368,7 +1358,6 @@ function isTemplateRefKey(refs, key) {
|
|
|
1368
1358
|
let desc;
|
|
1369
1359
|
return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable);
|
|
1370
1360
|
}
|
|
1371
|
-
|
|
1372
1361
|
//#endregion
|
|
1373
1362
|
//#region packages/runtime-core/src/rendererTemplateRef.ts
|
|
1374
1363
|
const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -1467,20 +1456,12 @@ function invalidatePendingSetRef(rawRef) {
|
|
|
1467
1456
|
pendingSetRefMap.delete(rawRef);
|
|
1468
1457
|
}
|
|
1469
1458
|
}
|
|
1470
|
-
|
|
1471
1459
|
//#endregion
|
|
1472
1460
|
//#region packages/runtime-core/src/hydration.ts
|
|
1473
1461
|
let isHydratingEnabled = false;
|
|
1474
1462
|
function setIsHydratingEnabled(value) {
|
|
1475
1463
|
isHydratingEnabled = value;
|
|
1476
1464
|
}
|
|
1477
|
-
/**
|
|
1478
|
-
* VDOM hydration state.
|
|
1479
|
-
* Also used by vapor interop plugin for tree-shaking:
|
|
1480
|
-
* In non-hydration builds, this is never set to true, so the logic in
|
|
1481
|
-
* vaporInteropImpl's hydrate/hydrateSlot can be tree-shaken.
|
|
1482
|
-
*/
|
|
1483
|
-
let isHydrating = false;
|
|
1484
1465
|
let hasLoggedMismatchError = false;
|
|
1485
1466
|
const logMismatchError = () => {
|
|
1486
1467
|
if (hasLoggedMismatchError) return;
|
|
@@ -1506,9 +1487,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1506
1487
|
container._vnode = vnode;
|
|
1507
1488
|
return;
|
|
1508
1489
|
}
|
|
1509
|
-
isHydrating = true;
|
|
1510
1490
|
hydrateNode(container.firstChild, vnode, null, null, null);
|
|
1511
|
-
isHydrating = false;
|
|
1512
1491
|
flushPostFlushCbs();
|
|
1513
1492
|
container._vnode = vnode;
|
|
1514
1493
|
};
|
|
@@ -1877,7 +1856,6 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
1877
1856
|
return list.includes(MismatchTypeString[allowedType]);
|
|
1878
1857
|
}
|
|
1879
1858
|
}
|
|
1880
|
-
|
|
1881
1859
|
//#endregion
|
|
1882
1860
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
1883
1861
|
let requestIdleCallback;
|
|
@@ -1966,7 +1944,6 @@ function forEachElement(node, cb) {
|
|
|
1966
1944
|
}
|
|
1967
1945
|
} else cb(node);
|
|
1968
1946
|
}
|
|
1969
|
-
|
|
1970
1947
|
//#endregion
|
|
1971
1948
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
1972
1949
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
@@ -2103,11 +2080,10 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
2103
2080
|
if (getResolvedComp()) doHydrate();
|
|
2104
2081
|
else load().then(() => !instance.isUnmounted && doHydrate());
|
|
2105
2082
|
}
|
|
2106
|
-
|
|
2107
2083
|
//#endregion
|
|
2108
2084
|
//#region packages/runtime-core/src/components/KeepAlive.ts
|
|
2109
2085
|
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
2110
|
-
const
|
|
2086
|
+
const KeepAlive = {
|
|
2111
2087
|
name: `KeepAlive`,
|
|
2112
2088
|
__isKeepAlive: true,
|
|
2113
2089
|
props: {
|
|
@@ -2245,7 +2221,6 @@ const KeepAliveImpl = {
|
|
|
2245
2221
|
};
|
|
2246
2222
|
}
|
|
2247
2223
|
};
|
|
2248
|
-
const KeepAlive = KeepAliveImpl;
|
|
2249
2224
|
function matches(pattern, name) {
|
|
2250
2225
|
if ((0, _vue_shared.isArray)(pattern)) return pattern.some((p) => matches(p, name));
|
|
2251
2226
|
else if ((0, _vue_shared.isString)(pattern)) return pattern.split(",").includes(name);
|
|
@@ -2325,7 +2300,6 @@ function deactivate(vnode, container, { m: move }, parentComponent, parentSuspen
|
|
|
2325
2300
|
}, void 0, parentSuspense);
|
|
2326
2301
|
devtoolsComponentAdded(instance);
|
|
2327
2302
|
}
|
|
2328
|
-
|
|
2329
2303
|
//#endregion
|
|
2330
2304
|
//#region packages/runtime-core/src/apiLifecycle.ts
|
|
2331
2305
|
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
@@ -2361,23 +2335,19 @@ const onRenderTracked = /* @__PURE__ */ createHook("rtc");
|
|
|
2361
2335
|
function onErrorCaptured(hook, target = currentInstance) {
|
|
2362
2336
|
injectHook("ec", hook, target);
|
|
2363
2337
|
}
|
|
2364
|
-
|
|
2365
|
-
//#endregion
|
|
2366
|
-
//#region packages/runtime-core/src/helpers/resolveAssets.ts
|
|
2367
|
-
const COMPONENTS = "components";
|
|
2368
2338
|
const DIRECTIVES = "directives";
|
|
2369
2339
|
/**
|
|
2370
2340
|
* @private
|
|
2371
2341
|
*/
|
|
2372
2342
|
function resolveComponent(name, maybeSelfReference) {
|
|
2373
|
-
return resolveAsset(
|
|
2343
|
+
return resolveAsset("components", name, true, maybeSelfReference) || name;
|
|
2374
2344
|
}
|
|
2375
2345
|
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2376
2346
|
/**
|
|
2377
2347
|
* @private
|
|
2378
2348
|
*/
|
|
2379
2349
|
function resolveDynamicComponent(component) {
|
|
2380
|
-
if ((0, _vue_shared.isString)(component)) return resolveAsset(
|
|
2350
|
+
if ((0, _vue_shared.isString)(component)) return resolveAsset("components", component, false) || component;
|
|
2381
2351
|
else return component || NULL_DYNAMIC_COMPONENT;
|
|
2382
2352
|
}
|
|
2383
2353
|
/**
|
|
@@ -2390,14 +2360,14 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
2390
2360
|
const instance = currentRenderingInstance || currentInstance;
|
|
2391
2361
|
if (instance) {
|
|
2392
2362
|
const Component = instance.type;
|
|
2393
|
-
if (type ===
|
|
2363
|
+
if (type === "components") {
|
|
2394
2364
|
const selfName = getComponentName(Component, false);
|
|
2395
2365
|
if (selfName && (selfName === name || selfName === (0, _vue_shared.camelize)(name) || selfName === (0, _vue_shared.capitalize)((0, _vue_shared.camelize)(name)))) return Component;
|
|
2396
2366
|
}
|
|
2397
2367
|
const res = resolve(instance[type] || Component[type], name) || resolve(instance.appContext[type], name);
|
|
2398
2368
|
if (!res && maybeSelfReference) return Component;
|
|
2399
2369
|
if (warnMissing && !res) {
|
|
2400
|
-
const extra = type ===
|
|
2370
|
+
const extra = type === "components" ? "\nIf this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement." : ``;
|
|
2401
2371
|
warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
2402
2372
|
}
|
|
2403
2373
|
return res;
|
|
@@ -2406,7 +2376,6 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
2406
2376
|
function resolve(registry, name) {
|
|
2407
2377
|
return registry && (registry[name] || registry[(0, _vue_shared.camelize)(name)] || registry[(0, _vue_shared.capitalize)((0, _vue_shared.camelize)(name))]);
|
|
2408
2378
|
}
|
|
2409
|
-
|
|
2410
2379
|
//#endregion
|
|
2411
2380
|
//#region packages/runtime-core/src/helpers/renderList.ts
|
|
2412
2381
|
/**
|
|
@@ -2427,11 +2396,14 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2427
2396
|
}
|
|
2428
2397
|
ret = new Array(source.length);
|
|
2429
2398
|
for (let i = 0, l = source.length; i < l; i++) ret[i] = renderItem(needsWrap ? isReadonlySource ? (0, _vue_reactivity.toReadonly)((0, _vue_reactivity.toReactive)(source[i])) : (0, _vue_reactivity.toReactive)(source[i]) : source[i], i, void 0, cached && cached[i]);
|
|
2430
|
-
} else if (typeof source === "number") {
|
|
2431
|
-
|
|
2399
|
+
} else if (typeof source === "number") if (!Number.isInteger(source) || source < 0) {
|
|
2400
|
+
warn$1(`The v-for range expects a positive integer value but got ${source}.`);
|
|
2401
|
+
ret = [];
|
|
2402
|
+
} else {
|
|
2432
2403
|
ret = new Array(source);
|
|
2433
2404
|
for (let i = 0; i < source; i++) ret[i] = renderItem(i + 1, i, void 0, cached && cached[i]);
|
|
2434
|
-
}
|
|
2405
|
+
}
|
|
2406
|
+
else if ((0, _vue_shared.isObject)(source)) if (source[Symbol.iterator]) ret = Array.from(source, (item, i) => renderItem(item, i, void 0, cached && cached[i]));
|
|
2435
2407
|
else {
|
|
2436
2408
|
const keys = Object.keys(source);
|
|
2437
2409
|
ret = new Array(keys.length);
|
|
@@ -2444,7 +2416,6 @@ function renderList(source, renderItem, cache, index) {
|
|
|
2444
2416
|
if (cache) cache[index] = ret;
|
|
2445
2417
|
return ret;
|
|
2446
2418
|
}
|
|
2447
|
-
|
|
2448
2419
|
//#endregion
|
|
2449
2420
|
//#region packages/runtime-core/src/helpers/createSlots.ts
|
|
2450
2421
|
/**
|
|
@@ -2463,7 +2434,6 @@ function createSlots(slots, dynamicSlots) {
|
|
|
2463
2434
|
}
|
|
2464
2435
|
return slots;
|
|
2465
2436
|
}
|
|
2466
|
-
|
|
2467
2437
|
//#endregion
|
|
2468
2438
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
2469
2439
|
/**
|
|
@@ -2514,7 +2484,6 @@ function ensureVaporSlotFallback(vnodes, fallback) {
|
|
|
2514
2484
|
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
2515
2485
|
}
|
|
2516
2486
|
}
|
|
2517
|
-
|
|
2518
2487
|
//#endregion
|
|
2519
2488
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
2520
2489
|
/**
|
|
@@ -2530,7 +2499,6 @@ function toHandlers(obj, preserveCaseIfNecessary) {
|
|
|
2530
2499
|
for (const key in obj) ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : (0, _vue_shared.toHandlerKey)(key)] = obj[key];
|
|
2531
2500
|
return ret;
|
|
2532
2501
|
}
|
|
2533
|
-
|
|
2534
2502
|
//#endregion
|
|
2535
2503
|
//#region packages/runtime-core/src/componentPublicInstance.ts
|
|
2536
2504
|
/**
|
|
@@ -2709,7 +2677,6 @@ function exposeSetupStateOnRenderContext(instance) {
|
|
|
2709
2677
|
}
|
|
2710
2678
|
});
|
|
2711
2679
|
}
|
|
2712
|
-
|
|
2713
2680
|
//#endregion
|
|
2714
2681
|
//#region packages/runtime-core/src/apiSetupHelpers.ts
|
|
2715
2682
|
const warnRuntimeUsage = (method) => warn$1(`${method}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`);
|
|
@@ -2748,6 +2715,22 @@ function defineExpose(exposed) {
|
|
|
2748
2715
|
function defineOptions(options) {
|
|
2749
2716
|
warnRuntimeUsage(`defineOptions`);
|
|
2750
2717
|
}
|
|
2718
|
+
/**
|
|
2719
|
+
* Vue `<script setup>` compiler macro for providing type hints to IDEs for
|
|
2720
|
+
* slot name and slot props type checking.
|
|
2721
|
+
*
|
|
2722
|
+
* Example usage:
|
|
2723
|
+
* ```ts
|
|
2724
|
+
* const slots = defineSlots<{
|
|
2725
|
+
* default(props: { msg: string }): any
|
|
2726
|
+
* }>()
|
|
2727
|
+
* ```
|
|
2728
|
+
*
|
|
2729
|
+
* This is only usable inside `<script setup>`, is compiled away in the
|
|
2730
|
+
* output and should **not** be actually called at runtime.
|
|
2731
|
+
*
|
|
2732
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineslots}
|
|
2733
|
+
*/
|
|
2751
2734
|
function defineSlots() {
|
|
2752
2735
|
warnRuntimeUsage(`defineSlots`);
|
|
2753
2736
|
return null;
|
|
@@ -2864,16 +2847,29 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
2864
2847
|
*/
|
|
2865
2848
|
function withAsyncContext(getAwaitable) {
|
|
2866
2849
|
const ctx = getCurrentGenericInstance();
|
|
2850
|
+
const inSSRSetup = isInSSRComponentSetup;
|
|
2867
2851
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
2868
2852
|
let awaitable = getAwaitable();
|
|
2869
2853
|
setCurrentInstance(null, void 0);
|
|
2870
|
-
if (
|
|
2854
|
+
if (inSSRSetup) setInSSRSetupState(false);
|
|
2855
|
+
const restore = () => {
|
|
2871
2856
|
setCurrentInstance(ctx);
|
|
2857
|
+
if (inSSRSetup) setInSSRSetupState(true);
|
|
2858
|
+
};
|
|
2859
|
+
const cleanup = () => {
|
|
2860
|
+
setCurrentInstance(null, void 0);
|
|
2861
|
+
if (inSSRSetup) setInSSRSetupState(false);
|
|
2862
|
+
};
|
|
2863
|
+
if ((0, _vue_shared.isPromise)(awaitable)) awaitable = awaitable.catch((e) => {
|
|
2864
|
+
restore();
|
|
2865
|
+
Promise.resolve().then(() => Promise.resolve().then(cleanup));
|
|
2872
2866
|
throw e;
|
|
2873
2867
|
});
|
|
2874
|
-
return [awaitable, () =>
|
|
2868
|
+
return [awaitable, () => {
|
|
2869
|
+
restore();
|
|
2870
|
+
Promise.resolve().then(cleanup);
|
|
2871
|
+
}];
|
|
2875
2872
|
}
|
|
2876
|
-
|
|
2877
2873
|
//#endregion
|
|
2878
2874
|
//#region packages/runtime-core/src/componentOptions.ts
|
|
2879
2875
|
function createDuplicateChecker() {
|
|
@@ -3119,7 +3115,6 @@ function mergeWatchOptions(to, from) {
|
|
|
3119
3115
|
for (const key in from) merged[key] = mergeAsArray(to[key], from[key]);
|
|
3120
3116
|
return merged;
|
|
3121
3117
|
}
|
|
3122
|
-
|
|
3123
3118
|
//#endregion
|
|
3124
3119
|
//#region packages/runtime-core/src/apiCreateApp.ts
|
|
3125
3120
|
function createAppContext() {
|
|
@@ -3251,7 +3246,6 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
3251
3246
|
* `app.runWithContext()`.
|
|
3252
3247
|
*/
|
|
3253
3248
|
let currentApp = null;
|
|
3254
|
-
|
|
3255
3249
|
//#endregion
|
|
3256
3250
|
//#region packages/runtime-core/src/helpers/useModel.ts
|
|
3257
3251
|
function useModel(props, name, options = _vue_shared.EMPTY_OBJ) {
|
|
@@ -3324,7 +3318,6 @@ function useModel(props, name, options = _vue_shared.EMPTY_OBJ) {
|
|
|
3324
3318
|
const getModelModifiers = (props, modelName, getter) => {
|
|
3325
3319
|
return getter(props, (0, _vue_shared.getModifierPropName)(modelName)) || getter(props, `${(0, _vue_shared.camelize)(modelName)}Modifiers`) || getter(props, `${(0, _vue_shared.hyphenate)(modelName)}Modifiers`);
|
|
3326
3320
|
};
|
|
3327
|
-
|
|
3328
3321
|
//#endregion
|
|
3329
3322
|
//#region packages/runtime-core/src/componentEmits.ts
|
|
3330
3323
|
function emit(instance, event, ...rawArgs) {
|
|
@@ -3414,7 +3407,6 @@ function isEmitListener(options, key) {
|
|
|
3414
3407
|
key = key.slice(2).replace(/Once$/, "");
|
|
3415
3408
|
return (0, _vue_shared.hasOwn)(options, key[0].toLowerCase() + key.slice(1)) || (0, _vue_shared.hasOwn)(options, (0, _vue_shared.hyphenate)(key)) || (0, _vue_shared.hasOwn)(options, key);
|
|
3416
3409
|
}
|
|
3417
|
-
|
|
3418
3410
|
//#endregion
|
|
3419
3411
|
//#region packages/runtime-core/src/componentRenderUtils.ts
|
|
3420
3412
|
/**
|
|
@@ -3606,7 +3598,6 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
3606
3598
|
} else break;
|
|
3607
3599
|
}
|
|
3608
3600
|
}
|
|
3609
|
-
|
|
3610
3601
|
//#endregion
|
|
3611
3602
|
//#region packages/runtime-core/src/internalObject.ts
|
|
3612
3603
|
/**
|
|
@@ -3618,7 +3609,6 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
3618
3609
|
const internalObjectProto = {};
|
|
3619
3610
|
const createInternalObject = () => Object.create(internalObjectProto);
|
|
3620
3611
|
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
3621
|
-
|
|
3622
3612
|
//#endregion
|
|
3623
3613
|
//#region packages/runtime-core/src/componentProps.ts
|
|
3624
3614
|
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
@@ -3914,7 +3904,6 @@ function isExplicable(type) {
|
|
|
3914
3904
|
function isBoolean(...args) {
|
|
3915
3905
|
return args.some((elem) => elem.toLowerCase() === "boolean");
|
|
3916
3906
|
}
|
|
3917
|
-
|
|
3918
3907
|
//#endregion
|
|
3919
3908
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
3920
3909
|
const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
|
|
@@ -3983,7 +3972,6 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
3983
3972
|
for (const key in slots) if (!isInternalKey(key) && deletionComparisonTarget[key] == null) delete slots[key];
|
|
3984
3973
|
}
|
|
3985
3974
|
};
|
|
3986
|
-
|
|
3987
3975
|
//#endregion
|
|
3988
3976
|
//#region packages/runtime-core/src/profiling.ts
|
|
3989
3977
|
let supported;
|
|
@@ -4022,7 +4010,6 @@ function isSupported() {
|
|
|
4022
4010
|
} else supported = false;
|
|
4023
4011
|
return supported;
|
|
4024
4012
|
}
|
|
4025
|
-
|
|
4026
4013
|
//#endregion
|
|
4027
4014
|
//#region packages/runtime-core/src/renderer.ts
|
|
4028
4015
|
const MoveType = {
|
|
@@ -4087,7 +4074,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4087
4074
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4088
4075
|
break;
|
|
4089
4076
|
case VaporSlot:
|
|
4090
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent);
|
|
4077
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
4091
4078
|
break;
|
|
4092
4079
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
4093
4080
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -4410,7 +4397,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4410
4397
|
if (isAsyncWrapperVNode && type.__asyncHydrate) type.__asyncHydrate(el, instance, hydrateSubTree);
|
|
4411
4398
|
else hydrateSubTree();
|
|
4412
4399
|
} else {
|
|
4413
|
-
if (root.ce && root.ce._hasShadowRoot()) root.ce._injectChildStyle(type);
|
|
4400
|
+
if (root.ce && root.ce._hasShadowRoot()) root.ce._injectChildStyle(type, instance.parent ? instance.parent.type : void 0);
|
|
4414
4401
|
startMeasure(instance, `render`);
|
|
4415
4402
|
const subTree = instance.subTree = renderComponentRoot(instance);
|
|
4416
4403
|
endMeasure(instance, `render`);
|
|
@@ -4924,12 +4911,11 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
|
4924
4911
|
if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
4925
4912
|
return null;
|
|
4926
4913
|
}
|
|
4927
|
-
|
|
4928
4914
|
//#endregion
|
|
4929
4915
|
//#region packages/runtime-core/src/components/Suspense.ts
|
|
4930
4916
|
const isSuspense = (type) => type.__isSuspense;
|
|
4931
4917
|
let suspenseId = 0;
|
|
4932
|
-
const
|
|
4918
|
+
const Suspense = {
|
|
4933
4919
|
name: "Suspense",
|
|
4934
4920
|
__isSuspense: true,
|
|
4935
4921
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
@@ -4947,7 +4933,6 @@ const SuspenseImpl = {
|
|
|
4947
4933
|
hydrate: hydrateSuspense,
|
|
4948
4934
|
normalize: normalizeSuspenseChildren
|
|
4949
4935
|
};
|
|
4950
|
-
const Suspense = SuspenseImpl;
|
|
4951
4936
|
function triggerEvent(vnode, name) {
|
|
4952
4937
|
const eventListener = vnode.props && vnode.props[name];
|
|
4953
4938
|
if ((0, _vue_shared.isFunction)(eventListener)) eventListener();
|
|
@@ -5208,7 +5193,6 @@ function isVNodeSuspensible(vnode) {
|
|
|
5208
5193
|
const suspensible = vnode.props && vnode.props.suspensible;
|
|
5209
5194
|
return suspensible != null && suspensible !== false;
|
|
5210
5195
|
}
|
|
5211
|
-
|
|
5212
5196
|
//#endregion
|
|
5213
5197
|
//#region packages/runtime-core/src/vnode.ts
|
|
5214
5198
|
const Fragment = Symbol.for("v-fgt");
|
|
@@ -5526,7 +5510,6 @@ function mergeProps(...args) {
|
|
|
5526
5510
|
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
5527
5511
|
callWithAsyncErrorHandling(hook, instance, 7, [vnode, prevVNode]);
|
|
5528
5512
|
}
|
|
5529
|
-
|
|
5530
5513
|
//#endregion
|
|
5531
5514
|
//#region packages/runtime-core/src/componentCurrentInstance.ts
|
|
5532
5515
|
/**
|
|
@@ -5594,7 +5577,6 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
5594
5577
|
value: instance[key]
|
|
5595
5578
|
};
|
|
5596
5579
|
};
|
|
5597
|
-
|
|
5598
5580
|
//#endregion
|
|
5599
5581
|
//#region packages/runtime-core/src/component.ts
|
|
5600
5582
|
const emptyAppContext = /* @__PURE__ */ createAppContext();
|
|
@@ -5890,13 +5872,11 @@ function formatComponentName(instance, Component, isRoot = false) {
|
|
|
5890
5872
|
function isClassComponent(value) {
|
|
5891
5873
|
return (0, _vue_shared.isFunction)(value) && "__vccOpts" in value;
|
|
5892
5874
|
}
|
|
5893
|
-
|
|
5894
5875
|
//#endregion
|
|
5895
5876
|
//#region packages/runtime-core/src/apiComputed.ts
|
|
5896
5877
|
const computed = (getterOrOptions, debugOptions) => {
|
|
5897
5878
|
return (0, _vue_reactivity.computed)(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
5898
5879
|
};
|
|
5899
|
-
|
|
5900
5880
|
//#endregion
|
|
5901
5881
|
//#region packages/runtime-core/src/h.ts
|
|
5902
5882
|
function h(type, propsOrChildren, children) {
|
|
@@ -5916,7 +5896,6 @@ function h(type, propsOrChildren, children) {
|
|
|
5916
5896
|
setBlockTracking(1);
|
|
5917
5897
|
}
|
|
5918
5898
|
}
|
|
5919
|
-
|
|
5920
5899
|
//#endregion
|
|
5921
5900
|
//#region packages/runtime-core/src/customFormatter.ts
|
|
5922
5901
|
function initCustomFormatter() {
|
|
@@ -6081,7 +6060,6 @@ function initCustomFormatter() {
|
|
|
6081
6060
|
if (window.devtoolsFormatters) window.devtoolsFormatters.push(formatter);
|
|
6082
6061
|
else window.devtoolsFormatters = [formatter];
|
|
6083
6062
|
}
|
|
6084
|
-
|
|
6085
6063
|
//#endregion
|
|
6086
6064
|
//#region packages/runtime-core/src/helpers/withMemo.ts
|
|
6087
6065
|
function withMemo(memo, render, cache, index) {
|
|
@@ -6099,10 +6077,9 @@ function isMemoSame(cached, memo) {
|
|
|
6099
6077
|
if (isBlockTreeEnabled > 0 && currentBlock) currentBlock.push(cached);
|
|
6100
6078
|
return true;
|
|
6101
6079
|
}
|
|
6102
|
-
|
|
6103
6080
|
//#endregion
|
|
6104
6081
|
//#region packages/runtime-core/src/index.ts
|
|
6105
|
-
const version = "3.6.0-beta.
|
|
6082
|
+
const version = "3.6.0-beta.8";
|
|
6106
6083
|
const warn = warn$1;
|
|
6107
6084
|
/**
|
|
6108
6085
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -6111,7 +6088,11 @@ const warn = warn$1;
|
|
|
6111
6088
|
const ErrorTypeStrings = ErrorTypeStrings$1;
|
|
6112
6089
|
const devtools = devtools$1;
|
|
6113
6090
|
const setDevtoolsHook = setDevtoolsHook$1;
|
|
6114
|
-
|
|
6091
|
+
/**
|
|
6092
|
+
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
6093
|
+
* @internal
|
|
6094
|
+
*/
|
|
6095
|
+
const ssrUtils = {
|
|
6115
6096
|
createComponentInstance,
|
|
6116
6097
|
setupComponent,
|
|
6117
6098
|
renderComponentRoot,
|
|
@@ -6124,11 +6105,6 @@ const _ssrUtils = {
|
|
|
6124
6105
|
popWarningContext
|
|
6125
6106
|
};
|
|
6126
6107
|
/**
|
|
6127
|
-
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
6128
|
-
* @internal
|
|
6129
|
-
*/
|
|
6130
|
-
const ssrUtils = _ssrUtils;
|
|
6131
|
-
/**
|
|
6132
6108
|
* @internal only exposed in compat builds
|
|
6133
6109
|
*/
|
|
6134
6110
|
const resolveFilter = null;
|
|
@@ -6137,7 +6113,6 @@ const resolveFilter = null;
|
|
|
6137
6113
|
*/
|
|
6138
6114
|
const compatUtils = null;
|
|
6139
6115
|
const DeprecationTypes = null;
|
|
6140
|
-
|
|
6141
6116
|
//#endregion
|
|
6142
6117
|
exports.BaseTransition = BaseTransition;
|
|
6143
6118
|
exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
|
|
@@ -6288,4 +6263,4 @@ exports.withCtx = withCtx;
|
|
|
6288
6263
|
exports.withDefaults = withDefaults;
|
|
6289
6264
|
exports.withDirectives = withDirectives;
|
|
6290
6265
|
exports.withMemo = withMemo;
|
|
6291
|
-
exports.withScopeId = withScopeId;
|
|
6266
|
+
exports.withScopeId = withScopeId;
|