@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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > This package is published only for typing and building custom renderers. It is NOT meant to be used in applications.
4
4
 
5
- For full exposed APIs, see `src/index.ts`. You can also run `pnpm build runtime-core --types` from repo root, which will generate an API report at `temp/runtime-core.api.md`.
5
+ For full exposed APIs, see `src/index.ts`.
6
6
 
7
7
  ## Building a Custom Renderer
8
8
 
@@ -449,6 +449,8 @@ function reload(id, newComp) {
449
449
  }
450
450
  hmrDirtyComponents.add(oldComp);
451
451
  }
452
+ instance.appContext.propsCache.delete(instance.type);
453
+ instance.appContext.emitsCache.delete(instance.type);
452
454
  instance.appContext.optionsCache.delete(instance.type);
453
455
  if (instance.ceReload) {
454
456
  hmrDirtyComponents.add(oldComp);
@@ -1291,7 +1293,8 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, isSVG, slotSc
1291
1293
  }
1292
1294
  }
1293
1295
  let hasWarned = false;
1294
- function createSuspenseBoundary(vnode, parent, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
1296
+ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, isSVG, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
1297
+ var _a;
1295
1298
  if (!hasWarned) {
1296
1299
  hasWarned = true;
1297
1300
  console[console.info ? "info" : "log"](
@@ -1305,13 +1308,21 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
1305
1308
  n: next,
1306
1309
  o: { parentNode, remove }
1307
1310
  } = rendererInternals;
1311
+ let parentSuspenseId;
1312
+ const isSuspensible = ((_a = vnode.props) == null ? void 0 : _a.suspensible) != null && vnode.props.suspensible !== false;
1313
+ if (isSuspensible) {
1314
+ if (parentSuspense == null ? void 0 : parentSuspense.pendingBranch) {
1315
+ parentSuspenseId = parentSuspense == null ? void 0 : parentSuspense.pendingId;
1316
+ parentSuspense.deps++;
1317
+ }
1318
+ }
1308
1319
  const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : void 0;
1309
1320
  {
1310
1321
  assertNumber(timeout, `Suspense timeout`);
1311
1322
  }
1312
1323
  const suspense = {
1313
1324
  vnode,
1314
- parent,
1325
+ parent: parentSuspense,
1315
1326
  parentComponent,
1316
1327
  isSVG,
1317
1328
  container,
@@ -1371,20 +1382,28 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
1371
1382
  setActiveBranch(suspense, pendingBranch);
1372
1383
  suspense.pendingBranch = null;
1373
1384
  suspense.isInFallback = false;
1374
- let parent2 = suspense.parent;
1385
+ let parent = suspense.parent;
1375
1386
  let hasUnresolvedAncestor = false;
1376
- while (parent2) {
1377
- if (parent2.pendingBranch) {
1378
- parent2.effects.push(...effects);
1387
+ while (parent) {
1388
+ if (parent.pendingBranch) {
1389
+ parent.effects.push(...effects);
1379
1390
  hasUnresolvedAncestor = true;
1380
1391
  break;
1381
1392
  }
1382
- parent2 = parent2.parent;
1393
+ parent = parent.parent;
1383
1394
  }
1384
1395
  if (!hasUnresolvedAncestor) {
1385
1396
  queuePostFlushCb(effects);
1386
1397
  }
1387
1398
  suspense.effects = [];
1399
+ if (isSuspensible) {
1400
+ if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
1401
+ parentSuspense.deps--;
1402
+ if (parentSuspense.deps === 0) {
1403
+ parentSuspense.resolve();
1404
+ }
1405
+ }
1406
+ }
1388
1407
  triggerEvent(vnode2, "onResolve");
1389
1408
  },
1390
1409
  fallback(fallbackVNode) {
@@ -1484,13 +1503,13 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
1484
1503
  }
1485
1504
  });
1486
1505
  },
1487
- unmount(parentSuspense, doRemove) {
1506
+ unmount(parentSuspense2, doRemove) {
1488
1507
  suspense.isUnmounted = true;
1489
1508
  if (suspense.activeBranch) {
1490
1509
  unmount(
1491
1510
  suspense.activeBranch,
1492
1511
  parentComponent,
1493
- parentSuspense,
1512
+ parentSuspense2,
1494
1513
  doRemove
1495
1514
  );
1496
1515
  }
@@ -1498,7 +1517,7 @@ function createSuspenseBoundary(vnode, parent, parentComponent, container, hidde
1498
1517
  unmount(
1499
1518
  suspense.pendingBranch,
1500
1519
  parentComponent,
1501
- parentSuspense,
1520
+ parentSuspense2,
1502
1521
  doRemove
1503
1522
  );
1504
1523
  }
@@ -2907,6 +2926,8 @@ const PublicInstanceProxyHandlers = {
2907
2926
  if (key === "$attrs") {
2908
2927
  reactivity.track(instance, "get", key);
2909
2928
  markAttrsAccessed();
2929
+ } else if (key === "$slots") {
2930
+ reactivity.track(instance, "get", key);
2910
2931
  }
2911
2932
  return publicGetter(instance);
2912
2933
  } else if (
@@ -3076,6 +3097,161 @@ function exposeSetupStateOnRenderContext(instance) {
3076
3097
  });
3077
3098
  }
3078
3099
 
3100
+ const warnRuntimeUsage = (method) => warn(
3101
+ `${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.`
3102
+ );
3103
+ function defineProps() {
3104
+ {
3105
+ warnRuntimeUsage(`defineProps`);
3106
+ }
3107
+ return null;
3108
+ }
3109
+ function defineEmits() {
3110
+ {
3111
+ warnRuntimeUsage(`defineEmits`);
3112
+ }
3113
+ return null;
3114
+ }
3115
+ function defineExpose(exposed) {
3116
+ {
3117
+ warnRuntimeUsage(`defineExpose`);
3118
+ }
3119
+ }
3120
+ function defineOptions(options) {
3121
+ {
3122
+ warnRuntimeUsage(`defineOptions`);
3123
+ }
3124
+ }
3125
+ function defineSlots() {
3126
+ {
3127
+ warnRuntimeUsage(`defineSlots`);
3128
+ }
3129
+ return null;
3130
+ }
3131
+ function defineModel() {
3132
+ {
3133
+ warnRuntimeUsage("defineModel");
3134
+ }
3135
+ }
3136
+ function withDefaults(props, defaults) {
3137
+ {
3138
+ warnRuntimeUsage(`withDefaults`);
3139
+ }
3140
+ return null;
3141
+ }
3142
+ function useSlots() {
3143
+ return getContext().slots;
3144
+ }
3145
+ function useAttrs() {
3146
+ return getContext().attrs;
3147
+ }
3148
+ function useModel(props, name, options) {
3149
+ const i = getCurrentInstance();
3150
+ if (!i) {
3151
+ warn(`useModel() called without active instance.`);
3152
+ return reactivity.ref();
3153
+ }
3154
+ if (!i.propsOptions[0][name]) {
3155
+ warn(`useModel() called with prop "${name}" which is not declared.`);
3156
+ return reactivity.ref();
3157
+ }
3158
+ if (options && options.local) {
3159
+ const proxy = reactivity.ref(props[name]);
3160
+ watch(
3161
+ () => props[name],
3162
+ (v) => proxy.value = v
3163
+ );
3164
+ watch(proxy, (value) => {
3165
+ if (value !== props[name]) {
3166
+ i.emit(`update:${name}`, value);
3167
+ }
3168
+ });
3169
+ return proxy;
3170
+ } else {
3171
+ return {
3172
+ __v_isRef: true,
3173
+ get value() {
3174
+ return props[name];
3175
+ },
3176
+ set value(value) {
3177
+ i.emit(`update:${name}`, value);
3178
+ }
3179
+ };
3180
+ }
3181
+ }
3182
+ function getContext() {
3183
+ const i = getCurrentInstance();
3184
+ if (!i) {
3185
+ warn(`useContext() called without active instance.`);
3186
+ }
3187
+ return i.setupContext || (i.setupContext = createSetupContext(i));
3188
+ }
3189
+ function normalizePropsOrEmits(props) {
3190
+ return shared.isArray(props) ? props.reduce(
3191
+ (normalized, p) => (normalized[p] = null, normalized),
3192
+ {}
3193
+ ) : props;
3194
+ }
3195
+ function mergeDefaults(raw, defaults) {
3196
+ const props = normalizePropsOrEmits(raw);
3197
+ for (const key in defaults) {
3198
+ if (key.startsWith("__skip"))
3199
+ continue;
3200
+ let opt = props[key];
3201
+ if (opt) {
3202
+ if (shared.isArray(opt) || shared.isFunction(opt)) {
3203
+ opt = props[key] = { type: opt, default: defaults[key] };
3204
+ } else {
3205
+ opt.default = defaults[key];
3206
+ }
3207
+ } else if (opt === null) {
3208
+ opt = props[key] = { default: defaults[key] };
3209
+ } else {
3210
+ warn(`props default key "${key}" has no corresponding declaration.`);
3211
+ }
3212
+ if (opt && defaults[`__skip_${key}`]) {
3213
+ opt.skipFactory = true;
3214
+ }
3215
+ }
3216
+ return props;
3217
+ }
3218
+ function mergeModels(a, b) {
3219
+ if (!a || !b)
3220
+ return a || b;
3221
+ if (shared.isArray(a) && shared.isArray(b))
3222
+ return a.concat(b);
3223
+ return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
3224
+ }
3225
+ function createPropsRestProxy(props, excludedKeys) {
3226
+ const ret = {};
3227
+ for (const key in props) {
3228
+ if (!excludedKeys.includes(key)) {
3229
+ Object.defineProperty(ret, key, {
3230
+ enumerable: true,
3231
+ get: () => props[key]
3232
+ });
3233
+ }
3234
+ }
3235
+ return ret;
3236
+ }
3237
+ function withAsyncContext(getAwaitable) {
3238
+ const ctx = getCurrentInstance();
3239
+ if (!ctx) {
3240
+ warn(
3241
+ `withAsyncContext called without active current instance. This is likely a bug.`
3242
+ );
3243
+ }
3244
+ let awaitable = getAwaitable();
3245
+ unsetCurrentInstance();
3246
+ if (shared.isPromise(awaitable)) {
3247
+ awaitable = awaitable.catch((e) => {
3248
+ setCurrentInstance(ctx);
3249
+ throw e;
3250
+ });
3251
+ }
3252
+ return [awaitable, () => setCurrentInstance(ctx)];
3253
+ }
3254
+
3079
3255
  function createDuplicateChecker() {
3080
3256
  const cache = /* @__PURE__ */ Object.create(null);
3081
3257
  return (type, key) => {
@@ -3138,12 +3314,7 @@ function applyOptions(instance) {
3138
3314
  }
3139
3315
  }
3140
3316
  if (injectOptions) {
3141
- resolveInjections(
3142
- injectOptions,
3143
- ctx,
3144
- checkDuplicateProperties,
3145
- instance.appContext.config.unwrapInjectedRef
3146
- );
3317
+ resolveInjections(injectOptions, ctx, checkDuplicateProperties);
3147
3318
  }
3148
3319
  if (methods) {
3149
3320
  for (const key in methods) {
@@ -3283,7 +3454,7 @@ function applyOptions(instance) {
3283
3454
  if (directives)
3284
3455
  instance.directives = directives;
3285
3456
  }
3286
- function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP, unwrapRef = false) {
3457
+ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared.NOOP) {
3287
3458
  if (shared.isArray(injectOptions)) {
3288
3459
  injectOptions = normalizeInject(injectOptions);
3289
3460
  }
@@ -3305,21 +3476,12 @@ function resolveInjections(injectOptions, ctx, checkDuplicateProperties = shared
3305
3476
  injected = inject(opt);
3306
3477
  }
3307
3478
  if (reactivity.isRef(injected)) {
3308
- if (unwrapRef) {
3309
- Object.defineProperty(ctx, key, {
3310
- enumerable: true,
3311
- configurable: true,
3312
- get: () => injected.value,
3313
- set: (v) => injected.value = v
3314
- });
3315
- } else {
3316
- {
3317
- warn(
3318
- `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.)`
3319
- );
3320
- }
3321
- ctx[key] = injected;
3322
- }
3479
+ Object.defineProperty(ctx, key, {
3480
+ enumerable: true,
3481
+ configurable: true,
3482
+ get: () => injected.value,
3483
+ set: (v) => injected.value = v
3484
+ });
3323
3485
  } else {
3324
3486
  ctx[key] = injected;
3325
3487
  }
@@ -3415,10 +3577,8 @@ function mergeOptions(to, from, strats, asMixin = false) {
3415
3577
  }
3416
3578
  const internalOptionMergeStrats = {
3417
3579
  data: mergeDataFn,
3418
- props: mergeObjectOptions,
3419
- // TODO
3420
- emits: mergeObjectOptions,
3421
- // TODO
3580
+ props: mergeEmitsOrPropsOptions,
3581
+ emits: mergeEmitsOrPropsOptions,
3422
3582
  // objects
3423
3583
  methods: mergeObjectOptions,
3424
3584
  computed: mergeObjectOptions,
@@ -3477,7 +3637,21 @@ function mergeAsArray(to, from) {
3477
3637
  return to ? [...new Set([].concat(to, from))] : from;
3478
3638
  }
3479
3639
  function mergeObjectOptions(to, from) {
3480
- return to ? shared.extend(shared.extend(/* @__PURE__ */ Object.create(null), to), from) : from;
3640
+ return to ? shared.extend(/* @__PURE__ */ Object.create(null), to, from) : from;
3641
+ }
3642
+ function mergeEmitsOrPropsOptions(to, from) {
3643
+ if (to) {
3644
+ if (shared.isArray(to) && shared.isArray(from)) {
3645
+ return [.../* @__PURE__ */ new Set([...to, ...from])];
3646
+ }
3647
+ return shared.extend(
3648
+ /* @__PURE__ */ Object.create(null),
3649
+ normalizePropsOrEmits(to),
3650
+ normalizePropsOrEmits(from != null ? from : {})
3651
+ );
3652
+ } else {
3653
+ return from;
3654
+ }
3481
3655
  }
3482
3656
  function mergeWatchOptions(to, from) {
3483
3657
  if (!to)
@@ -3523,6 +3697,18 @@ function createAppAPI(render, hydrate) {
3523
3697
  rootProps = null;
3524
3698
  }
3525
3699
  const context = createAppContext();
3700
+ {
3701
+ Object.defineProperty(context.config, "unwrapInjectedRef", {
3702
+ get() {
3703
+ return true;
3704
+ },
3705
+ set() {
3706
+ warn(
3707
+ `app.config.unwrapInjectedRef has been deprecated. 3.3 now alawys unwraps injected refs in Options API.`
3708
+ );
3709
+ }
3710
+ });
3711
+ }
3526
3712
  const installedPlugins = /* @__PURE__ */ new Set();
3527
3713
  let isMounted = false;
3528
3714
  const app = context.app = {
@@ -3699,6 +3885,9 @@ function inject(key, defaultValue, treatDefaultAsFactory = false) {
3699
3885
  warn(`inject() can only be used inside setup() or functional components.`);
3700
3886
  }
3701
3887
  }
3888
+ function hasInjectionContext() {
3889
+ return !!(currentInstance || currentRenderingInstance || currentApp);
3890
+ }
3702
3891
 
3703
3892
  function initProps(instance, rawProps, isStateful, isSSR = false) {
3704
3893
  const props = {};
@@ -4167,6 +4356,7 @@ const updateSlots = (instance, children, optimized) => {
4167
4356
  if (type) {
4168
4357
  if (isHmrUpdating) {
4169
4358
  shared.extend(slots, children);
4359
+ reactivity.trigger(instance, "set", "$slots");
4170
4360
  } else if (optimized && type === 1) {
4171
4361
  needDeletionCheck = false;
4172
4362
  } else {
@@ -5095,7 +5285,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5095
5285
  areChildrenSVG,
5096
5286
  slotScopeIds
5097
5287
  );
5098
- if (parentComponent && parentComponent.type.__hmrId) {
5288
+ {
5099
5289
  traverseStaticChildren(n1, n2);
5100
5290
  }
5101
5291
  } else if (!optimized) {
@@ -5291,21 +5481,8 @@ function baseCreateRenderer(options, createHydrationFns) {
5291
5481
  isSVG,
5292
5482
  slotScopeIds
5293
5483
  );
5294
- if (parentComponent && parentComponent.type.__hmrId) {
5484
+ {
5295
5485
  traverseStaticChildren(n1, n2);
5296
- } else if (
5297
- // #2080 if the stable fragment has a key, it's a <template v-for> that may
5298
- // get moved around. Make sure all root level vnodes inherit el.
5299
- // #2134 or if it's a component root, it may also get moved around
5300
- // as the component is being moved.
5301
- n2.key != null || parentComponent && n2 === parentComponent.subTree
5302
- ) {
5303
- traverseStaticChildren(
5304
- n1,
5305
- n2,
5306
- true
5307
- /* shallow */
5308
- );
5309
5486
  }
5310
5487
  } else {
5311
5488
  patchChildren(
@@ -6879,6 +7056,8 @@ function createComponentInstance(vnode, parent, suspense) {
6879
7056
  refs: shared.EMPTY_OBJ,
6880
7057
  setupState: shared.EMPTY_OBJ,
6881
7058
  setupContext: null,
7059
+ attrsProxy: null,
7060
+ slotsProxy: null,
6882
7061
  // suspense related
6883
7062
  suspense,
6884
7063
  suspenseId: suspense ? suspense.pendingId : 0,
@@ -7118,8 +7297,8 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
7118
7297
  }
7119
7298
  }
7120
7299
  }
7121
- function createAttrsProxy(instance) {
7122
- return new Proxy(
7300
+ function getAttrsProxy(instance) {
7301
+ return instance.attrsProxy || (instance.attrsProxy = new Proxy(
7123
7302
  instance.attrs,
7124
7303
  {
7125
7304
  get(target, key) {
@@ -7136,7 +7315,23 @@ function createAttrsProxy(instance) {
7136
7315
  return false;
7137
7316
  }
7138
7317
  }
7139
- );
7318
+ ));
7319
+ }
7320
+ function getSlotsProxy(instance) {
7321
+ return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
7322
+ get(target, key) {
7323
+ reactivity.track(instance, "get", "$slots");
7324
+ return target[key];
7325
+ },
7326
+ set() {
7327
+ warn(`setupContext.slots is readonly.`);
7328
+ return false;
7329
+ },
7330
+ deleteProperty() {
7331
+ warn(`setupContext.slots is readonly.`);
7332
+ return false;
7333
+ }
7334
+ }));
7140
7335
  }
7141
7336
  function createSetupContext(instance) {
7142
7337
  const expose = (exposed) => {
@@ -7162,14 +7357,13 @@ function createSetupContext(instance) {
7162
7357
  }
7163
7358
  instance.exposed = exposed || {};
7164
7359
  };
7165
- let attrs;
7166
7360
  {
7167
7361
  return Object.freeze({
7168
7362
  get attrs() {
7169
- return attrs || (attrs = createAttrsProxy(instance));
7363
+ return getAttrsProxy(instance);
7170
7364
  },
7171
7365
  get slots() {
7172
- return reactivity.shallowReadonly(instance.slots);
7366
+ return getSlotsProxy(instance);
7173
7367
  },
7174
7368
  get emit() {
7175
7369
  return (event, ...args) => instance.emit(event, ...args);
@@ -7229,161 +7423,6 @@ const computed = (getterOrOptions, debugOptions) => {
7229
7423
  return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
7230
7424
  };
7231
7425
 
7232
- const warnRuntimeUsage = (method) => warn(
7233
- `${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.`
7234
- );
7235
- function defineProps() {
7236
- {
7237
- warnRuntimeUsage(`defineProps`);
7238
- }
7239
- return null;
7240
- }
7241
- function defineEmits() {
7242
- {
7243
- warnRuntimeUsage(`defineEmits`);
7244
- }
7245
- return null;
7246
- }
7247
- function defineExpose(exposed) {
7248
- {
7249
- warnRuntimeUsage(`defineExpose`);
7250
- }
7251
- }
7252
- function defineOptions(options) {
7253
- {
7254
- warnRuntimeUsage(`defineOptions`);
7255
- }
7256
- }
7257
- function defineSlots() {
7258
- {
7259
- warnRuntimeUsage(`defineSlots`);
7260
- }
7261
- return null;
7262
- }
7263
- function defineModel() {
7264
- {
7265
- warnRuntimeUsage("defineModel");
7266
- }
7267
- }
7268
- function withDefaults(props, defaults) {
7269
- {
7270
- warnRuntimeUsage(`withDefaults`);
7271
- }
7272
- return null;
7273
- }
7274
- function useSlots() {
7275
- return getContext().slots;
7276
- }
7277
- function useAttrs() {
7278
- return getContext().attrs;
7279
- }
7280
- function useModel(props, name, options) {
7281
- const i = getCurrentInstance();
7282
- if (!i) {
7283
- warn(`useModel() called without active instance.`);
7284
- return reactivity.ref();
7285
- }
7286
- if (!i.propsOptions[0][name]) {
7287
- warn(`useModel() called with prop "${name}" which is not declared.`);
7288
- return reactivity.ref();
7289
- }
7290
- if (options && options.local) {
7291
- const proxy = reactivity.ref(props[name]);
7292
- watch(
7293
- () => props[name],
7294
- (v) => proxy.value = v
7295
- );
7296
- watch(proxy, (value) => {
7297
- if (value !== props[name]) {
7298
- i.emit(`update:${name}`, value);
7299
- }
7300
- });
7301
- return proxy;
7302
- } else {
7303
- return {
7304
- __v_isRef: true,
7305
- get value() {
7306
- return props[name];
7307
- },
7308
- set value(value) {
7309
- i.emit(`update:${name}`, value);
7310
- }
7311
- };
7312
- }
7313
- }
7314
- function getContext() {
7315
- const i = getCurrentInstance();
7316
- if (!i) {
7317
- warn(`useContext() called without active instance.`);
7318
- }
7319
- return i.setupContext || (i.setupContext = createSetupContext(i));
7320
- }
7321
- function normalizePropsOrEmits(props) {
7322
- return shared.isArray(props) ? props.reduce(
7323
- (normalized, p) => (normalized[p] = {}, normalized),
7324
- {}
7325
- ) : props;
7326
- }
7327
- function mergeDefaults(raw, defaults) {
7328
- const props = normalizePropsOrEmits(raw);
7329
- for (const key in defaults) {
7330
- if (key.startsWith("__skip"))
7331
- continue;
7332
- let opt = props[key];
7333
- if (opt) {
7334
- if (shared.isArray(opt) || shared.isFunction(opt)) {
7335
- opt = props[key] = { type: opt, default: defaults[key] };
7336
- } else {
7337
- opt.default = defaults[key];
7338
- }
7339
- } else if (opt === null) {
7340
- opt = props[key] = { default: defaults[key] };
7341
- } else {
7342
- warn(`props default key "${key}" has no corresponding declaration.`);
7343
- }
7344
- if (opt && defaults[`__skip_${key}`]) {
7345
- opt.skipFactory = true;
7346
- }
7347
- }
7348
- return props;
7349
- }
7350
- function mergeModels(a, b) {
7351
- if (!a || !b)
7352
- return a || b;
7353
- if (shared.isArray(a) && shared.isArray(b))
7354
- return a.concat(b);
7355
- return shared.extend({}, normalizePropsOrEmits(a), normalizePropsOrEmits(b));
7356
- }
7357
- function createPropsRestProxy(props, excludedKeys) {
7358
- const ret = {};
7359
- for (const key in props) {
7360
- if (!excludedKeys.includes(key)) {
7361
- Object.defineProperty(ret, key, {
7362
- enumerable: true,
7363
- get: () => props[key]
7364
- });
7365
- }
7366
- }
7367
- return ret;
7368
- }
7369
- function withAsyncContext(getAwaitable) {
7370
- const ctx = getCurrentInstance();
7371
- if (!ctx) {
7372
- warn(
7373
- `withAsyncContext called without active current instance. This is likely a bug.`
7374
- );
7375
- }
7376
- let awaitable = getAwaitable();
7377
- unsetCurrentInstance();
7378
- if (shared.isPromise(awaitable)) {
7379
- awaitable = awaitable.catch((e) => {
7380
- setCurrentInstance(ctx);
7381
- throw e;
7382
- });
7383
- }
7384
- return [awaitable, () => setCurrentInstance(ctx)];
7385
- }
7386
-
7387
7426
  function h(type, propsOrChildren, children) {
7388
7427
  const l = arguments.length;
7389
7428
  if (l === 2) {
@@ -7623,7 +7662,7 @@ function isMemoSame(cached, memo) {
7623
7662
  return true;
7624
7663
  }
7625
7664
 
7626
- const version = "3.3.0-alpha.9";
7665
+ const version = "3.3.0-beta.1";
7627
7666
  const _ssrUtils = {
7628
7667
  createComponentInstance,
7629
7668
  setupComponent,
@@ -7709,6 +7748,7 @@ exports.getTransitionRawChildren = getTransitionRawChildren;
7709
7748
  exports.guardReactiveProps = guardReactiveProps;
7710
7749
  exports.h = h;
7711
7750
  exports.handleError = handleError;
7751
+ exports.hasInjectionContext = hasInjectionContext;
7712
7752
  exports.initCustomFormatter = initCustomFormatter;
7713
7753
  exports.inject = inject;
7714
7754
  exports.isMemoSame = isMemoSame;