vue 3.3.0-alpha.5 → 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.
package/dist/vue.d.ts CHANGED
@@ -2,6 +2,10 @@ import { CompilerOptions } from '@vue/compiler-dom';
2
2
  import { RenderFunction } from '@vue/runtime-dom';
3
3
  export * from '@vue/runtime-dom';
4
4
 
5
- declare function compileToFunction(template: string | HTMLElement, options?: CompilerOptions): RenderFunction;
5
+ export declare function compileToFunction(template: string | HTMLElement, options?: CompilerOptions): RenderFunction;
6
6
 
7
7
  export { compileToFunction as compile };
8
+ // this is appended to the end of ../dist/vue.d.ts during build.
9
+ // imports the global JSX namespace registration for compat.
10
+ // TODO: remove in 3.4
11
+ import '../jsx'
@@ -3614,8 +3614,8 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3614
3614
  return ret;
3615
3615
  }
3616
3616
 
3617
- function defineComponent(options) {
3618
- return isFunction(options) ? { setup: options, name: options.name } : options;
3617
+ function defineComponent(options, extraOptions) {
3618
+ return isFunction(options) ? extend({}, extraOptions, { setup: options, name: options.name }) : options;
3619
3619
  }
3620
3620
 
3621
3621
  const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -5112,7 +5112,7 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
5112
5112
  const hasDefault = hasOwn(opt, "default");
5113
5113
  if (hasDefault && value === void 0) {
5114
5114
  const defaultValue = opt.default;
5115
- if (opt.type !== Function && isFunction(defaultValue)) {
5115
+ if (opt.type !== Function && !opt.skipFactory && isFunction(defaultValue)) {
5116
5116
  const { propsDefaults } = instance;
5117
5117
  if (key in propsDefaults) {
5118
5118
  value = propsDefaults[key];
@@ -5248,7 +5248,7 @@ function validateProps(rawProps, props, instance) {
5248
5248
  }
5249
5249
  }
5250
5250
  function validateProp(name, value, prop, isAbsent) {
5251
- const { type, required, validator } = prop;
5251
+ const { type, required, validator, skipCheck } = prop;
5252
5252
  if (required && isAbsent) {
5253
5253
  warn('Missing required prop: "' + name + '"');
5254
5254
  return;
@@ -5256,7 +5256,7 @@ function validateProp(name, value, prop, isAbsent) {
5256
5256
  if (value == null && !prop.required) {
5257
5257
  return;
5258
5258
  }
5259
- if (type != null && type !== true) {
5259
+ if (type != null && type !== true && !skipCheck) {
5260
5260
  let isValid = false;
5261
5261
  const types = isArray(type) ? type : [type];
5262
5262
  const expectedTypes = [];
@@ -8645,6 +8645,11 @@ function defineExpose(exposed) {
8645
8645
  warnRuntimeUsage(`defineExpose`);
8646
8646
  }
8647
8647
  }
8648
+ function defineOptions(options) {
8649
+ {
8650
+ warnRuntimeUsage(`defineOptions`);
8651
+ }
8652
+ }
8648
8653
  function withDefaults(props, defaults) {
8649
8654
  {
8650
8655
  warnRuntimeUsage(`withDefaults`);
@@ -8670,18 +8675,23 @@ function mergeDefaults(raw, defaults) {
8670
8675
  {}
8671
8676
  ) : raw;
8672
8677
  for (const key in defaults) {
8673
- const opt = props[key];
8678
+ if (key.startsWith("__skip"))
8679
+ continue;
8680
+ let opt = props[key];
8674
8681
  if (opt) {
8675
8682
  if (isArray(opt) || isFunction(opt)) {
8676
- props[key] = { type: opt, default: defaults[key] };
8683
+ opt = props[key] = { type: opt, default: defaults[key] };
8677
8684
  } else {
8678
8685
  opt.default = defaults[key];
8679
8686
  }
8680
8687
  } else if (opt === null) {
8681
- props[key] = { default: defaults[key] };
8688
+ opt = props[key] = { default: defaults[key] };
8682
8689
  } else {
8683
8690
  warn(`props default key "${key}" has no corresponding declaration.`);
8684
8691
  }
8692
+ if (opt && defaults[`__skip_${key}`]) {
8693
+ opt.skipFactory = true;
8694
+ }
8685
8695
  }
8686
8696
  return props;
8687
8697
  }
@@ -8950,7 +8960,7 @@ function isMemoSame(cached, memo) {
8950
8960
  return true;
8951
8961
  }
8952
8962
 
8953
- const version = "3.3.0-alpha.5";
8963
+ const version = "3.3.0-alpha.6";
8954
8964
  const ssrUtils = null;
8955
8965
  const resolveFilter = null;
8956
8966
  const compatUtils = null;
@@ -10462,6 +10472,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
10462
10472
  defineCustomElement: defineCustomElement,
10463
10473
  defineEmits: defineEmits,
10464
10474
  defineExpose: defineExpose,
10475
+ defineOptions: defineOptions,
10465
10476
  defineProps: defineProps,
10466
10477
  defineSSRCustomElement: defineSSRCustomElement,
10467
10478
  get devtools () { return devtools; },
@@ -15205,4 +15216,4 @@ ${codeFrame}` : message);
15205
15216
  }
15206
15217
  registerRuntimeCompiler(compileToFunction);
15207
15218
 
15208
- export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
15219
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, compileToFunction as compile, computed, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineOptions, defineProps, defineSSRCustomElement, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };