@vue/runtime-core 3.3.0-alpha.9 → 3.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/runtime-core.cjs.js +254 -214
- package/dist/runtime-core.cjs.prod.js +176 -151
- package/dist/runtime-core.d.ts +16 -2
- package/dist/runtime-core.esm-bundler.js +255 -203
- package/package.json +3 -3
|
@@ -453,6 +453,8 @@ function reload(id, newComp) {
|
|
|
453
453
|
}
|
|
454
454
|
hmrDirtyComponents.add(oldComp);
|
|
455
455
|
}
|
|
456
|
+
instance.appContext.propsCache.delete(instance.type);
|
|
457
|
+
instance.appContext.emitsCache.delete(instance.type);
|
|
456
458
|
instance.appContext.optionsCache.delete(instance.type);
|
|
457
459
|
if (instance.ceReload) {
|
|
458
460
|
hmrDirtyComponents.add(oldComp);
|
|
@@ -1295,7 +1297,8 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
|
|
|
1295
1297
|
}
|
|
1296
1298
|
}
|
|
1297
1299
|
let hasWarned = false;
|
|
1298
|
-
function createSuspenseBoundary(vnode,
|
|
1300
|
+
function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
|
|
1301
|
+
var _a;
|
|
1299
1302
|
if (process.env.NODE_ENV !== "production" && true && !hasWarned) {
|
|
1300
1303
|
hasWarned = true;
|
|
1301
1304
|
console[console.info ? "info" : "log"](
|
|
@@ -1309,13 +1312,21 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
1309
1312
|
n: next,
|
|
1310
1313
|
o: { parentNode, remove }
|
|
1311
1314
|
} = rendererInternals;
|
|
1315
|
+
let parentSuspenseId;
|
|
1316
|
+
const isSuspensible = ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
|
|
1317
|
+
if (isSuspensible) {
|
|
1318
|
+
if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
|
|
1319
|
+
parentSuspenseId = parentSuspense == null ? void 0 : parentSuspense.pendingId;
|
|
1320
|
+
parentSuspense.deps++;
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1312
1323
|
const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
|
|
1313
1324
|
if (process.env.NODE_ENV !== "production") {
|
|
1314
1325
|
assertNumber(timeout, `Suspense timeout`);
|
|
1315
1326
|
}
|
|
1316
1327
|
const suspense = {
|
|
1317
1328
|
vnode,
|
|
1318
|
-
parent,
|
|
1329
|
+
parent: parentSuspense,
|
|
1319
1330
|
parentComponent,
|
|
1320
1331
|
isSVG,
|
|
1321
1332
|
container,
|
|
@@ -1375,20 +1386,28 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
1375
1386
|
setActiveBranch(suspense, pendingBranch);
|
|
1376
1387
|
suspense.pendingBranch = null;
|
|
1377
1388
|
suspense.isInFallback = false;
|
|
1378
|
-
let
|
|
1389
|
+
let parent = suspense.parent;
|
|
1379
1390
|
let hasUnresolvedAncestor = false;
|
|
1380
|
-
while (
|
|
1381
|
-
if (
|
|
1382
|
-
|
|
1391
|
+
while (parent) {
|
|
1392
|
+
if (parent.pendingBranch) {
|
|
1393
|
+
parent.effects.push(...effects);
|
|
1383
1394
|
hasUnresolvedAncestor = true;
|
|
1384
1395
|
break;
|
|
1385
1396
|
}
|
|
1386
|
-
|
|
1397
|
+
parent = parent.parent;
|
|
1387
1398
|
}
|
|
1388
1399
|
if (!hasUnresolvedAncestor) {
|
|
1389
1400
|
queuePostFlushCb(effects);
|
|
1390
1401
|
}
|
|
1391
1402
|
suspense.effects = [];
|
|
1403
|
+
if (isSuspensible) {
|
|
1404
|
+
if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
|
|
1405
|
+
parentSuspense.deps--;
|
|
1406
|
+
if (parentSuspense.deps === 0) {
|
|
1407
|
+
parentSuspense.resolve();
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1392
1411
|
triggerEvent(vnode2, "onResolve");
|
|
1393
1412
|
},
|
|
1394
1413
|
fallback(fallbackVNode) {
|
|
@@ -1488,13 +1507,13 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
1488
1507
|
}
|
|
1489
1508
|
});
|
|
1490
1509
|
},
|
|
1491
|
-
unmount(
|
|
1510
|
+
unmount(parentSuspense2, doRemove) {
|
|
1492
1511
|
suspense.isUnmounted = true;
|
|
1493
1512
|
if (suspense.activeBranch) {
|
|
1494
1513
|
unmount(
|
|
1495
1514
|
suspense.activeBranch,
|
|
1496
1515
|
parentComponent,
|
|
1497
|
-
|
|
1516
|
+
parentSuspense2,
|
|
1498
1517
|
doRemove
|
|
1499
1518
|
);
|
|
1500
1519
|
}
|
|
@@ -1502,7 +1521,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
|
|
|
1502
1521
|
unmount(
|
|
1503
1522
|
suspense.pendingBranch,
|
|
1504
1523
|
parentComponent,
|
|
1505
|
-
|
|
1524
|
+
parentSuspense2,
|
|
1506
1525
|
doRemove
|
|
1507
1526
|
);
|
|
1508
1527
|
}
|
|
@@ -2913,6 +2932,8 @@ const PublicInstanceProxyHandlers = {
|
|
|
2913
2932
|
if (key === "$attrs") {
|
|
2914
2933
|
track(instance, "get", key);
|
|
2915
2934
|
process.env.NODE_ENV !== "production" && markAttrsAccessed();
|
|
2935
|
+
} else if (process.env.NODE_ENV !== "production" && key === "$slots") {
|
|
2936
|
+
track(instance, "get", key);
|
|
2916
2937
|
}
|
|
2917
2938
|
return publicGetter(instance);
|
|
2918
2939
|
} else if (
|
|
@@ -3082,6 +3103,161 @@ function exposeSetupStateOnRenderContext(instance) {
|
|
|
3082
3103
|
});
|
|
3083
3104
|
}
|
|
3084
3105
|
|
|
3106
|
+
const warnRuntimeUsage = (method) => warn(
|
|
3107
|
+
`${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.`
|
|
3108
|
+
);
|
|
3109
|
+
function defineProps() {
|
|
3110
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3111
|
+
warnRuntimeUsage(`defineProps`);
|
|
3112
|
+
}
|
|
3113
|
+
return null;
|
|
3114
|
+
}
|
|
3115
|
+
function defineEmits() {
|
|
3116
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3117
|
+
warnRuntimeUsage(`defineEmits`);
|
|
3118
|
+
}
|
|
3119
|
+
return null;
|
|
3120
|
+
}
|
|
3121
|
+
function defineExpose(exposed) {
|
|
3122
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3123
|
+
warnRuntimeUsage(`defineExpose`);
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
function defineOptions(options) {
|
|
3127
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3128
|
+
warnRuntimeUsage(`defineOptions`);
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
3131
|
+
function defineSlots() {
|
|
3132
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3133
|
+
warnRuntimeUsage(`defineSlots`);
|
|
3134
|
+
}
|
|
3135
|
+
return null;
|
|
3136
|
+
}
|
|
3137
|
+
function defineModel() {
|
|
3138
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3139
|
+
warnRuntimeUsage("defineModel");
|
|
3140
|
+
}
|
|
3141
|
+
}
|
|
3142
|
+
function withDefaults(props, defaults) {
|
|
3143
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3144
|
+
warnRuntimeUsage(`withDefaults`);
|
|
3145
|
+
}
|
|
3146
|
+
return null;
|
|
3147
|
+
}
|
|
3148
|
+
function useSlots() {
|
|
3149
|
+
return getContext().slots;
|
|
3150
|
+
}
|
|
3151
|
+
function useAttrs() {
|
|
3152
|
+
return getContext().attrs;
|
|
3153
|
+
}
|
|
3154
|
+
function useModel(props, name, options) {
|
|
3155
|
+
const i = getCurrentInstance();
|
|
3156
|
+
if (process.env.NODE_ENV !== "production" && !i) {
|
|
3157
|
+
warn(`useModel() called without active instance.`);
|
|
3158
|
+
return ref();
|
|
3159
|
+
}
|
|
3160
|
+
if (process.env.NODE_ENV !== "production" && !i.propsOptions[0][name]) {
|
|
3161
|
+
warn(`useModel() called with prop "${name}" which is not declared.`);
|
|
3162
|
+
return ref();
|
|
3163
|
+
}
|
|
3164
|
+
if (options && options.local) {
|
|
3165
|
+
const proxy = ref(props[name]);
|
|
3166
|
+
watch(
|
|
3167
|
+
() => props[name],
|
|
3168
|
+
(v) => proxy.value = v
|
|
3169
|
+
);
|
|
3170
|
+
watch(proxy, (value) => {
|
|
3171
|
+
if (value !== props[name]) {
|
|
3172
|
+
i.emit(`update:${name}`, value);
|
|
3173
|
+
}
|
|
3174
|
+
});
|
|
3175
|
+
return proxy;
|
|
3176
|
+
} else {
|
|
3177
|
+
return {
|
|
3178
|
+
__v_isRef: true,
|
|
3179
|
+
get value() {
|
|
3180
|
+
return props[name];
|
|
3181
|
+
},
|
|
3182
|
+
set value(value) {
|
|
3183
|
+
i.emit(`update:${name}`, value);
|
|
3184
|
+
}
|
|
3185
|
+
};
|
|
3186
|
+
}
|
|
3187
|
+
}
|
|
3188
|
+
function getContext() {
|
|
3189
|
+
const i = getCurrentInstance();
|
|
3190
|
+
if (process.env.NODE_ENV !== "production" && !i) {
|
|
3191
|
+
warn(`useContext() called without active instance.`);
|
|
3192
|
+
}
|
|
3193
|
+
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
3194
|
+
}
|
|
3195
|
+
function normalizePropsOrEmits(props) {
|
|
3196
|
+
return isArray(props) ? props.reduce(
|
|
3197
|
+
(normalized, p) => (normalized[p] = null, normalized),
|
|
3198
|
+
{}
|
|
3199
|
+
) : props;
|
|
3200
|
+
}
|
|
3201
|
+
function mergeDefaults(raw, defaults) {
|
|
3202
|
+
const props = normalizePropsOrEmits(raw);
|
|
3203
|
+
for (const key in defaults) {
|
|
3204
|
+
if (key.startsWith("__skip"))
|
|
3205
|
+
continue;
|
|
3206
|
+
let opt = props[key];
|
|
3207
|
+
if (opt) {
|
|
3208
|
+
if (isArray(opt) || isFunction(opt)) {
|
|
3209
|
+
opt = props[key] = { type: opt, default: defaults[key] };
|
|
3210
|
+
} else {
|
|
3211
|
+
opt.default = defaults[key];
|
|
3212
|
+
}
|
|
3213
|
+
} else if (opt === null) {
|
|
3214
|
+
opt = props[key] = { default: defaults[key] };
|
|
3215
|
+
} else if (process.env.NODE_ENV !== "production") {
|
|
3216
|
+
warn(`props default key "${key}" has no corresponding declaration.`);
|
|
3217
|
+
}
|
|
3218
|
+
if (opt && defaults[`__skip_${key}`]) {
|
|
3219
|
+
opt.skipFactory = true;
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
return props;
|
|
3223
|
+
}
|
|
3224
|
+
function mergeModels(a, b) {
|
|
3225
|
+
if (!a || !b)
|
|
3226
|
+
return a || b;
|
|
3227
|
+
if (isArray(a) && isArray(b))
|
|
3228
|
+
return a.concat(b);
|
|
3229
|
+
return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
|
|
3230
|
+
}
|
|
3231
|
+
function createPropsRestProxy(props, excludedKeys) {
|
|
3232
|
+
const ret = {};
|
|
3233
|
+
for (const key in props) {
|
|
3234
|
+
if (!excludedKeys.includes(key)) {
|
|
3235
|
+
Object.defineProperty(ret, key, {
|
|
3236
|
+
enumerable: true,
|
|
3237
|
+
get: () => props[key]
|
|
3238
|
+
});
|
|
3239
|
+
}
|
|
3240
|
+
}
|
|
3241
|
+
return ret;
|
|
3242
|
+
}
|
|
3243
|
+
function withAsyncContext(getAwaitable) {
|
|
3244
|
+
const ctx = getCurrentInstance();
|
|
3245
|
+
if (process.env.NODE_ENV !== "production" && !ctx) {
|
|
3246
|
+
warn(
|
|
3247
|
+
`withAsyncContext called without active current instance. This is likely a bug.`
|
|
3248
|
+
);
|
|
3249
|
+
}
|
|
3250
|
+
let awaitable = getAwaitable();
|
|
3251
|
+
unsetCurrentInstance();
|
|
3252
|
+
if (isPromise(awaitable)) {
|
|
3253
|
+
awaitable = awaitable.catch((e) => {
|
|
3254
|
+
setCurrentInstance(ctx);
|
|
3255
|
+
throw e;
|
|
3256
|
+
});
|
|
3257
|
+
}
|
|
3258
|
+
return [awaitable, () => setCurrentInstance(ctx)];
|
|
3259
|
+
}
|
|
3260
|
+
|
|
3085
3261
|
function createDuplicateChecker() {
|
|
3086
3262
|
const cache = /* @__PURE__ */ Object.create(null);
|
|
3087
3263
|
return (type, key) => {
|
|
@@ -3144,12 +3320,7 @@ function applyOptions(instance) {
|
|
|
3144
3320
|
}
|
|
3145
3321
|
}
|
|
3146
3322
|
if (injectOptions) {
|
|
3147
|
-
resolveInjections(
|
|
3148
|
-
injectOptions,
|
|
3149
|
-
ctx,
|
|
3150
|
-
checkDuplicateProperties,
|
|
3151
|
-
instance.appContext.config.unwrapInjectedRef
|
|
3152
|
-
);
|
|
3323
|
+
resolveInjections(injectOptions, ctx, checkDuplicateProperties);
|
|
3153
3324
|
}
|
|
3154
3325
|
if (methods) {
|
|
3155
3326
|
for (const key in methods) {
|
|
@@ -3291,7 +3462,7 @@ function applyOptions(instance) {
|
|
|
3291
3462
|
if (directives)
|
|
3292
3463
|
instance.directives = directives;
|
|
3293
3464
|
}
|
|
3294
|
-
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP
|
|
3465
|
+
function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) {
|
|
3295
3466
|
if (isArray(injectOptions)) {
|
|
3296
3467
|
injectOptions = normalizeInject(injectOptions);
|
|
3297
3468
|
}
|
|
@@ -3313,21 +3484,12 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP,
|
|
|
3313
3484
|
injected = inject(opt);
|
|
3314
3485
|
}
|
|
3315
3486
|
if (isRef(injected)) {
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
});
|
|
3323
|
-
} else {
|
|
3324
|
-
if (process.env.NODE_ENV !== "production") {
|
|
3325
|
-
warn(
|
|
3326
|
-
`injected property "${key}" is a ref and will be auto-unwrapped and no longer needs \`.value\` in the next minor release. To opt-in to the new behavior now, set \`app.config.unwrapInjectedRef = true\` (this config is temporary and will not be needed in the future.)`
|
|
3327
|
-
);
|
|
3328
|
-
}
|
|
3329
|
-
ctx[key] = injected;
|
|
3330
|
-
}
|
|
3487
|
+
Object.defineProperty(ctx, key, {
|
|
3488
|
+
enumerable: true,
|
|
3489
|
+
configurable: true,
|
|
3490
|
+
get: () => injected.value,
|
|
3491
|
+
set: (v) => injected.value = v
|
|
3492
|
+
});
|
|
3331
3493
|
} else {
|
|
3332
3494
|
ctx[key] = injected;
|
|
3333
3495
|
}
|
|
@@ -3423,10 +3585,8 @@ function mergeOptions(to, from, strats, asMixin = false) {
|
|
|
3423
3585
|
}
|
|
3424
3586
|
const internalOptionMergeStrats = {
|
|
3425
3587
|
data: mergeDataFn,
|
|
3426
|
-
props:
|
|
3427
|
-
|
|
3428
|
-
emits: mergeObjectOptions,
|
|
3429
|
-
// TODO
|
|
3588
|
+
props: mergeEmitsOrPropsOptions,
|
|
3589
|
+
emits: mergeEmitsOrPropsOptions,
|
|
3430
3590
|
// objects
|
|
3431
3591
|
methods: mergeObjectOptions,
|
|
3432
3592
|
computed: mergeObjectOptions,
|
|
@@ -3485,7 +3645,21 @@ function mergeAsArray(to, from) {
|
|
|
3485
3645
|
return to ? [...new Set([].concat(to, from))] : from;
|
|
3486
3646
|
}
|
|
3487
3647
|
function mergeObjectOptions(to, from) {
|
|
3488
|
-
return to ? extend(
|
|
3648
|
+
return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from;
|
|
3649
|
+
}
|
|
3650
|
+
function mergeEmitsOrPropsOptions(to, from) {
|
|
3651
|
+
if (to) {
|
|
3652
|
+
if (isArray(to) && isArray(from)) {
|
|
3653
|
+
return [.../* @__PURE__ */ new Set([...to, ...from])];
|
|
3654
|
+
}
|
|
3655
|
+
return extend(
|
|
3656
|
+
/* @__PURE__ */ Object.create(null),
|
|
3657
|
+
normalizePropsOrEmits(to),
|
|
3658
|
+
normalizePropsOrEmits(from != null ? from : {})
|
|
3659
|
+
);
|
|
3660
|
+
} else {
|
|
3661
|
+
return from;
|
|
3662
|
+
}
|
|
3489
3663
|
}
|
|
3490
3664
|
function mergeWatchOptions(to, from) {
|
|
3491
3665
|
if (!to)
|
|
@@ -3531,6 +3705,18 @@ function createAppAPI(render, hydrate) {
|
|
|
3531
3705
|
rootProps = null;
|
|
3532
3706
|
}
|
|
3533
3707
|
const context = createAppContext();
|
|
3708
|
+
if (process.env.NODE_ENV !== "production") {
|
|
3709
|
+
Object.defineProperty(context.config, "unwrapInjectedRef", {
|
|
3710
|
+
get() {
|
|
3711
|
+
return true;
|
|
3712
|
+
},
|
|
3713
|
+
set() {
|
|
3714
|
+
warn(
|
|
3715
|
+
`app.config.unwrapInjectedRef has been deprecated. 3.3 now alawys unwraps injected refs in Options API.`
|
|
3716
|
+
);
|
|
3717
|
+
}
|
|
3718
|
+
});
|
|
3719
|
+
}
|
|
3534
3720
|
const installedPlugins = /* @__PURE__ */ new Set();
|
|
3535
3721
|
let isMounted = false;
|
|
3536
3722
|
const app = context.app = {
|
|
@@ -3709,6 +3895,9 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
|
|
|
3709
3895
|
warn(`inject() can only be used inside setup() or functional components.`);
|
|
3710
3896
|
}
|
|
3711
3897
|
}
|
|
3898
|
+
function hasInjectionContext() {
|
|
3899
|
+
return !!(currentInstance || currentRenderingInstance || currentApp);
|
|
3900
|
+
}
|
|
3712
3901
|
|
|
3713
3902
|
function initProps(instance, rawProps, isStateful, isSSR = false) {
|
|
3714
3903
|
const props = {};
|
|
@@ -4177,6 +4366,7 @@ const updateSlots = (instance, children, optimized) => {
|
|
|
4177
4366
|
if (type) {
|
|
4178
4367
|
if (process.env.NODE_ENV !== "production" && isHmrUpdating) {
|
|
4179
4368
|
extend(slots, children);
|
|
4369
|
+
trigger(instance, "set", "$slots");
|
|
4180
4370
|
} else if (optimized && type === 1) {
|
|
4181
4371
|
needDeletionCheck = false;
|
|
4182
4372
|
} else {
|
|
@@ -5128,7 +5318,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5128
5318
|
areChildrenSVG,
|
|
5129
5319
|
slotScopeIds
|
|
5130
5320
|
);
|
|
5131
|
-
if (process.env.NODE_ENV !== "production"
|
|
5321
|
+
if (process.env.NODE_ENV !== "production") {
|
|
5132
5322
|
traverseStaticChildren(n1, n2);
|
|
5133
5323
|
}
|
|
5134
5324
|
} else if (!optimized) {
|
|
@@ -5322,7 +5512,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5322
5512
|
isSVG,
|
|
5323
5513
|
slotScopeIds
|
|
5324
5514
|
);
|
|
5325
|
-
if (process.env.NODE_ENV !== "production"
|
|
5515
|
+
if (process.env.NODE_ENV !== "production") {
|
|
5326
5516
|
traverseStaticChildren(n1, n2);
|
|
5327
5517
|
} else if (
|
|
5328
5518
|
// #2080 if the stable fragment has a key, it's a <template v-for> that may
|
|
@@ -6910,6 +7100,8 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
6910
7100
|
refs: EMPTY_OBJ,
|
|
6911
7101
|
setupState: EMPTY_OBJ,
|
|
6912
7102
|
setupContext: null,
|
|
7103
|
+
attrsProxy: null,
|
|
7104
|
+
slotsProxy: null,
|
|
6913
7105
|
// suspense related
|
|
6914
7106
|
suspense,
|
|
6915
7107
|
suspenseId: suspense ? suspense.pendingId : 0,
|
|
@@ -7151,8 +7343,8 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
7151
7343
|
}
|
|
7152
7344
|
}
|
|
7153
7345
|
}
|
|
7154
|
-
function
|
|
7155
|
-
return new Proxy(
|
|
7346
|
+
function getAttrsProxy(instance) {
|
|
7347
|
+
return instance.attrsProxy || (instance.attrsProxy = new Proxy(
|
|
7156
7348
|
instance.attrs,
|
|
7157
7349
|
process.env.NODE_ENV !== "production" ? {
|
|
7158
7350
|
get(target, key) {
|
|
@@ -7174,7 +7366,23 @@ function createAttrsProxy(instance) {
|
|
|
7174
7366
|
return target[key];
|
|
7175
7367
|
}
|
|
7176
7368
|
}
|
|
7177
|
-
);
|
|
7369
|
+
));
|
|
7370
|
+
}
|
|
7371
|
+
function getSlotsProxy(instance) {
|
|
7372
|
+
return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
|
|
7373
|
+
get(target, key) {
|
|
7374
|
+
track(instance, "get", "$slots");
|
|
7375
|
+
return target[key];
|
|
7376
|
+
},
|
|
7377
|
+
set() {
|
|
7378
|
+
warn(`setupContext.slots is readonly.`);
|
|
7379
|
+
return false;
|
|
7380
|
+
},
|
|
7381
|
+
deleteProperty() {
|
|
7382
|
+
warn(`setupContext.slots is readonly.`);
|
|
7383
|
+
return false;
|
|
7384
|
+
}
|
|
7385
|
+
}));
|
|
7178
7386
|
}
|
|
7179
7387
|
function createSetupContext(instance) {
|
|
7180
7388
|
const expose = (exposed) => {
|
|
@@ -7200,14 +7408,13 @@ function createSetupContext(instance) {
|
|
|
7200
7408
|
}
|
|
7201
7409
|
instance.exposed = exposed || {};
|
|
7202
7410
|
};
|
|
7203
|
-
let attrs;
|
|
7204
7411
|
if (process.env.NODE_ENV !== "production") {
|
|
7205
7412
|
return Object.freeze({
|
|
7206
7413
|
get attrs() {
|
|
7207
|
-
return
|
|
7414
|
+
return getAttrsProxy(instance);
|
|
7208
7415
|
},
|
|
7209
7416
|
get slots() {
|
|
7210
|
-
return
|
|
7417
|
+
return getSlotsProxy(instance);
|
|
7211
7418
|
},
|
|
7212
7419
|
get emit() {
|
|
7213
7420
|
return (event, ...args) => instance.emit(event, ...args);
|
|
@@ -7217,7 +7424,7 @@ function createSetupContext(instance) {
|
|
|
7217
7424
|
} else {
|
|
7218
7425
|
return {
|
|
7219
7426
|
get attrs() {
|
|
7220
|
-
return
|
|
7427
|
+
return getAttrsProxy(instance);
|
|
7221
7428
|
},
|
|
7222
7429
|
slots: instance.slots,
|
|
7223
7430
|
emit: instance.emit,
|
|
@@ -7276,161 +7483,6 @@ const computed = (getterOrOptions, debugOptions) => {
|
|
|
7276
7483
|
return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
|
|
7277
7484
|
};
|
|
7278
7485
|
|
|
7279
|
-
const warnRuntimeUsage = (method) => warn(
|
|
7280
|
-
`${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.`
|
|
7281
|
-
);
|
|
7282
|
-
function defineProps() {
|
|
7283
|
-
if (process.env.NODE_ENV !== "production") {
|
|
7284
|
-
warnRuntimeUsage(`defineProps`);
|
|
7285
|
-
}
|
|
7286
|
-
return null;
|
|
7287
|
-
}
|
|
7288
|
-
function defineEmits() {
|
|
7289
|
-
if (process.env.NODE_ENV !== "production") {
|
|
7290
|
-
warnRuntimeUsage(`defineEmits`);
|
|
7291
|
-
}
|
|
7292
|
-
return null;
|
|
7293
|
-
}
|
|
7294
|
-
function defineExpose(exposed) {
|
|
7295
|
-
if (process.env.NODE_ENV !== "production") {
|
|
7296
|
-
warnRuntimeUsage(`defineExpose`);
|
|
7297
|
-
}
|
|
7298
|
-
}
|
|
7299
|
-
function defineOptions(options) {
|
|
7300
|
-
if (process.env.NODE_ENV !== "production") {
|
|
7301
|
-
warnRuntimeUsage(`defineOptions`);
|
|
7302
|
-
}
|
|
7303
|
-
}
|
|
7304
|
-
function defineSlots() {
|
|
7305
|
-
if (process.env.NODE_ENV !== "production") {
|
|
7306
|
-
warnRuntimeUsage(`defineSlots`);
|
|
7307
|
-
}
|
|
7308
|
-
return null;
|
|
7309
|
-
}
|
|
7310
|
-
function defineModel() {
|
|
7311
|
-
if (process.env.NODE_ENV !== "production") {
|
|
7312
|
-
warnRuntimeUsage("defineModel");
|
|
7313
|
-
}
|
|
7314
|
-
}
|
|
7315
|
-
function withDefaults(props, defaults) {
|
|
7316
|
-
if (process.env.NODE_ENV !== "production") {
|
|
7317
|
-
warnRuntimeUsage(`withDefaults`);
|
|
7318
|
-
}
|
|
7319
|
-
return null;
|
|
7320
|
-
}
|
|
7321
|
-
function useSlots() {
|
|
7322
|
-
return getContext().slots;
|
|
7323
|
-
}
|
|
7324
|
-
function useAttrs() {
|
|
7325
|
-
return getContext().attrs;
|
|
7326
|
-
}
|
|
7327
|
-
function useModel(props, name, options) {
|
|
7328
|
-
const i = getCurrentInstance();
|
|
7329
|
-
if (process.env.NODE_ENV !== "production" && !i) {
|
|
7330
|
-
warn(`useModel() called without active instance.`);
|
|
7331
|
-
return ref();
|
|
7332
|
-
}
|
|
7333
|
-
if (process.env.NODE_ENV !== "production" && !i.propsOptions[0][name]) {
|
|
7334
|
-
warn(`useModel() called with prop "${name}" which is not declared.`);
|
|
7335
|
-
return ref();
|
|
7336
|
-
}
|
|
7337
|
-
if (options && options.local) {
|
|
7338
|
-
const proxy = ref(props[name]);
|
|
7339
|
-
watch(
|
|
7340
|
-
() => props[name],
|
|
7341
|
-
(v) => proxy.value = v
|
|
7342
|
-
);
|
|
7343
|
-
watch(proxy, (value) => {
|
|
7344
|
-
if (value !== props[name]) {
|
|
7345
|
-
i.emit(`update:${name}`, value);
|
|
7346
|
-
}
|
|
7347
|
-
});
|
|
7348
|
-
return proxy;
|
|
7349
|
-
} else {
|
|
7350
|
-
return {
|
|
7351
|
-
__v_isRef: true,
|
|
7352
|
-
get value() {
|
|
7353
|
-
return props[name];
|
|
7354
|
-
},
|
|
7355
|
-
set value(value) {
|
|
7356
|
-
i.emit(`update:${name}`, value);
|
|
7357
|
-
}
|
|
7358
|
-
};
|
|
7359
|
-
}
|
|
7360
|
-
}
|
|
7361
|
-
function getContext() {
|
|
7362
|
-
const i = getCurrentInstance();
|
|
7363
|
-
if (process.env.NODE_ENV !== "production" && !i) {
|
|
7364
|
-
warn(`useContext() called without active instance.`);
|
|
7365
|
-
}
|
|
7366
|
-
return i.setupContext || (i.setupContext = createSetupContext(i));
|
|
7367
|
-
}
|
|
7368
|
-
function normalizePropsOrEmits(props) {
|
|
7369
|
-
return isArray(props) ? props.reduce(
|
|
7370
|
-
(normalized, p) => (normalized[p] = {}, normalized),
|
|
7371
|
-
{}
|
|
7372
|
-
) : props;
|
|
7373
|
-
}
|
|
7374
|
-
function mergeDefaults(raw, defaults) {
|
|
7375
|
-
const props = normalizePropsOrEmits(raw);
|
|
7376
|
-
for (const key in defaults) {
|
|
7377
|
-
if (key.startsWith("__skip"))
|
|
7378
|
-
continue;
|
|
7379
|
-
let opt = props[key];
|
|
7380
|
-
if (opt) {
|
|
7381
|
-
if (isArray(opt) || isFunction(opt)) {
|
|
7382
|
-
opt = props[key] = { type: opt, default: defaults[key] };
|
|
7383
|
-
} else {
|
|
7384
|
-
opt.default = defaults[key];
|
|
7385
|
-
}
|
|
7386
|
-
} else if (opt === null) {
|
|
7387
|
-
opt = props[key] = { default: defaults[key] };
|
|
7388
|
-
} else if (process.env.NODE_ENV !== "production") {
|
|
7389
|
-
warn(`props default key "${key}" has no corresponding declaration.`);
|
|
7390
|
-
}
|
|
7391
|
-
if (opt && defaults[`__skip_${key}`]) {
|
|
7392
|
-
opt.skipFactory = true;
|
|
7393
|
-
}
|
|
7394
|
-
}
|
|
7395
|
-
return props;
|
|
7396
|
-
}
|
|
7397
|
-
function mergeModels(a, b) {
|
|
7398
|
-
if (!a || !b)
|
|
7399
|
-
return a || b;
|
|
7400
|
-
if (isArray(a) && isArray(b))
|
|
7401
|
-
return a.concat(b);
|
|
7402
|
-
return extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
|
|
7403
|
-
}
|
|
7404
|
-
function createPropsRestProxy(props, excludedKeys) {
|
|
7405
|
-
const ret = {};
|
|
7406
|
-
for (const key in props) {
|
|
7407
|
-
if (!excludedKeys.includes(key)) {
|
|
7408
|
-
Object.defineProperty(ret, key, {
|
|
7409
|
-
enumerable: true,
|
|
7410
|
-
get: () => props[key]
|
|
7411
|
-
});
|
|
7412
|
-
}
|
|
7413
|
-
}
|
|
7414
|
-
return ret;
|
|
7415
|
-
}
|
|
7416
|
-
function withAsyncContext(getAwaitable) {
|
|
7417
|
-
const ctx = getCurrentInstance();
|
|
7418
|
-
if (process.env.NODE_ENV !== "production" && !ctx) {
|
|
7419
|
-
warn(
|
|
7420
|
-
`withAsyncContext called without active current instance. This is likely a bug.`
|
|
7421
|
-
);
|
|
7422
|
-
}
|
|
7423
|
-
let awaitable = getAwaitable();
|
|
7424
|
-
unsetCurrentInstance();
|
|
7425
|
-
if (isPromise(awaitable)) {
|
|
7426
|
-
awaitable = awaitable.catch((e) => {
|
|
7427
|
-
setCurrentInstance(ctx);
|
|
7428
|
-
throw e;
|
|
7429
|
-
});
|
|
7430
|
-
}
|
|
7431
|
-
return [awaitable, () => setCurrentInstance(ctx)];
|
|
7432
|
-
}
|
|
7433
|
-
|
|
7434
7486
|
function h(type, propsOrChildren, children) {
|
|
7435
7487
|
const l = arguments.length;
|
|
7436
7488
|
if (l === 2) {
|
|
@@ -7670,7 +7722,7 @@ function isMemoSame(cached, memo) {
|
|
|
7670
7722
|
return true;
|
|
7671
7723
|
}
|
|
7672
7724
|
|
|
7673
|
-
const version = "3.3.0-
|
|
7725
|
+
const version = "3.3.0-beta.1";
|
|
7674
7726
|
const _ssrUtils = {
|
|
7675
7727
|
createComponentInstance,
|
|
7676
7728
|
setupComponent,
|
|
@@ -7683,4 +7735,4 @@ const ssrUtils = _ssrUtils ;
|
|
|
7683
7735
|
const resolveFilter = null;
|
|
7684
7736
|
const compatUtils = null;
|
|
7685
7737
|
|
|
7686
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, Fragment, KeepAlive, Static, Suspense, Teleport, Text, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, computed, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeModels, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, queuePostFlushCb, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, ssrContextKey, ssrUtils, toHandlers, transformVNodeArgs, useAttrs, useModel, useSSRContext, useSlots, useTransitionState, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
|
7738
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, Fragment, KeepAlive, Static, Suspense, Teleport, Text, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, cloneVNode, compatUtils, computed, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSlots, createStaticVNode, createTextVNode, createVNode, defineAsyncComponent, defineComponent, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSlots, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, mergeModels, mergeProps, nextTick, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, pushScopeId, queuePostFlushCb, registerRuntimeCompiler, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, ssrContextKey, ssrUtils, toHandlers, transformVNodeArgs, useAttrs, useModel, useSSRContext, useSlots, useTransitionState, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.3.0-
|
|
3
|
+
"version": "3.3.0-beta.1",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vue/shared": "3.3.0-
|
|
36
|
-
"@vue/reactivity": "3.3.0-
|
|
35
|
+
"@vue/shared": "3.3.0-beta.1",
|
|
36
|
+
"@vue/reactivity": "3.3.0-beta.1"
|
|
37
37
|
}
|
|
38
38
|
}
|