@vue/compat 3.4.22 → 3.4.24

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.4.22
2
+ * @vue/compat v3.4.24
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -7,7 +7,7 @@
7
7
  // @__NO_SIDE_EFFECTS__
8
8
  function makeMap(str, expectsLowerCase) {
9
9
  const set = new Set(str.split(","));
10
- return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
10
+ return (val) => set.has(val);
11
11
  }
12
12
 
13
13
  const EMPTY_OBJ = Object.freeze({}) ;
@@ -2470,11 +2470,6 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
2470
2470
  warnedInvalidKeys[key] = true;
2471
2471
  }
2472
2472
  }
2473
- if (instance && config["OPTIONS_DATA_MERGE"] != null) {
2474
- warn$1(
2475
- `Deprecation config "${"OPTIONS_DATA_MERGE"}" can only be configured globally.`
2476
- );
2477
- }
2478
2473
  }
2479
2474
  function getCompatConfigForKey(key, instance) {
2480
2475
  const instanceConfig = instance && instance.type.compatConfig;
@@ -2857,21 +2852,21 @@ function renderComponentRoot(instance) {
2857
2852
  vnode,
2858
2853
  proxy,
2859
2854
  withProxy,
2860
- props,
2861
2855
  propsOptions: [propsOptions],
2862
2856
  slots,
2863
2857
  attrs,
2864
2858
  emit,
2865
2859
  render,
2866
2860
  renderCache,
2861
+ props,
2867
2862
  data,
2868
2863
  setupState,
2869
2864
  ctx,
2870
2865
  inheritAttrs
2871
2866
  } = instance;
2867
+ const prev = setCurrentRenderingInstance(instance);
2872
2868
  let result;
2873
2869
  let fallthroughAttrs;
2874
- const prev = setCurrentRenderingInstance(instance);
2875
2870
  {
2876
2871
  accessedAttrs = false;
2877
2872
  }
@@ -2893,7 +2888,7 @@ function renderComponentRoot(instance) {
2893
2888
  thisProxy,
2894
2889
  proxyToUse,
2895
2890
  renderCache,
2896
- props,
2891
+ true ? shallowReadonly(props) : props,
2897
2892
  setupState,
2898
2893
  data,
2899
2894
  ctx
@@ -2907,7 +2902,7 @@ function renderComponentRoot(instance) {
2907
2902
  }
2908
2903
  result = normalizeVNode(
2909
2904
  render2.length > 1 ? render2(
2910
- props,
2905
+ true ? shallowReadonly(props) : props,
2911
2906
  true ? {
2912
2907
  get attrs() {
2913
2908
  markAttrsAccessed();
@@ -2917,9 +2912,8 @@ function renderComponentRoot(instance) {
2917
2912
  emit
2918
2913
  } : { attrs, slots, emit }
2919
2914
  ) : render2(
2920
- props,
2915
+ true ? shallowReadonly(props) : props,
2921
2916
  null
2922
- /* we know it doesn't need it */
2923
2917
  )
2924
2918
  );
2925
2919
  fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs);
@@ -4460,11 +4454,19 @@ function emptyPlaceholder(vnode) {
4460
4454
  }
4461
4455
  }
4462
4456
  function getKeepAliveChild(vnode) {
4463
- return isKeepAlive(vnode) ? (
4464
- // #7121 ensure get the child component subtree in case
4465
- // it's been replaced during HMR
4466
- vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0
4467
- ) : vnode;
4457
+ if (!isKeepAlive(vnode)) {
4458
+ return vnode;
4459
+ }
4460
+ if (vnode.component) {
4461
+ return vnode.component.subTree;
4462
+ }
4463
+ const { shapeFlag, children } = vnode;
4464
+ if (shapeFlag & 16) {
4465
+ return children[0];
4466
+ }
4467
+ if (shapeFlag & 32 && isFunction(children.default)) {
4468
+ return children.default();
4469
+ }
4468
4470
  }
4469
4471
  function setTransitionHooks(vnode, hooks) {
4470
4472
  if (vnode.shapeFlag & 6 && vnode.component) {
@@ -5664,7 +5666,7 @@ const PublicInstanceProxyHandlers = {
5664
5666
  let cssModule, globalProperties;
5665
5667
  if (publicGetter) {
5666
5668
  if (key === "$attrs") {
5667
- track(instance, "get", key);
5669
+ track(instance.attrs, "get", "");
5668
5670
  markAttrsAccessed();
5669
5671
  } else if (key === "$slots") {
5670
5672
  track(instance, "get", key);
@@ -6476,7 +6478,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6476
6478
  return vm;
6477
6479
  }
6478
6480
  }
6479
- Vue.version = `2.6.14-compat:${"3.4.22"}`;
6481
+ Vue.version = `2.6.14-compat:${"3.4.24"}`;
6480
6482
  Vue.config = singletonApp.config;
6481
6483
  Vue.use = (p, ...options) => {
6482
6484
  if (p && isFunction(p.install)) {
@@ -7113,10 +7115,13 @@ function shouldSkipAttr(key, instance) {
7113
7115
  return false;
7114
7116
  }
7115
7117
 
7116
- const attrsProto = {};
7118
+ const internalObjectProto = /* @__PURE__ */ Object.create(null);
7119
+ const createInternalObject = () => Object.create(internalObjectProto);
7120
+ const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
7121
+
7117
7122
  function initProps(instance, rawProps, isStateful, isSSR = false) {
7118
7123
  const props = {};
7119
- const attrs = Object.create(attrsProto);
7124
+ const attrs = createInternalObject();
7120
7125
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
7121
7126
  setFullProps(instance, rawProps, props, attrs);
7122
7127
  for (const key in instance.propsOptions[0]) {
@@ -7592,23 +7597,17 @@ const normalizeVNodeSlots = (instance, children) => {
7592
7597
  instance.slots.default = () => normalized;
7593
7598
  };
7594
7599
  const initSlots = (instance, children) => {
7600
+ const slots = instance.slots = createInternalObject();
7595
7601
  if (instance.vnode.shapeFlag & 32) {
7596
7602
  const type = children._;
7597
7603
  if (type) {
7598
- instance.slots = toRaw(children);
7599
- def(instance.slots, "_", type);
7604
+ extend(slots, children);
7605
+ def(slots, "_", type);
7600
7606
  } else {
7601
- normalizeObjectSlots(
7602
- children,
7603
- instance.slots = {},
7604
- instance
7605
- );
7606
- }
7607
- } else {
7608
- instance.slots = {};
7609
- if (children) {
7610
- normalizeVNodeSlots(instance, children);
7607
+ normalizeObjectSlots(children, slots, instance);
7611
7608
  }
7609
+ } else if (children) {
7610
+ normalizeVNodeSlots(instance, children);
7612
7611
  }
7613
7612
  };
7614
7613
  const updateSlots = (instance, children, optimized) => {
@@ -10440,7 +10439,7 @@ Component that was made reactive: `,
10440
10439
  function guardReactiveProps(props) {
10441
10440
  if (!props)
10442
10441
  return null;
10443
- return isProxy(props) || Object.getPrototypeOf(props) === attrsProto ? extend({}, props) : props;
10442
+ return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
10444
10443
  }
10445
10444
  function cloneVNode(vnode, extraProps, mergeRef = false) {
10446
10445
  const { props, ref, patchFlag, children } = vnode;
@@ -10548,7 +10547,7 @@ function normalizeChildren(vnode, children) {
10548
10547
  } else {
10549
10548
  type = 32;
10550
10549
  const slotFlag = children._;
10551
- if (!slotFlag) {
10550
+ if (!slotFlag && !isInternalObject(children)) {
10552
10551
  children._ctx = currentRenderingInstance;
10553
10552
  } else if (slotFlag === 3 && currentRenderingInstance) {
10554
10553
  if (currentRenderingInstance.slots._ === 1) {
@@ -11309,7 +11308,7 @@ function isMemoSame(cached, memo) {
11309
11308
  return true;
11310
11309
  }
11311
11310
 
11312
- const version = "3.4.22";
11311
+ const version = "3.4.24";
11313
11312
  const warn = warn$1 ;
11314
11313
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11315
11314
  const devtools = devtools$1 ;
@@ -11546,8 +11545,8 @@ function resolveTransitionProps(rawProps) {
11546
11545
  if (legacyClassEnabled && legacyLeaveFromClass) {
11547
11546
  addTransitionClass(el, legacyLeaveFromClass);
11548
11547
  }
11549
- forceReflow();
11550
11548
  addTransitionClass(el, leaveActiveClass);
11549
+ forceReflow();
11551
11550
  nextFrame(() => {
11552
11551
  if (!el._isLeaving) {
11553
11552
  return;
@@ -13235,8 +13234,7 @@ Vue.compile = () => {
13235
13234
  );
13236
13235
  }
13237
13236
  };
13238
- var Vue$1 = Vue;
13239
13237
 
13240
- const { configureCompat } = Vue$1;
13238
+ const { configureCompat } = Vue;
13241
13239
 
13242
- export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, 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, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
13240
+ export { BaseTransition, BaseTransitionPropsValidators, Comment, DeprecationTypes, EffectScope, ErrorCodes, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, TrackOpTypes, Transition, TransitionGroup, TriggerOpTypes, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, 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, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };