@vue/runtime-core 3.6.0-beta.7 → 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 +55 -87
- package/dist/runtime-core.cjs.prod.js +46 -83
- package/dist/runtime-core.d.ts +28 -3
- package/dist/runtime-core.esm-bundler.js +51 -78
- package/package.json +3 -3
|
@@ -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
|
/**
|
|
@@ -26,7 +28,6 @@ function popWarningContext() {
|
|
|
26
28
|
*/
|
|
27
29
|
function assertNumber(val, type) {}
|
|
28
30
|
/* v8 ignore stop */
|
|
29
|
-
|
|
30
31
|
//#endregion
|
|
31
32
|
//#region packages/runtime-core/src/errorHandling.ts
|
|
32
33
|
const ErrorCodes = {
|
|
@@ -143,7 +144,6 @@ function logError(err, type, instance, throwInDev = true, throwInProd = false) {
|
|
|
143
144
|
if (throwInProd) throw err;
|
|
144
145
|
else console.error(err);
|
|
145
146
|
}
|
|
146
|
-
|
|
147
147
|
//#endregion
|
|
148
148
|
//#region packages/runtime-core/src/scheduler.ts
|
|
149
149
|
const jobs = [];
|
|
@@ -278,7 +278,6 @@ function flushJobs(seen) {
|
|
|
278
278
|
if (jobsLength || postJobs.length) flushJobs(seen);
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
|
-
|
|
282
281
|
//#endregion
|
|
283
282
|
//#region packages/runtime-core/src/componentRenderContext.ts
|
|
284
283
|
/**
|
|
@@ -347,7 +346,6 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
|
|
|
347
346
|
renderFnWithContext._d = true;
|
|
348
347
|
return renderFnWithContext;
|
|
349
348
|
}
|
|
350
|
-
|
|
351
349
|
//#endregion
|
|
352
350
|
//#region packages/runtime-core/src/directives.ts
|
|
353
351
|
/**
|
|
@@ -396,7 +394,6 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
396
394
|
}
|
|
397
395
|
}
|
|
398
396
|
}
|
|
399
|
-
|
|
400
397
|
//#endregion
|
|
401
398
|
//#region packages/runtime-core/src/apiInject.ts
|
|
402
399
|
function provide(key, value) {
|
|
@@ -423,7 +420,6 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
423
420
|
function hasInjectionContext() {
|
|
424
421
|
return !!(getCurrentGenericInstance() || currentApp);
|
|
425
422
|
}
|
|
426
|
-
|
|
427
423
|
//#endregion
|
|
428
424
|
//#region packages/runtime-core/src/helpers/useSsrContext.ts
|
|
429
425
|
const ssrContextKey = Symbol.for("v-scx");
|
|
@@ -434,7 +430,6 @@ const useSSRContext = () => {
|
|
|
434
430
|
return ctx;
|
|
435
431
|
}
|
|
436
432
|
};
|
|
437
|
-
|
|
438
433
|
//#endregion
|
|
439
434
|
//#region packages/runtime-core/src/apiWatch.ts
|
|
440
435
|
function watchEffect(effect, options) {
|
|
@@ -528,7 +523,6 @@ function createPathGetter(ctx, path) {
|
|
|
528
523
|
return cur;
|
|
529
524
|
};
|
|
530
525
|
}
|
|
531
|
-
|
|
532
526
|
//#endregion
|
|
533
527
|
//#region packages/runtime-core/src/components/Teleport.ts
|
|
534
528
|
const TeleportEndKey = Symbol("_vte");
|
|
@@ -712,7 +706,6 @@ function prepareAnchor(target, vnode, createText, insert, anchor = null) {
|
|
|
712
706
|
}
|
|
713
707
|
return targetAnchor;
|
|
714
708
|
}
|
|
715
|
-
|
|
716
709
|
//#endregion
|
|
717
710
|
//#region packages/runtime-core/src/components/BaseTransition.ts
|
|
718
711
|
const leaveCbKey = Symbol("_leaveCb");
|
|
@@ -766,7 +759,6 @@ const BaseTransitionImpl = {
|
|
|
766
759
|
const child = findNonCommentChild(children);
|
|
767
760
|
const rawProps = (0, _vue_reactivity.toRaw)(props);
|
|
768
761
|
const { mode } = rawProps;
|
|
769
|
-
/* @__PURE__ */ checkTransitionMode(mode);
|
|
770
762
|
if (state.isLeaving) return emptyPlaceholder(child);
|
|
771
763
|
const innerChild = getInnerChild$1(child);
|
|
772
764
|
if (!innerChild) return emptyPlaceholder(child);
|
|
@@ -964,18 +956,12 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
|
964
956
|
if (keyedFragmentCount > 1) for (let i = 0; i < ret.length; i++) ret[i].patchFlag = -2;
|
|
965
957
|
return ret;
|
|
966
958
|
}
|
|
967
|
-
/**
|
|
968
|
-
* dev-only
|
|
969
|
-
*/
|
|
970
|
-
function checkTransitionMode(mode) {}
|
|
971
|
-
|
|
972
959
|
//#endregion
|
|
973
960
|
//#region packages/runtime-core/src/apiDefineComponent.ts
|
|
974
961
|
/* @__NO_SIDE_EFFECTS__ */
|
|
975
962
|
function defineComponent(options, extraOptions) {
|
|
976
963
|
return (0, _vue_shared.isFunction)(options) ? (0, _vue_shared.extend)({ name: options.name }, extraOptions, { setup: options }) : options;
|
|
977
964
|
}
|
|
978
|
-
|
|
979
965
|
//#endregion
|
|
980
966
|
//#region packages/runtime-core/src/helpers/useId.ts
|
|
981
967
|
function useId() {
|
|
@@ -996,7 +982,6 @@ function markAsyncBoundary(instance) {
|
|
|
996
982
|
0
|
|
997
983
|
];
|
|
998
984
|
}
|
|
999
|
-
|
|
1000
985
|
//#endregion
|
|
1001
986
|
//#region packages/runtime-core/src/helpers/useTemplateRef.ts
|
|
1002
987
|
function useTemplateRef(key) {
|
|
@@ -1016,7 +1001,6 @@ function isTemplateRefKey(refs, key) {
|
|
|
1016
1001
|
let desc;
|
|
1017
1002
|
return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable);
|
|
1018
1003
|
}
|
|
1019
|
-
|
|
1020
1004
|
//#endregion
|
|
1021
1005
|
//#region packages/runtime-core/src/rendererTemplateRef.ts
|
|
1022
1006
|
const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -1108,20 +1092,12 @@ function invalidatePendingSetRef(rawRef) {
|
|
|
1108
1092
|
pendingSetRefMap.delete(rawRef);
|
|
1109
1093
|
}
|
|
1110
1094
|
}
|
|
1111
|
-
|
|
1112
1095
|
//#endregion
|
|
1113
1096
|
//#region packages/runtime-core/src/hydration.ts
|
|
1114
1097
|
let isHydratingEnabled = false;
|
|
1115
1098
|
function setIsHydratingEnabled(value) {
|
|
1116
1099
|
isHydratingEnabled = value;
|
|
1117
1100
|
}
|
|
1118
|
-
/**
|
|
1119
|
-
* VDOM hydration state.
|
|
1120
|
-
* Also used by vapor interop plugin for tree-shaking:
|
|
1121
|
-
* In non-hydration builds, this is never set to true, so the logic in
|
|
1122
|
-
* vaporInteropImpl's hydrate/hydrateSlot can be tree-shaken.
|
|
1123
|
-
*/
|
|
1124
|
-
let isHydrating = false;
|
|
1125
1101
|
let hasLoggedMismatchError = false;
|
|
1126
1102
|
const logMismatchError = () => {
|
|
1127
1103
|
if (hasLoggedMismatchError) return;
|
|
@@ -1146,9 +1122,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1146
1122
|
container._vnode = vnode;
|
|
1147
1123
|
return;
|
|
1148
1124
|
}
|
|
1149
|
-
isHydrating = true;
|
|
1150
1125
|
hydrateNode(container.firstChild, vnode, null, null, null);
|
|
1151
|
-
isHydrating = false;
|
|
1152
1126
|
flushPostFlushCbs();
|
|
1153
1127
|
container._vnode = vnode;
|
|
1154
1128
|
};
|
|
@@ -1388,7 +1362,6 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
1388
1362
|
return list.includes(MismatchTypeString[allowedType]);
|
|
1389
1363
|
}
|
|
1390
1364
|
}
|
|
1391
|
-
|
|
1392
1365
|
//#endregion
|
|
1393
1366
|
//#region packages/runtime-core/src/hydrationStrategies.ts
|
|
1394
1367
|
let requestIdleCallback;
|
|
@@ -1477,7 +1450,6 @@ function forEachElement(node, cb) {
|
|
|
1477
1450
|
}
|
|
1478
1451
|
} else cb(node);
|
|
1479
1452
|
}
|
|
1480
|
-
|
|
1481
1453
|
//#endregion
|
|
1482
1454
|
//#region packages/runtime-core/src/apiAsyncComponent.ts
|
|
1483
1455
|
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
@@ -1606,11 +1578,10 @@ function performAsyncHydrate(el, instance, hydrate, getResolvedComp, load, hydra
|
|
|
1606
1578
|
if (getResolvedComp()) doHydrate();
|
|
1607
1579
|
else load().then(() => !instance.isUnmounted && doHydrate());
|
|
1608
1580
|
}
|
|
1609
|
-
|
|
1610
1581
|
//#endregion
|
|
1611
1582
|
//#region packages/runtime-core/src/components/KeepAlive.ts
|
|
1612
1583
|
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
1613
|
-
const
|
|
1584
|
+
const KeepAlive = {
|
|
1614
1585
|
name: `KeepAlive`,
|
|
1615
1586
|
__isKeepAlive: true,
|
|
1616
1587
|
props: {
|
|
@@ -1746,7 +1717,6 @@ const KeepAliveImpl = {
|
|
|
1746
1717
|
};
|
|
1747
1718
|
}
|
|
1748
1719
|
};
|
|
1749
|
-
const KeepAlive = KeepAliveImpl;
|
|
1750
1720
|
function matches(pattern, name) {
|
|
1751
1721
|
if ((0, _vue_shared.isArray)(pattern)) return pattern.some((p) => matches(p, name));
|
|
1752
1722
|
else if ((0, _vue_shared.isString)(pattern)) return pattern.split(",").includes(name);
|
|
@@ -1824,7 +1794,6 @@ function deactivate(vnode, container, { m: move }, parentComponent, parentSuspen
|
|
|
1824
1794
|
instance.isDeactivated = true;
|
|
1825
1795
|
}, void 0, parentSuspense);
|
|
1826
1796
|
}
|
|
1827
|
-
|
|
1828
1797
|
//#endregion
|
|
1829
1798
|
//#region packages/runtime-core/src/apiLifecycle.ts
|
|
1830
1799
|
function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
@@ -1860,23 +1829,19 @@ const onRenderTracked = /* @__PURE__ */ createHook("rtc");
|
|
|
1860
1829
|
function onErrorCaptured(hook, target = currentInstance) {
|
|
1861
1830
|
injectHook("ec", hook, target);
|
|
1862
1831
|
}
|
|
1863
|
-
|
|
1864
|
-
//#endregion
|
|
1865
|
-
//#region packages/runtime-core/src/helpers/resolveAssets.ts
|
|
1866
|
-
const COMPONENTS = "components";
|
|
1867
1832
|
const DIRECTIVES = "directives";
|
|
1868
1833
|
/**
|
|
1869
1834
|
* @private
|
|
1870
1835
|
*/
|
|
1871
1836
|
function resolveComponent(name, maybeSelfReference) {
|
|
1872
|
-
return resolveAsset(
|
|
1837
|
+
return resolveAsset("components", name, true, maybeSelfReference) || name;
|
|
1873
1838
|
}
|
|
1874
1839
|
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
1875
1840
|
/**
|
|
1876
1841
|
* @private
|
|
1877
1842
|
*/
|
|
1878
1843
|
function resolveDynamicComponent(component) {
|
|
1879
|
-
if ((0, _vue_shared.isString)(component)) return resolveAsset(
|
|
1844
|
+
if ((0, _vue_shared.isString)(component)) return resolveAsset("components", component, false) || component;
|
|
1880
1845
|
else return component || NULL_DYNAMIC_COMPONENT;
|
|
1881
1846
|
}
|
|
1882
1847
|
/**
|
|
@@ -1889,7 +1854,7 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
1889
1854
|
const instance = currentRenderingInstance || currentInstance;
|
|
1890
1855
|
if (instance) {
|
|
1891
1856
|
const Component = instance.type;
|
|
1892
|
-
if (type ===
|
|
1857
|
+
if (type === "components") {
|
|
1893
1858
|
const selfName = getComponentName(Component, false);
|
|
1894
1859
|
if (selfName && (selfName === name || selfName === (0, _vue_shared.camelize)(name) || selfName === (0, _vue_shared.capitalize)((0, _vue_shared.camelize)(name)))) return Component;
|
|
1895
1860
|
}
|
|
@@ -1901,7 +1866,6 @@ function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false
|
|
|
1901
1866
|
function resolve(registry, name) {
|
|
1902
1867
|
return registry && (registry[name] || registry[(0, _vue_shared.camelize)(name)] || registry[(0, _vue_shared.capitalize)((0, _vue_shared.camelize)(name))]);
|
|
1903
1868
|
}
|
|
1904
|
-
|
|
1905
1869
|
//#endregion
|
|
1906
1870
|
//#region packages/runtime-core/src/helpers/renderList.ts
|
|
1907
1871
|
/**
|
|
@@ -1938,7 +1902,6 @@ function renderList(source, renderItem, cache, index) {
|
|
|
1938
1902
|
if (cache) cache[index] = ret;
|
|
1939
1903
|
return ret;
|
|
1940
1904
|
}
|
|
1941
|
-
|
|
1942
1905
|
//#endregion
|
|
1943
1906
|
//#region packages/runtime-core/src/helpers/createSlots.ts
|
|
1944
1907
|
/**
|
|
@@ -1957,7 +1920,6 @@ function createSlots(slots, dynamicSlots) {
|
|
|
1957
1920
|
}
|
|
1958
1921
|
return slots;
|
|
1959
1922
|
}
|
|
1960
|
-
|
|
1961
1923
|
//#endregion
|
|
1962
1924
|
//#region packages/runtime-core/src/helpers/renderSlot.ts
|
|
1963
1925
|
/**
|
|
@@ -2004,7 +1966,6 @@ function ensureVaporSlotFallback(vnodes, fallback) {
|
|
|
2004
1966
|
if (!vaporSlot.fallback && fallback) vaporSlot.fallback = fallback;
|
|
2005
1967
|
}
|
|
2006
1968
|
}
|
|
2007
|
-
|
|
2008
1969
|
//#endregion
|
|
2009
1970
|
//#region packages/runtime-core/src/helpers/toHandlers.ts
|
|
2010
1971
|
/**
|
|
@@ -2016,7 +1977,6 @@ function toHandlers(obj, preserveCaseIfNecessary) {
|
|
|
2016
1977
|
for (const key in obj) ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : (0, _vue_shared.toHandlerKey)(key)] = obj[key];
|
|
2017
1978
|
return ret;
|
|
2018
1979
|
}
|
|
2019
|
-
|
|
2020
1980
|
//#endregion
|
|
2021
1981
|
//#region packages/runtime-core/src/componentPublicInstance.ts
|
|
2022
1982
|
/**
|
|
@@ -2122,7 +2082,6 @@ const RuntimeCompiledPublicInstanceProxyHandlers = /* @__PURE__ */ (0, _vue_shar
|
|
|
2122
2082
|
return key[0] !== "_" && !(0, _vue_shared.isGloballyAllowed)(key);
|
|
2123
2083
|
}
|
|
2124
2084
|
});
|
|
2125
|
-
|
|
2126
2085
|
//#endregion
|
|
2127
2086
|
//#region packages/runtime-core/src/apiSetupHelpers.ts
|
|
2128
2087
|
function defineProps() {
|
|
@@ -2154,6 +2113,22 @@ function defineExpose(exposed) {}
|
|
|
2154
2113
|
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
|
|
2155
2114
|
*/
|
|
2156
2115
|
function defineOptions(options) {}
|
|
2116
|
+
/**
|
|
2117
|
+
* Vue `<script setup>` compiler macro for providing type hints to IDEs for
|
|
2118
|
+
* slot name and slot props type checking.
|
|
2119
|
+
*
|
|
2120
|
+
* Example usage:
|
|
2121
|
+
* ```ts
|
|
2122
|
+
* const slots = defineSlots<{
|
|
2123
|
+
* default(props: { msg: string }): any
|
|
2124
|
+
* }>()
|
|
2125
|
+
* ```
|
|
2126
|
+
*
|
|
2127
|
+
* This is only usable inside `<script setup>`, is compiled away in the
|
|
2128
|
+
* output and should **not** be actually called at runtime.
|
|
2129
|
+
*
|
|
2130
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineslots}
|
|
2131
|
+
*/
|
|
2157
2132
|
function defineSlots() {
|
|
2158
2133
|
return null;
|
|
2159
2134
|
}
|
|
@@ -2264,20 +2239,28 @@ function createPropsRestProxy(props, excludedKeys) {
|
|
|
2264
2239
|
*/
|
|
2265
2240
|
function withAsyncContext(getAwaitable) {
|
|
2266
2241
|
const ctx = getCurrentGenericInstance();
|
|
2242
|
+
const inSSRSetup = isInSSRComponentSetup;
|
|
2267
2243
|
let awaitable = getAwaitable();
|
|
2268
2244
|
setCurrentInstance(null, void 0);
|
|
2269
|
-
|
|
2270
|
-
|
|
2245
|
+
if (inSSRSetup) setInSSRSetupState(false);
|
|
2246
|
+
const restore = () => {
|
|
2271
2247
|
setCurrentInstance(ctx);
|
|
2248
|
+
if (inSSRSetup) setInSSRSetupState(true);
|
|
2249
|
+
};
|
|
2250
|
+
const cleanup = () => {
|
|
2251
|
+
setCurrentInstance(null, void 0);
|
|
2252
|
+
if (inSSRSetup) setInSSRSetupState(false);
|
|
2253
|
+
};
|
|
2254
|
+
if ((0, _vue_shared.isPromise)(awaitable)) awaitable = awaitable.catch((e) => {
|
|
2255
|
+
restore();
|
|
2272
2256
|
Promise.resolve().then(() => Promise.resolve().then(cleanup));
|
|
2273
2257
|
throw e;
|
|
2274
2258
|
});
|
|
2275
2259
|
return [awaitable, () => {
|
|
2276
|
-
|
|
2260
|
+
restore();
|
|
2277
2261
|
Promise.resolve().then(cleanup);
|
|
2278
2262
|
}];
|
|
2279
2263
|
}
|
|
2280
|
-
|
|
2281
2264
|
//#endregion
|
|
2282
2265
|
//#region packages/runtime-core/src/componentOptions.ts
|
|
2283
2266
|
let shouldCacheAccess = true;
|
|
@@ -2480,7 +2463,6 @@ function mergeWatchOptions(to, from) {
|
|
|
2480
2463
|
for (const key in from) merged[key] = mergeAsArray(to[key], from[key]);
|
|
2481
2464
|
return merged;
|
|
2482
2465
|
}
|
|
2483
|
-
|
|
2484
2466
|
//#endregion
|
|
2485
2467
|
//#region packages/runtime-core/src/apiCreateApp.ts
|
|
2486
2468
|
function createAppContext() {
|
|
@@ -2593,7 +2575,6 @@ function createAppAPI(mount, unmount, getPublicInstance, render) {
|
|
|
2593
2575
|
* `app.runWithContext()`.
|
|
2594
2576
|
*/
|
|
2595
2577
|
let currentApp = null;
|
|
2596
|
-
|
|
2597
2578
|
//#endregion
|
|
2598
2579
|
//#region packages/runtime-core/src/helpers/useModel.ts
|
|
2599
2580
|
function useModel(props, name, options = _vue_shared.EMPTY_OBJ) {
|
|
@@ -2658,7 +2639,6 @@ function useModel(props, name, options = _vue_shared.EMPTY_OBJ) {
|
|
|
2658
2639
|
const getModelModifiers = (props, modelName, getter) => {
|
|
2659
2640
|
return getter(props, (0, _vue_shared.getModifierPropName)(modelName)) || getter(props, `${(0, _vue_shared.camelize)(modelName)}Modifiers`) || getter(props, `${(0, _vue_shared.hyphenate)(modelName)}Modifiers`);
|
|
2660
2641
|
};
|
|
2661
|
-
|
|
2662
2642
|
//#endregion
|
|
2663
2643
|
//#region packages/runtime-core/src/componentEmits.ts
|
|
2664
2644
|
function emit(instance, event, ...rawArgs) {
|
|
@@ -2732,7 +2712,6 @@ function isEmitListener(options, key) {
|
|
|
2732
2712
|
key = key.slice(2).replace(/Once$/, "");
|
|
2733
2713
|
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);
|
|
2734
2714
|
}
|
|
2735
|
-
|
|
2736
2715
|
//#endregion
|
|
2737
2716
|
//#region packages/runtime-core/src/componentRenderUtils.ts
|
|
2738
2717
|
function renderComponentRoot(instance) {
|
|
@@ -2854,7 +2833,6 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
2854
2833
|
} else break;
|
|
2855
2834
|
}
|
|
2856
2835
|
}
|
|
2857
|
-
|
|
2858
2836
|
//#endregion
|
|
2859
2837
|
//#region packages/runtime-core/src/internalObject.ts
|
|
2860
2838
|
/**
|
|
@@ -2866,7 +2844,6 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
2866
2844
|
const internalObjectProto = {};
|
|
2867
2845
|
const createInternalObject = () => Object.create(internalObjectProto);
|
|
2868
2846
|
const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
|
|
2869
|
-
|
|
2870
2847
|
//#endregion
|
|
2871
2848
|
//#region packages/runtime-core/src/componentProps.ts
|
|
2872
2849
|
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
@@ -3046,7 +3023,6 @@ function validatePropName(key) {
|
|
|
3046
3023
|
if (key[0] !== "$" && !(0, _vue_shared.isReservedProp)(key)) return true;
|
|
3047
3024
|
return false;
|
|
3048
3025
|
}
|
|
3049
|
-
|
|
3050
3026
|
//#endregion
|
|
3051
3027
|
//#region packages/runtime-core/src/componentSlots.ts
|
|
3052
3028
|
const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
|
|
@@ -3109,7 +3085,6 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
3109
3085
|
for (const key in slots) if (!isInternalKey(key) && deletionComparisonTarget[key] == null) delete slots[key];
|
|
3110
3086
|
}
|
|
3111
3087
|
};
|
|
3112
|
-
|
|
3113
3088
|
//#endregion
|
|
3114
3089
|
//#region packages/runtime-core/src/renderer.ts
|
|
3115
3090
|
const MoveType = {
|
|
@@ -3448,7 +3423,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3448
3423
|
if (isAsyncWrapperVNode && type.__asyncHydrate) type.__asyncHydrate(el, instance, hydrateSubTree);
|
|
3449
3424
|
else hydrateSubTree();
|
|
3450
3425
|
} else {
|
|
3451
|
-
if (root.ce && root.ce._hasShadowRoot()) root.ce._injectChildStyle(type);
|
|
3426
|
+
if (root.ce && root.ce._hasShadowRoot()) root.ce._injectChildStyle(type, instance.parent ? instance.parent.type : void 0);
|
|
3452
3427
|
const subTree = instance.subTree = renderComponentRoot(instance);
|
|
3453
3428
|
patch(null, subTree, container, anchor, instance, parentSuspense, namespace);
|
|
3454
3429
|
initialVNode.el = subTree.el;
|
|
@@ -3931,12 +3906,11 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
|
3931
3906
|
if (instance) return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
3932
3907
|
return null;
|
|
3933
3908
|
}
|
|
3934
|
-
|
|
3935
3909
|
//#endregion
|
|
3936
3910
|
//#region packages/runtime-core/src/components/Suspense.ts
|
|
3937
3911
|
const isSuspense = (type) => type.__isSuspense;
|
|
3938
3912
|
let suspenseId = 0;
|
|
3939
|
-
const
|
|
3913
|
+
const Suspense = {
|
|
3940
3914
|
name: "Suspense",
|
|
3941
3915
|
__isSuspense: true,
|
|
3942
3916
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
@@ -3954,7 +3928,6 @@ const SuspenseImpl = {
|
|
|
3954
3928
|
hydrate: hydrateSuspense,
|
|
3955
3929
|
normalize: normalizeSuspenseChildren
|
|
3956
3930
|
};
|
|
3957
|
-
const Suspense = SuspenseImpl;
|
|
3958
3931
|
function triggerEvent(vnode, name) {
|
|
3959
3932
|
const eventListener = vnode.props && vnode.props[name];
|
|
3960
3933
|
if ((0, _vue_shared.isFunction)(eventListener)) eventListener();
|
|
@@ -4202,7 +4175,6 @@ function isVNodeSuspensible(vnode) {
|
|
|
4202
4175
|
const suspensible = vnode.props && vnode.props.suspensible;
|
|
4203
4176
|
return suspensible != null && suspensible !== false;
|
|
4204
4177
|
}
|
|
4205
|
-
|
|
4206
4178
|
//#endregion
|
|
4207
4179
|
//#region packages/runtime-core/src/vnode.ts
|
|
4208
4180
|
const Fragment = Symbol.for("v-fgt");
|
|
@@ -4489,7 +4461,6 @@ function mergeProps(...args) {
|
|
|
4489
4461
|
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
4490
4462
|
callWithAsyncErrorHandling(hook, instance, 7, [vnode, prevVNode]);
|
|
4491
4463
|
}
|
|
4492
|
-
|
|
4493
4464
|
//#endregion
|
|
4494
4465
|
//#region packages/runtime-core/src/componentCurrentInstance.ts
|
|
4495
4466
|
/**
|
|
@@ -4551,7 +4522,6 @@ const useInstanceOption = (key, silent = false) => {
|
|
|
4551
4522
|
value: instance[key]
|
|
4552
4523
|
};
|
|
4553
4524
|
};
|
|
4554
|
-
|
|
4555
4525
|
//#endregion
|
|
4556
4526
|
//#region packages/runtime-core/src/component.ts
|
|
4557
4527
|
const emptyAppContext = /* @__PURE__ */ createAppContext();
|
|
@@ -4761,13 +4731,11 @@ function getComponentName(Component, includeInferred = true) {
|
|
|
4761
4731
|
function isClassComponent(value) {
|
|
4762
4732
|
return (0, _vue_shared.isFunction)(value) && "__vccOpts" in value;
|
|
4763
4733
|
}
|
|
4764
|
-
|
|
4765
4734
|
//#endregion
|
|
4766
4735
|
//#region packages/runtime-core/src/apiComputed.ts
|
|
4767
4736
|
const computed = (getterOrOptions, debugOptions) => {
|
|
4768
4737
|
return (0, _vue_reactivity.computed)(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
4769
4738
|
};
|
|
4770
|
-
|
|
4771
4739
|
//#endregion
|
|
4772
4740
|
//#region packages/runtime-core/src/h.ts
|
|
4773
4741
|
function h(type, propsOrChildren, children) {
|
|
@@ -4787,7 +4755,6 @@ function h(type, propsOrChildren, children) {
|
|
|
4787
4755
|
setBlockTracking(1);
|
|
4788
4756
|
}
|
|
4789
4757
|
}
|
|
4790
|
-
|
|
4791
4758
|
//#endregion
|
|
4792
4759
|
//#region packages/runtime-core/src/customFormatter.ts
|
|
4793
4760
|
function initCustomFormatter() {
|
|
@@ -4799,7 +4766,6 @@ function initCustomFormatter() {
|
|
|
4799
4766
|
if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) return true;
|
|
4800
4767
|
}
|
|
4801
4768
|
}
|
|
4802
|
-
|
|
4803
4769
|
//#endregion
|
|
4804
4770
|
//#region packages/runtime-core/src/helpers/withMemo.ts
|
|
4805
4771
|
function withMemo(memo, render, cache, index) {
|
|
@@ -4817,10 +4783,9 @@ function isMemoSame(cached, memo) {
|
|
|
4817
4783
|
if (isBlockTreeEnabled > 0 && currentBlock) currentBlock.push(cached);
|
|
4818
4784
|
return true;
|
|
4819
4785
|
}
|
|
4820
|
-
|
|
4821
4786
|
//#endregion
|
|
4822
4787
|
//#region packages/runtime-core/src/index.ts
|
|
4823
|
-
const version = "3.6.0-beta.
|
|
4788
|
+
const version = "3.6.0-beta.8";
|
|
4824
4789
|
const warn = _vue_shared.NOOP;
|
|
4825
4790
|
/**
|
|
4826
4791
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -4829,7 +4794,11 @@ const warn = _vue_shared.NOOP;
|
|
|
4829
4794
|
const ErrorTypeStrings = ErrorTypeStrings$1;
|
|
4830
4795
|
const devtools = void 0;
|
|
4831
4796
|
const setDevtoolsHook = _vue_shared.NOOP;
|
|
4832
|
-
|
|
4797
|
+
/**
|
|
4798
|
+
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
4799
|
+
* @internal
|
|
4800
|
+
*/
|
|
4801
|
+
const ssrUtils = {
|
|
4833
4802
|
createComponentInstance,
|
|
4834
4803
|
setupComponent,
|
|
4835
4804
|
renderComponentRoot,
|
|
@@ -4842,11 +4811,6 @@ const _ssrUtils = {
|
|
|
4842
4811
|
popWarningContext
|
|
4843
4812
|
};
|
|
4844
4813
|
/**
|
|
4845
|
-
* SSR utils for \@vue/server-renderer. Only exposed in ssr-possible builds.
|
|
4846
|
-
* @internal
|
|
4847
|
-
*/
|
|
4848
|
-
const ssrUtils = _ssrUtils;
|
|
4849
|
-
/**
|
|
4850
4814
|
* @internal only exposed in compat builds
|
|
4851
4815
|
*/
|
|
4852
4816
|
const resolveFilter = null;
|
|
@@ -4855,7 +4819,6 @@ const resolveFilter = null;
|
|
|
4855
4819
|
*/
|
|
4856
4820
|
const compatUtils = null;
|
|
4857
4821
|
const DeprecationTypes = null;
|
|
4858
|
-
|
|
4859
4822
|
//#endregion
|
|
4860
4823
|
exports.BaseTransition = BaseTransition;
|
|
4861
4824
|
exports.BaseTransitionPropsValidators = BaseTransitionPropsValidators;
|
|
@@ -5006,4 +4969,4 @@ exports.withCtx = withCtx;
|
|
|
5006
4969
|
exports.withDefaults = withDefaults;
|
|
5007
4970
|
exports.withDirectives = withDirectives;
|
|
5008
4971
|
exports.withMemo = withMemo;
|
|
5009
|
-
exports.withScopeId = withScopeId;
|
|
4972
|
+
exports.withScopeId = withScopeId;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -259,6 +259,22 @@ export declare function defineOptions<RawBindings = {}, D = {}, C extends Comput
|
|
|
259
259
|
*/
|
|
260
260
|
slots?: never;
|
|
261
261
|
}): void;
|
|
262
|
+
/**
|
|
263
|
+
* Vue `<script setup>` compiler macro for providing type hints to IDEs for
|
|
264
|
+
* slot name and slot props type checking.
|
|
265
|
+
*
|
|
266
|
+
* Example usage:
|
|
267
|
+
* ```ts
|
|
268
|
+
* const slots = defineSlots<{
|
|
269
|
+
* default(props: { msg: string }): any
|
|
270
|
+
* }>()
|
|
271
|
+
* ```
|
|
272
|
+
*
|
|
273
|
+
* This is only usable inside `<script setup>`, is compiled away in the
|
|
274
|
+
* output and should **not** be actually called at runtime.
|
|
275
|
+
*
|
|
276
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineslots}
|
|
277
|
+
*/
|
|
262
278
|
export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
|
|
263
279
|
export type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref$1<G, S> & [ModelRef<T, M, G, S>, Record<M, true | undefined>];
|
|
264
280
|
type DefineModelOptions<T = any, G = T, S = T> = {
|
|
@@ -440,7 +456,7 @@ export type ComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOp
|
|
|
440
456
|
$: ComponentInternalInstance;
|
|
441
457
|
$data: D;
|
|
442
458
|
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
|
|
443
|
-
$attrs:
|
|
459
|
+
$attrs: Attrs;
|
|
444
460
|
$refs: Data & TypeRefs;
|
|
445
461
|
$slots: UnwrapSlotsType<S>;
|
|
446
462
|
$root: ComponentPublicInstance | null;
|
|
@@ -963,7 +979,7 @@ export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C
|
|
|
963
979
|
export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
|
|
964
980
|
type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>;
|
|
965
981
|
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, "name" | "inheritAttrs"> & {
|
|
966
|
-
props?: (keyof Props)[];
|
|
982
|
+
props?: (keyof NoInfer<Props>)[];
|
|
967
983
|
emits?: E | EE[];
|
|
968
984
|
slots?: S;
|
|
969
985
|
}): DefineSetupFnComponent<Props, E, S>;
|
|
@@ -1306,6 +1322,11 @@ export declare const getCurrentInstance: () => ComponentInternalInstance | null;
|
|
|
1306
1322
|
//#region temp/packages/runtime-core/src/component.d.ts
|
|
1307
1323
|
type Data = Record<string, unknown>;
|
|
1308
1324
|
/**
|
|
1325
|
+
* For extending allowed non-declared attrs on components in TSX
|
|
1326
|
+
*/
|
|
1327
|
+
export interface AllowedAttrs {}
|
|
1328
|
+
export type Attrs = Data & AllowedAttrs;
|
|
1329
|
+
/**
|
|
1309
1330
|
* Public utility type for extracting the instance type of a component.
|
|
1310
1331
|
* Works with all valid component definition types. This is intended to replace
|
|
1311
1332
|
* the usage of `InstanceType<typeof Comp>` which only works for
|
|
@@ -1376,6 +1397,10 @@ export interface ComponentInternalOptions {
|
|
|
1376
1397
|
*/
|
|
1377
1398
|
__vapor?: boolean;
|
|
1378
1399
|
/**
|
|
1400
|
+
* whether this vapor component has multiple root nodes
|
|
1401
|
+
*/
|
|
1402
|
+
__multiRoot?: boolean;
|
|
1403
|
+
/**
|
|
1379
1404
|
* indicates keep-alive component
|
|
1380
1405
|
*/
|
|
1381
1406
|
__isKeepAlive?: boolean;
|
|
@@ -1428,7 +1453,7 @@ export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends
|
|
|
1428
1453
|
export type Component<PropsOrInstance = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ConcreteComponent<PropsOrInstance, RawBindings, D, C, M, E, S> | ComponentPublicInstanceConstructor<PropsOrInstance>;
|
|
1429
1454
|
export type LifecycleHook<TFn = Function> = (TFn & SchedulerJob)[] | null;
|
|
1430
1455
|
export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
|
|
1431
|
-
attrs:
|
|
1456
|
+
attrs: Attrs;
|
|
1432
1457
|
slots: UnwrapSlotsType<S>;
|
|
1433
1458
|
emit: EmitFn<E>;
|
|
1434
1459
|
expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
|