@vue/runtime-core 3.3.0-alpha.4 → 3.3.0-alpha.6

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.
@@ -2197,8 +2197,8 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
2197
2197
  return ret;
2198
2198
  }
2199
2199
 
2200
- function defineComponent(options) {
2201
- return isFunction(options) ? { setup: options, name: options.name } : options;
2200
+ function defineComponent(options, extraOptions) {
2201
+ return isFunction(options) ? extend({}, extraOptions, { setup: options, name: options.name }) : options;
2202
2202
  }
2203
2203
 
2204
2204
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -2700,7 +2700,7 @@ const DIRECTIVES = "directives";
2700
2700
  function resolveComponent(name, maybeSelfReference) {
2701
2701
  return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
2702
2702
  }
2703
- const NULL_DYNAMIC_COMPONENT = Symbol();
2703
+ const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
2704
2704
  function resolveDynamicComponent(component) {
2705
2705
  if (isString(component)) {
2706
2706
  return resolveAsset(COMPONENTS, component, false) || component;
@@ -3703,7 +3703,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
3703
3703
  const hasDefault = hasOwn(opt, "default");
3704
3704
  if (hasDefault && value === void 0) {
3705
3705
  const defaultValue = opt.default;
3706
- if (opt.type !== Function && isFunction(defaultValue)) {
3706
+ if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
3707
3707
  const { propsDefaults } = instance;
3708
3708
  if (key in propsDefaults) {
3709
3709
  value = propsDefaults[key];
@@ -3839,7 +3839,7 @@ function validateProps(rawProps, props, instance) {
3839
3839
  }
3840
3840
  }
3841
3841
  function validateProp(name, value, prop, isAbsent) {
3842
- const { type, required, validator } = prop;
3842
+ const { type, required, validator, skipCheck } = prop;
3843
3843
  if (required && isAbsent) {
3844
3844
  warn('Missing required prop: "' + name + '"');
3845
3845
  return;
@@ -3847,7 +3847,7 @@ function validateProp(name, value, prop, isAbsent) {
3847
3847
  if (value == null && !prop.required) {
3848
3848
  return;
3849
3849
  }
3850
- if (type != null && type !== true) {
3850
+ if (type != null && type !== true && !skipCheck) {
3851
3851
  let isValid = false;
3852
3852
  const types = isArray(type) ? type : [type];
3853
3853
  const expectedTypes = [];
@@ -6483,10 +6483,10 @@ function updateCssVars(vnode) {
6483
6483
  }
6484
6484
  }
6485
6485
 
6486
- const Fragment = Symbol(process.env.NODE_ENV !== "production" ? "Fragment" : void 0);
6487
- const Text = Symbol(process.env.NODE_ENV !== "production" ? "Text" : void 0);
6488
- const Comment = Symbol(process.env.NODE_ENV !== "production" ? "Comment" : void 0);
6489
- const Static = Symbol(process.env.NODE_ENV !== "production" ? "Static" : void 0);
6486
+ const Fragment = Symbol.for("v-fgt");
6487
+ const Text = Symbol.for("v-txt");
6488
+ const Comment = Symbol.for("v-cmt");
6489
+ const Static = Symbol.for("v-stc");
6490
6490
  const blockStack = [];
6491
6491
  let currentBlock = null;
6492
6492
  function openBlock(disableTracking = false) {
@@ -6940,13 +6940,29 @@ function createComponentInstance(vnode, parent, suspense) {
6940
6940
  }
6941
6941
  let currentInstance = null;
6942
6942
  const getCurrentInstance = () => currentInstance || currentRenderingInstance;
6943
+ let internalSetCurrentInstance;
6944
+ let globalCurrentInstanceSetters;
6945
+ let settersKey = "__VUE_INSTANCE_SETTERS__";
6946
+ {
6947
+ if (!(globalCurrentInstanceSetters = getGlobalThis()[settersKey])) {
6948
+ globalCurrentInstanceSetters = getGlobalThis()[settersKey] = [];
6949
+ }
6950
+ globalCurrentInstanceSetters.push((i) => currentInstance = i);
6951
+ internalSetCurrentInstance = (instance) => {
6952
+ if (globalCurrentInstanceSetters.length > 1) {
6953
+ globalCurrentInstanceSetters.forEach((s) => s(instance));
6954
+ } else {
6955
+ globalCurrentInstanceSetters[0](instance);
6956
+ }
6957
+ };
6958
+ }
6943
6959
  const setCurrentInstance = (instance) => {
6944
- currentInstance = instance;
6960
+ internalSetCurrentInstance(instance);
6945
6961
  instance.scope.on();
6946
6962
  };
6947
6963
  const unsetCurrentInstance = () => {
6948
6964
  currentInstance && currentInstance.scope.off();
6949
- currentInstance = null;
6965
+ internalSetCurrentInstance(null);
6950
6966
  };
6951
6967
  const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component");
6952
6968
  function validateComponentName(name, config) {
@@ -7271,6 +7287,11 @@ function defineExpose(exposed) {
7271
7287
  warnRuntimeUsage(`defineExpose`);
7272
7288
  }
7273
7289
  }
7290
+ function defineOptions(options) {
7291
+ if (process.env.NODE_ENV !== "production") {
7292
+ warnRuntimeUsage(`defineOptions`);
7293
+ }
7294
+ }
7274
7295
  function withDefaults(props, defaults) {
7275
7296
  if (process.env.NODE_ENV !== "production") {
7276
7297
  warnRuntimeUsage(`withDefaults`);
@@ -7296,18 +7317,23 @@ function mergeDefaults(raw, defaults) {
7296
7317
  {}
7297
7318
  ) : raw;
7298
7319
  for (const key in defaults) {
7299
- const opt = props[key];
7320
+ if (key.startsWith("__skip"))
7321
+ continue;
7322
+ let opt = props[key];
7300
7323
  if (opt) {
7301
7324
  if (isArray(opt) || isFunction(opt)) {
7302
- props[key] = { type: opt, default: defaults[key] };
7325
+ opt = props[key] = { type: opt, default: defaults[key] };
7303
7326
  } else {
7304
7327
  opt.default = defaults[key];
7305
7328
  }
7306
7329
  } else if (opt === null) {
7307
- props[key] = { default: defaults[key] };
7330
+ opt = props[key] = { default: defaults[key] };
7308
7331
  } else if (process.env.NODE_ENV !== "production") {
7309
7332
  warn(`props default key "${key}" has no corresponding declaration.`);
7310
7333
  }
7334
+ if (opt && defaults[`__skip_${key}`]) {
7335
+ opt.skipFactory = true;
7336
+ }
7311
7337
  }
7312
7338
  return props;
7313
7339
  }
@@ -7362,7 +7388,7 @@ function h(type, propsOrChildren, children) {
7362
7388
  }
7363
7389
  }
7364
7390
 
7365
- const ssrContextKey = Symbol(process.env.NODE_ENV !== "production" ? `ssrContext` : ``);
7391
+ const ssrContextKey = Symbol.for("v-scx");
7366
7392
  const useSSRContext = () => {
7367
7393
  {
7368
7394
  const ctx = inject(ssrContextKey);
@@ -7580,7 +7606,7 @@ function isMemoSame(cached, memo) {
7580
7606
  return true;
7581
7607
  }
7582
7608
 
7583
- const version = "3.3.0-alpha.4";
7609
+ const version = "3.3.0-alpha.6";
7584
7610
  const _ssrUtils = {
7585
7611
  createComponentInstance,
7586
7612
  setupComponent,
@@ -7593,4 +7619,4 @@ const ssrUtils = _ssrUtils ;
7593
7619
  const resolveFilter = null;
7594
7620
  const compatUtils = null;
7595
7621
 
7596
- 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, defineProps, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, 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, useSSRContext, useSlots, useTransitionState, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withMemo, withScopeId };
7622
+ 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, defineOptions, defineProps, devtools, getCurrentInstance, getTransitionRawChildren, guardReactiveProps, h, handleError, initCustomFormatter, inject, isMemoSame, isRuntimeOnly, isVNode, mergeDefaults, 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, 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-alpha.4",
3
+ "version": "3.3.0-alpha.6",
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-alpha.4",
36
- "@vue/reactivity": "3.3.0-alpha.4"
35
+ "@vue/shared": "3.3.0-alpha.6",
36
+ "@vue/reactivity": "3.3.0-alpha.6"
37
37
  }
38
38
  }