@vue/runtime-core 3.3.0-alpha.5 → 3.3.0-alpha.7

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.
@@ -2191,8 +2191,8 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
2191
2191
  return ret;
2192
2192
  }
2193
2193
 
2194
- function defineComponent(options) {
2195
- return shared.isFunction(options) ? { setup: options, name: options.name } : options;
2194
+ function defineComponent(options, extraOptions) {
2195
+ return shared.isFunction(options) ? shared.extend({}, extraOptions, { setup: options, name: options.name }) : options;
2196
2196
  }
2197
2197
 
2198
2198
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -3695,7 +3695,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
3695
3695
  const hasDefault = shared.hasOwn(opt, "default");
3696
3696
  if (hasDefault && value === void 0) {
3697
3697
  const defaultValue = opt.default;
3698
- if (opt.type !== Function && shared.isFunction(defaultValue)) {
3698
+ if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
3699
3699
  const { propsDefaults } = instance;
3700
3700
  if (key in propsDefaults) {
3701
3701
  value = propsDefaults[key];
@@ -3831,7 +3831,7 @@ function validateProps(rawProps, props, instance) {
3831
3831
  }
3832
3832
  }
3833
3833
  function validateProp(name, value, prop, isAbsent) {
3834
- const { type, required, validator } = prop;
3834
+ const { type, required, validator, skipCheck } = prop;
3835
3835
  if (required && isAbsent) {
3836
3836
  warn('Missing required prop: "' + name + '"');
3837
3837
  return;
@@ -3839,7 +3839,7 @@ function validateProp(name, value, prop, isAbsent) {
3839
3839
  if (value == null && !prop.required) {
3840
3840
  return;
3841
3841
  }
3842
- if (type != null && type !== true) {
3842
+ if (type != null && type !== true && !skipCheck) {
3843
3843
  let isValid = false;
3844
3844
  const types = shared.isArray(type) ? type : [type];
3845
3845
  const expectedTypes = [];
@@ -7240,6 +7240,16 @@ function defineExpose(exposed) {
7240
7240
  warnRuntimeUsage(`defineExpose`);
7241
7241
  }
7242
7242
  }
7243
+ function defineOptions(options) {
7244
+ {
7245
+ warnRuntimeUsage(`defineOptions`);
7246
+ }
7247
+ }
7248
+ function defineSlots() {
7249
+ {
7250
+ warnRuntimeUsage(`defineSlots`);
7251
+ }
7252
+ }
7243
7253
  function withDefaults(props, defaults) {
7244
7254
  {
7245
7255
  warnRuntimeUsage(`withDefaults`);
@@ -7265,18 +7275,23 @@ function mergeDefaults(raw, defaults) {
7265
7275
  {}
7266
7276
  ) : raw;
7267
7277
  for (const key in defaults) {
7268
- const opt = props[key];
7278
+ if (key.startsWith("__skip"))
7279
+ continue;
7280
+ let opt = props[key];
7269
7281
  if (opt) {
7270
7282
  if (shared.isArray(opt) || shared.isFunction(opt)) {
7271
- props[key] = { type: opt, default: defaults[key] };
7283
+ opt = props[key] = { type: opt, default: defaults[key] };
7272
7284
  } else {
7273
7285
  opt.default = defaults[key];
7274
7286
  }
7275
7287
  } else if (opt === null) {
7276
- props[key] = { default: defaults[key] };
7288
+ opt = props[key] = { default: defaults[key] };
7277
7289
  } else {
7278
7290
  warn(`props default key "${key}" has no corresponding declaration.`);
7279
7291
  }
7292
+ if (opt && defaults[`__skip_${key}`]) {
7293
+ opt.skipFactory = true;
7294
+ }
7280
7295
  }
7281
7296
  return props;
7282
7297
  }
@@ -7549,7 +7564,7 @@ function isMemoSame(cached, memo) {
7549
7564
  return true;
7550
7565
  }
7551
7566
 
7552
- const version = "3.3.0-alpha.5";
7567
+ const version = "3.3.0-alpha.7";
7553
7568
  const _ssrUtils = {
7554
7569
  createComponentInstance,
7555
7570
  setupComponent,
@@ -7586,6 +7601,7 @@ exports.stop = reactivity.stop;
7586
7601
  exports.toRaw = reactivity.toRaw;
7587
7602
  exports.toRef = reactivity.toRef;
7588
7603
  exports.toRefs = reactivity.toRefs;
7604
+ exports.toValue = reactivity.toValue;
7589
7605
  exports.triggerRef = reactivity.triggerRef;
7590
7606
  exports.unref = reactivity.unref;
7591
7607
  exports.camelize = shared.camelize;
@@ -7625,7 +7641,9 @@ exports.defineAsyncComponent = defineAsyncComponent;
7625
7641
  exports.defineComponent = defineComponent;
7626
7642
  exports.defineEmits = defineEmits;
7627
7643
  exports.defineExpose = defineExpose;
7644
+ exports.defineOptions = defineOptions;
7628
7645
  exports.defineProps = defineProps;
7646
+ exports.defineSlots = defineSlots;
7629
7647
  exports.getCurrentInstance = getCurrentInstance;
7630
7648
  exports.getTransitionRawChildren = getTransitionRawChildren;
7631
7649
  exports.guardReactiveProps = guardReactiveProps;
@@ -1631,8 +1631,8 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
1631
1631
  return ret;
1632
1632
  }
1633
1633
 
1634
- function defineComponent(options) {
1635
- return shared.isFunction(options) ? { setup: options, name: options.name } : options;
1634
+ function defineComponent(options, extraOptions) {
1635
+ return shared.isFunction(options) ? shared.extend({}, extraOptions, { setup: options, name: options.name }) : options;
1636
1636
  }
1637
1637
 
1638
1638
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -2883,7 +2883,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
2883
2883
  const hasDefault = shared.hasOwn(opt, "default");
2884
2884
  if (hasDefault && value === void 0) {
2885
2885
  const defaultValue = opt.default;
2886
- if (opt.type !== Function && shared.isFunction(defaultValue)) {
2886
+ if (opt.type !== Function && !opt.skipFactory && shared.isFunction(defaultValue)) {
2887
2887
  const { propsDefaults } = instance;
2888
2888
  if (key in propsDefaults) {
2889
2889
  value = propsDefaults[key];
@@ -5807,6 +5807,10 @@ function defineEmits() {
5807
5807
  }
5808
5808
  function defineExpose(exposed) {
5809
5809
  }
5810
+ function defineOptions(options) {
5811
+ }
5812
+ function defineSlots() {
5813
+ }
5810
5814
  function withDefaults(props, defaults) {
5811
5815
  return null;
5812
5816
  }
@@ -5826,16 +5830,21 @@ function mergeDefaults(raw, defaults) {
5826
5830
  {}
5827
5831
  ) : raw;
5828
5832
  for (const key in defaults) {
5829
- const opt = props[key];
5833
+ if (key.startsWith("__skip"))
5834
+ continue;
5835
+ let opt = props[key];
5830
5836
  if (opt) {
5831
5837
  if (shared.isArray(opt) || shared.isFunction(opt)) {
5832
- props[key] = { type: opt, default: defaults[key] };
5838
+ opt = props[key] = { type: opt, default: defaults[key] };
5833
5839
  } else {
5834
5840
  opt.default = defaults[key];
5835
5841
  }
5836
5842
  } else if (opt === null) {
5837
- props[key] = { default: defaults[key] };
5843
+ opt = props[key] = { default: defaults[key] };
5838
5844
  } else ;
5845
+ if (opt && defaults[`__skip_${key}`]) {
5846
+ opt.skipFactory = true;
5847
+ }
5839
5848
  }
5840
5849
  return props;
5841
5850
  }
@@ -5924,7 +5933,7 @@ function isMemoSame(cached, memo) {
5924
5933
  return true;
5925
5934
  }
5926
5935
 
5927
- const version = "3.3.0-alpha.5";
5936
+ const version = "3.3.0-alpha.7";
5928
5937
  const _ssrUtils = {
5929
5938
  createComponentInstance,
5930
5939
  setupComponent,
@@ -5961,6 +5970,7 @@ exports.stop = reactivity.stop;
5961
5970
  exports.toRaw = reactivity.toRaw;
5962
5971
  exports.toRef = reactivity.toRef;
5963
5972
  exports.toRefs = reactivity.toRefs;
5973
+ exports.toValue = reactivity.toValue;
5964
5974
  exports.triggerRef = reactivity.triggerRef;
5965
5975
  exports.unref = reactivity.unref;
5966
5976
  exports.camelize = shared.camelize;
@@ -6000,7 +6010,9 @@ exports.defineAsyncComponent = defineAsyncComponent;
6000
6010
  exports.defineComponent = defineComponent;
6001
6011
  exports.defineEmits = defineEmits;
6002
6012
  exports.defineExpose = defineExpose;
6013
+ exports.defineOptions = defineOptions;
6003
6014
  exports.defineProps = defineProps;
6015
+ exports.defineSlots = defineSlots;
6004
6016
  exports.getCurrentInstance = getCurrentInstance;
6005
6017
  exports.getTransitionRawChildren = getTransitionRawChildren;
6006
6018
  exports.guardReactiveProps = guardReactiveProps;