@vue/runtime-core 3.4.6 → 3.4.8

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,3 +1,8 @@
1
+ /**
2
+ * @vue/runtime-core v3.4.8
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/
1
6
  'use strict';
2
7
 
3
8
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1096,8 +1101,6 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
1096
1101
  return false;
1097
1102
  }
1098
1103
  function updateHOCHostEl({ vnode, parent }, el) {
1099
- if (!el)
1100
- return;
1101
1104
  while (parent) {
1102
1105
  const root = parent.subTree;
1103
1106
  if (root.suspense && root.suspense.activeBranch === vnode) {
@@ -1738,7 +1741,12 @@ function queueEffectWithSuspense(fn, suspense) {
1738
1741
  function setActiveBranch(suspense, branch) {
1739
1742
  suspense.activeBranch = branch;
1740
1743
  const { vnode, parentComponent } = suspense;
1741
- const el = vnode.el = branch.el;
1744
+ let el = branch.el;
1745
+ while (!el && branch.component) {
1746
+ branch = branch.component.subTree;
1747
+ el = branch.el;
1748
+ }
1749
+ vnode.el = el;
1742
1750
  if (parentComponent && parentComponent.subTree === vnode) {
1743
1751
  parentComponent.vnode.el = el;
1744
1752
  updateHOCHostEl(parentComponent, el);
@@ -1985,14 +1993,9 @@ function instanceWatch(source, value, options) {
1985
1993
  cb = value.handler;
1986
1994
  options = value;
1987
1995
  }
1988
- const cur = currentInstance;
1989
- setCurrentInstance(this);
1996
+ const reset = setCurrentInstance(this);
1990
1997
  const res = doWatch(getter, cb.bind(publicThis), options);
1991
- if (cur) {
1992
- setCurrentInstance(cur);
1993
- } else {
1994
- unsetCurrentInstance();
1995
- }
1998
+ reset();
1996
1999
  return res;
1997
2000
  }
1998
2001
  function createPathGetter(ctx, path) {
@@ -2044,12 +2047,11 @@ function validateDirectiveName(name) {
2044
2047
  }
2045
2048
  }
2046
2049
  function withDirectives(vnode, directives) {
2047
- const internalInstance = currentRenderingInstance;
2048
- if (internalInstance === null) {
2050
+ if (currentRenderingInstance === null) {
2049
2051
  warn$1(`withDirectives can only be used inside render functions.`);
2050
2052
  return vnode;
2051
2053
  }
2052
- const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
2054
+ const instance = getExposeProxy(currentRenderingInstance) || currentRenderingInstance.proxy;
2053
2055
  const bindings = vnode.dirs || (vnode.dirs = []);
2054
2056
  for (let i = 0; i < directives.length; i++) {
2055
2057
  let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i];
@@ -2835,9 +2837,9 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
2835
2837
  return;
2836
2838
  }
2837
2839
  reactivity.pauseTracking();
2838
- setCurrentInstance(target);
2840
+ const reset = setCurrentInstance(target);
2839
2841
  const res = callWithAsyncErrorHandling(hook, target, type, args);
2840
- unsetCurrentInstance();
2842
+ reset();
2841
2843
  reactivity.resetTracking();
2842
2844
  return res;
2843
2845
  });
@@ -4222,12 +4224,12 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
4222
4224
  if (key in propsDefaults) {
4223
4225
  value = propsDefaults[key];
4224
4226
  } else {
4225
- setCurrentInstance(instance);
4227
+ const reset = setCurrentInstance(instance);
4226
4228
  value = propsDefaults[key] = defaultValue.call(
4227
4229
  null,
4228
4230
  props
4229
4231
  );
4230
- unsetCurrentInstance();
4232
+ reset();
4231
4233
  }
4232
4234
  } else {
4233
4235
  value = defaultValue;
@@ -5103,29 +5105,34 @@ function propHasMismatch(el, key, clientValue, vnode) {
5103
5105
  let actual;
5104
5106
  let expected;
5105
5107
  if (key === "class") {
5106
- actual = toClassSet(el.getAttribute("class") || "");
5107
- expected = toClassSet(shared.normalizeClass(clientValue));
5108
- if (!isSetEqual(actual, expected)) {
5108
+ actual = el.getAttribute("class");
5109
+ expected = shared.normalizeClass(clientValue);
5110
+ if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
5109
5111
  mismatchType = mismatchKey = `class`;
5110
5112
  }
5111
5113
  } else if (key === "style") {
5112
- actual = toStyleMap(el.getAttribute("style") || "");
5113
- expected = toStyleMap(
5114
- shared.isString(clientValue) ? clientValue : shared.stringifyStyle(shared.normalizeStyle(clientValue))
5115
- );
5114
+ actual = el.getAttribute("style");
5115
+ expected = shared.isString(clientValue) ? clientValue : shared.stringifyStyle(shared.normalizeStyle(clientValue));
5116
+ const actualMap = toStyleMap(actual);
5117
+ const expectedMap = toStyleMap(expected);
5116
5118
  if (vnode.dirs) {
5117
5119
  for (const { dir, value } of vnode.dirs) {
5118
5120
  if (dir.name === "show" && !value) {
5119
- expected.set("display", "none");
5121
+ expectedMap.set("display", "none");
5120
5122
  }
5121
5123
  }
5122
5124
  }
5123
- if (!isMapEqual(actual, expected)) {
5125
+ if (!isMapEqual(actualMap, expectedMap)) {
5124
5126
  mismatchType = mismatchKey = "style";
5125
5127
  }
5126
5128
  } else if (el instanceof SVGElement && shared.isKnownSvgAttr(key) || el instanceof HTMLElement && (shared.isBooleanAttr(key) || shared.isKnownHtmlAttr(key))) {
5127
- actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
5128
- expected = shared.isBooleanAttr(key) ? shared.includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? "" : String(clientValue);
5129
+ if (shared.isBooleanAttr(key)) {
5130
+ actual = el.hasAttribute(key);
5131
+ expected = shared.includeBooleanAttr(clientValue);
5132
+ } else {
5133
+ actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
5134
+ expected = clientValue == null ? "" : String(clientValue);
5135
+ }
5129
5136
  if (actual !== expected) {
5130
5137
  mismatchType = `attribute`;
5131
5138
  mismatchKey = key;
@@ -7474,14 +7481,7 @@ function createComponentInstance(vnode, parent, suspense) {
7474
7481
  return instance;
7475
7482
  }
7476
7483
  let currentInstance = null;
7477
- const getCurrentInstance = () => {
7478
- if (isInComputedGetter) {
7479
- warn$1(
7480
- `getCurrentInstance() called inside a computed getter. This is incorrect usage as computed getters are not guaranteed to be executed with an active component instance. If you are using a composable inside a computed getter, move it ouside to the setup scope.`
7481
- );
7482
- }
7483
- return currentInstance || currentRenderingInstance;
7484
- };
7484
+ const getCurrentInstance = () => currentInstance || currentRenderingInstance;
7485
7485
  let internalSetCurrentInstance;
7486
7486
  let setInSSRSetupState;
7487
7487
  {
@@ -7508,8 +7508,13 @@ let setInSSRSetupState;
7508
7508
  );
7509
7509
  }
7510
7510
  const setCurrentInstance = (instance) => {
7511
+ const prev = currentInstance;
7511
7512
  internalSetCurrentInstance(instance);
7512
7513
  instance.scope.on();
7514
+ return () => {
7515
+ instance.scope.off();
7516
+ internalSetCurrentInstance(prev);
7517
+ };
7513
7518
  };
7514
7519
  const unsetCurrentInstance = () => {
7515
7520
  currentInstance && currentInstance.scope.off();
@@ -7571,7 +7576,7 @@ function setupStatefulComponent(instance, isSSR) {
7571
7576
  const { setup } = Component;
7572
7577
  if (setup) {
7573
7578
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
7574
- setCurrentInstance(instance);
7579
+ const reset = setCurrentInstance(instance);
7575
7580
  reactivity.pauseTracking();
7576
7581
  const setupResult = callWithErrorHandling(
7577
7582
  setup,
@@ -7583,7 +7588,7 @@ function setupStatefulComponent(instance, isSSR) {
7583
7588
  ]
7584
7589
  );
7585
7590
  reactivity.resetTracking();
7586
- unsetCurrentInstance();
7591
+ reset();
7587
7592
  if (shared.isPromise(setupResult)) {
7588
7593
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
7589
7594
  if (isSSR) {
@@ -7679,13 +7684,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
7679
7684
  }
7680
7685
  }
7681
7686
  {
7682
- setCurrentInstance(instance);
7687
+ const reset = setCurrentInstance(instance);
7683
7688
  reactivity.pauseTracking();
7684
7689
  try {
7685
7690
  applyOptions(instance);
7686
7691
  } finally {
7687
7692
  reactivity.resetTracking();
7688
- unsetCurrentInstance();
7693
+ reset();
7689
7694
  }
7690
7695
  }
7691
7696
  if (!Component.render && instance.render === shared.NOOP && !isSSR) {
@@ -7812,25 +7817,7 @@ function isClassComponent(value) {
7812
7817
  return shared.isFunction(value) && "__vccOpts" in value;
7813
7818
  }
7814
7819
 
7815
- let isInComputedGetter = false;
7816
- function wrapComputedGetter(getter) {
7817
- return () => {
7818
- isInComputedGetter = true;
7819
- try {
7820
- return getter();
7821
- } finally {
7822
- isInComputedGetter = false;
7823
- }
7824
- };
7825
- }
7826
7820
  const computed = (getterOrOptions, debugOptions) => {
7827
- {
7828
- if (shared.isFunction(getterOrOptions)) {
7829
- getterOrOptions = wrapComputedGetter(getterOrOptions);
7830
- } else {
7831
- getterOrOptions.get = wrapComputedGetter(getterOrOptions.get);
7832
- }
7833
- }
7834
7821
  return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
7835
7822
  };
7836
7823
 
@@ -8060,7 +8047,7 @@ function isMemoSame(cached, memo) {
8060
8047
  return true;
8061
8048
  }
8062
8049
 
8063
- const version = "3.4.6";
8050
+ const version = "3.4.8";
8064
8051
  const warn = warn$1 ;
8065
8052
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8066
8053
  const devtools = devtools$1 ;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @vue/runtime-core v3.4.8
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/
1
6
  'use strict';
2
7
 
3
8
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -604,8 +609,6 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
604
609
  return false;
605
610
  }
606
611
  function updateHOCHostEl({ vnode, parent }, el) {
607
- if (!el)
608
- return;
609
612
  while (parent) {
610
613
  const root = parent.subTree;
611
614
  if (root.suspense && root.suspense.activeBranch === vnode) {
@@ -1206,7 +1209,12 @@ function queueEffectWithSuspense(fn, suspense) {
1206
1209
  function setActiveBranch(suspense, branch) {
1207
1210
  suspense.activeBranch = branch;
1208
1211
  const { vnode, parentComponent } = suspense;
1209
- const el = vnode.el = branch.el;
1212
+ let el = branch.el;
1213
+ while (!el && branch.component) {
1214
+ branch = branch.component.subTree;
1215
+ el = branch.el;
1216
+ }
1217
+ vnode.el = el;
1210
1218
  if (parentComponent && parentComponent.subTree === vnode) {
1211
1219
  parentComponent.vnode.el = el;
1212
1220
  updateHOCHostEl(parentComponent, el);
@@ -1407,14 +1415,9 @@ function instanceWatch(source, value, options) {
1407
1415
  cb = value.handler;
1408
1416
  options = value;
1409
1417
  }
1410
- const cur = currentInstance;
1411
- setCurrentInstance(this);
1418
+ const reset = setCurrentInstance(this);
1412
1419
  const res = doWatch(getter, cb.bind(publicThis), options);
1413
- if (cur) {
1414
- setCurrentInstance(cur);
1415
- } else {
1416
- unsetCurrentInstance();
1417
- }
1420
+ reset();
1418
1421
  return res;
1419
1422
  }
1420
1423
  function createPathGetter(ctx, path) {
@@ -1461,11 +1464,10 @@ function traverse(value, depth, currentDepth = 0, seen) {
1461
1464
  }
1462
1465
 
1463
1466
  function withDirectives(vnode, directives) {
1464
- const internalInstance = currentRenderingInstance;
1465
- if (internalInstance === null) {
1467
+ if (currentRenderingInstance === null) {
1466
1468
  return vnode;
1467
1469
  }
1468
- const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
1470
+ const instance = getExposeProxy(currentRenderingInstance) || currentRenderingInstance.proxy;
1469
1471
  const bindings = vnode.dirs || (vnode.dirs = []);
1470
1472
  for (let i = 0; i < directives.length; i++) {
1471
1473
  let [dir, value, arg, modifiers = shared.EMPTY_OBJ] = directives[i];
@@ -2221,9 +2223,9 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
2221
2223
  return;
2222
2224
  }
2223
2225
  reactivity.pauseTracking();
2224
- setCurrentInstance(target);
2226
+ const reset = setCurrentInstance(target);
2225
2227
  const res = callWithAsyncErrorHandling(hook, target, type, args);
2226
- unsetCurrentInstance();
2228
+ reset();
2227
2229
  reactivity.resetTracking();
2228
2230
  return res;
2229
2231
  });
@@ -3281,12 +3283,12 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
3281
3283
  if (key in propsDefaults) {
3282
3284
  value = propsDefaults[key];
3283
3285
  } else {
3284
- setCurrentInstance(instance);
3286
+ const reset = setCurrentInstance(instance);
3285
3287
  value = propsDefaults[key] = defaultValue.call(
3286
3288
  null,
3287
3289
  props
3288
3290
  );
3289
- unsetCurrentInstance();
3291
+ reset();
3290
3292
  }
3291
3293
  } else {
3292
3294
  value = defaultValue;
@@ -6015,9 +6017,7 @@ function createComponentInstance(vnode, parent, suspense) {
6015
6017
  return instance;
6016
6018
  }
6017
6019
  let currentInstance = null;
6018
- const getCurrentInstance = () => {
6019
- return currentInstance || currentRenderingInstance;
6020
- };
6020
+ const getCurrentInstance = () => currentInstance || currentRenderingInstance;
6021
6021
  let internalSetCurrentInstance;
6022
6022
  let setInSSRSetupState;
6023
6023
  {
@@ -6044,8 +6044,13 @@ let setInSSRSetupState;
6044
6044
  );
6045
6045
  }
6046
6046
  const setCurrentInstance = (instance) => {
6047
+ const prev = currentInstance;
6047
6048
  internalSetCurrentInstance(instance);
6048
6049
  instance.scope.on();
6050
+ return () => {
6051
+ instance.scope.off();
6052
+ internalSetCurrentInstance(prev);
6053
+ };
6049
6054
  };
6050
6055
  const unsetCurrentInstance = () => {
6051
6056
  currentInstance && currentInstance.scope.off();
@@ -6072,7 +6077,7 @@ function setupStatefulComponent(instance, isSSR) {
6072
6077
  const { setup } = Component;
6073
6078
  if (setup) {
6074
6079
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
6075
- setCurrentInstance(instance);
6080
+ const reset = setCurrentInstance(instance);
6076
6081
  reactivity.pauseTracking();
6077
6082
  const setupResult = callWithErrorHandling(
6078
6083
  setup,
@@ -6084,7 +6089,7 @@ function setupStatefulComponent(instance, isSSR) {
6084
6089
  ]
6085
6090
  );
6086
6091
  reactivity.resetTracking();
6087
- unsetCurrentInstance();
6092
+ reset();
6088
6093
  if (shared.isPromise(setupResult)) {
6089
6094
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
6090
6095
  if (isSSR) {
@@ -6153,13 +6158,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
6153
6158
  }
6154
6159
  }
6155
6160
  {
6156
- setCurrentInstance(instance);
6161
+ const reset = setCurrentInstance(instance);
6157
6162
  reactivity.pauseTracking();
6158
6163
  try {
6159
6164
  applyOptions(instance);
6160
6165
  } finally {
6161
6166
  reactivity.resetTracking();
6162
- unsetCurrentInstance();
6167
+ reset();
6163
6168
  }
6164
6169
  }
6165
6170
  }
@@ -6268,7 +6273,7 @@ function isMemoSame(cached, memo) {
6268
6273
  return true;
6269
6274
  }
6270
6275
 
6271
- const version = "3.4.6";
6276
+ const version = "3.4.8";
6272
6277
  const warn$1 = shared.NOOP;
6273
6278
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6274
6279
  const devtools = void 0;
@@ -1395,7 +1395,7 @@ export declare function h(type: typeof Fragment, props?: RawProps | null, childr
1395
1395
  export declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren | RawSlots): VNode;
1396
1396
  export declare function h(type: typeof Suspense, children?: RawChildren): VNode;
1397
1397
  export declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): VNode;
1398
- export declare function h<P, E extends EmitsOptions = {}, S extends Record<string, any> = {}>(type: FunctionalComponent<P, E, S>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
1398
+ export declare function h<P, E extends EmitsOptions = {}, S extends Record<string, any> = any>(type: FunctionalComponent<P, any, S, any>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | IfAny<S, RawSlots, S>): VNode;
1399
1399
  export declare function h(type: Component, children?: RawChildren): VNode;
1400
1400
  export declare function h<P>(type: ConcreteComponent | string, children?: RawChildren): VNode;
1401
1401
  export declare function h<P>(type: ConcreteComponent<P> | string, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren): VNode;
@@ -1,3 +1,8 @@
1
+ /**
2
+ * @vue/runtime-core v3.4.8
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/
1
6
  import { pauseTracking, resetTracking, isRef, toRaw, isShallow as isShallow$1, isReactive, ReactiveEffect, getCurrentScope, ref, shallowReadonly, track, customRef, reactive, shallowReactive, trigger, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity';
2
7
  export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
3
8
  import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, capitalize, toNumber, hasChanged, remove, isSet, isMap, isPlainObject, isBuiltInDirective, invokeArrayFns, isRegExp, isGloballyAllowed, NO, def, isReservedProp, EMPTY_ARR, toRawType, makeMap, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr } from '@vue/shared';
@@ -1098,8 +1103,6 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
1098
1103
  return false;
1099
1104
  }
1100
1105
  function updateHOCHostEl({ vnode, parent }, el) {
1101
- if (!el)
1102
- return;
1103
1106
  while (parent) {
1104
1107
  const root = parent.subTree;
1105
1108
  if (root.suspense && root.suspense.activeBranch === vnode) {
@@ -1740,7 +1743,12 @@ function queueEffectWithSuspense(fn, suspense) {
1740
1743
  function setActiveBranch(suspense, branch) {
1741
1744
  suspense.activeBranch = branch;
1742
1745
  const { vnode, parentComponent } = suspense;
1743
- const el = vnode.el = branch.el;
1746
+ let el = branch.el;
1747
+ while (!el && branch.component) {
1748
+ branch = branch.component.subTree;
1749
+ el = branch.el;
1750
+ }
1751
+ vnode.el = el;
1744
1752
  if (parentComponent && parentComponent.subTree === vnode) {
1745
1753
  parentComponent.vnode.el = el;
1746
1754
  updateHOCHostEl(parentComponent, el);
@@ -1987,14 +1995,9 @@ function instanceWatch(source, value, options) {
1987
1995
  cb = value.handler;
1988
1996
  options = value;
1989
1997
  }
1990
- const cur = currentInstance;
1991
- setCurrentInstance(this);
1998
+ const reset = setCurrentInstance(this);
1992
1999
  const res = doWatch(getter, cb.bind(publicThis), options);
1993
- if (cur) {
1994
- setCurrentInstance(cur);
1995
- } else {
1996
- unsetCurrentInstance();
1997
- }
2000
+ reset();
1998
2001
  return res;
1999
2002
  }
2000
2003
  function createPathGetter(ctx, path) {
@@ -2046,12 +2049,11 @@ function validateDirectiveName(name) {
2046
2049
  }
2047
2050
  }
2048
2051
  function withDirectives(vnode, directives) {
2049
- const internalInstance = currentRenderingInstance;
2050
- if (internalInstance === null) {
2052
+ if (currentRenderingInstance === null) {
2051
2053
  !!(process.env.NODE_ENV !== "production") && warn$1(`withDirectives can only be used inside render functions.`);
2052
2054
  return vnode;
2053
2055
  }
2054
- const instance = getExposeProxy(internalInstance) || internalInstance.proxy;
2056
+ const instance = getExposeProxy(currentRenderingInstance) || currentRenderingInstance.proxy;
2055
2057
  const bindings = vnode.dirs || (vnode.dirs = []);
2056
2058
  for (let i = 0; i < directives.length; i++) {
2057
2059
  let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
@@ -2839,9 +2841,9 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
2839
2841
  return;
2840
2842
  }
2841
2843
  pauseTracking();
2842
- setCurrentInstance(target);
2844
+ const reset = setCurrentInstance(target);
2843
2845
  const res = callWithAsyncErrorHandling(hook, target, type, args);
2844
- unsetCurrentInstance();
2846
+ reset();
2845
2847
  resetTracking();
2846
2848
  return res;
2847
2849
  });
@@ -4230,12 +4232,12 @@ function resolvePropValue(options, props, key, value, instance, isAbsent) {
4230
4232
  if (key in propsDefaults) {
4231
4233
  value = propsDefaults[key];
4232
4234
  } else {
4233
- setCurrentInstance(instance);
4235
+ const reset = setCurrentInstance(instance);
4234
4236
  value = propsDefaults[key] = defaultValue.call(
4235
4237
  null,
4236
4238
  props
4237
4239
  );
4238
- unsetCurrentInstance();
4240
+ reset();
4239
4241
  }
4240
4242
  } else {
4241
4243
  value = defaultValue;
@@ -5121,29 +5123,34 @@ function propHasMismatch(el, key, clientValue, vnode) {
5121
5123
  let actual;
5122
5124
  let expected;
5123
5125
  if (key === "class") {
5124
- actual = toClassSet(el.getAttribute("class") || "");
5125
- expected = toClassSet(normalizeClass(clientValue));
5126
- if (!isSetEqual(actual, expected)) {
5126
+ actual = el.getAttribute("class");
5127
+ expected = normalizeClass(clientValue);
5128
+ if (!isSetEqual(toClassSet(actual || ""), toClassSet(expected))) {
5127
5129
  mismatchType = mismatchKey = `class`;
5128
5130
  }
5129
5131
  } else if (key === "style") {
5130
- actual = toStyleMap(el.getAttribute("style") || "");
5131
- expected = toStyleMap(
5132
- isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue))
5133
- );
5132
+ actual = el.getAttribute("style");
5133
+ expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
5134
+ const actualMap = toStyleMap(actual);
5135
+ const expectedMap = toStyleMap(expected);
5134
5136
  if (vnode.dirs) {
5135
5137
  for (const { dir, value } of vnode.dirs) {
5136
5138
  if (dir.name === "show" && !value) {
5137
- expected.set("display", "none");
5139
+ expectedMap.set("display", "none");
5138
5140
  }
5139
5141
  }
5140
5142
  }
5141
- if (!isMapEqual(actual, expected)) {
5143
+ if (!isMapEqual(actualMap, expectedMap)) {
5142
5144
  mismatchType = mismatchKey = "style";
5143
5145
  }
5144
5146
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
5145
- actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
5146
- expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? "" : String(clientValue);
5147
+ if (isBooleanAttr(key)) {
5148
+ actual = el.hasAttribute(key);
5149
+ expected = includeBooleanAttr(clientValue);
5150
+ } else {
5151
+ actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
5152
+ expected = clientValue == null ? "" : String(clientValue);
5153
+ }
5147
5154
  if (actual !== expected) {
5148
5155
  mismatchType = `attribute`;
5149
5156
  mismatchKey = key;
@@ -7532,14 +7539,7 @@ function createComponentInstance(vnode, parent, suspense) {
7532
7539
  return instance;
7533
7540
  }
7534
7541
  let currentInstance = null;
7535
- const getCurrentInstance = () => {
7536
- if (!!(process.env.NODE_ENV !== "production") && isInComputedGetter) {
7537
- warn$1(
7538
- `getCurrentInstance() called inside a computed getter. This is incorrect usage as computed getters are not guaranteed to be executed with an active component instance. If you are using a composable inside a computed getter, move it ouside to the setup scope.`
7539
- );
7540
- }
7541
- return currentInstance || currentRenderingInstance;
7542
- };
7542
+ const getCurrentInstance = () => currentInstance || currentRenderingInstance;
7543
7543
  let internalSetCurrentInstance;
7544
7544
  let setInSSRSetupState;
7545
7545
  {
@@ -7566,8 +7566,13 @@ let setInSSRSetupState;
7566
7566
  );
7567
7567
  }
7568
7568
  const setCurrentInstance = (instance) => {
7569
+ const prev = currentInstance;
7569
7570
  internalSetCurrentInstance(instance);
7570
7571
  instance.scope.on();
7572
+ return () => {
7573
+ instance.scope.off();
7574
+ internalSetCurrentInstance(prev);
7575
+ };
7571
7576
  };
7572
7577
  const unsetCurrentInstance = () => {
7573
7578
  currentInstance && currentInstance.scope.off();
@@ -7629,7 +7634,7 @@ function setupStatefulComponent(instance, isSSR) {
7629
7634
  const { setup } = Component;
7630
7635
  if (setup) {
7631
7636
  const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
7632
- setCurrentInstance(instance);
7637
+ const reset = setCurrentInstance(instance);
7633
7638
  pauseTracking();
7634
7639
  const setupResult = callWithErrorHandling(
7635
7640
  setup,
@@ -7641,7 +7646,7 @@ function setupStatefulComponent(instance, isSSR) {
7641
7646
  ]
7642
7647
  );
7643
7648
  resetTracking();
7644
- unsetCurrentInstance();
7649
+ reset();
7645
7650
  if (isPromise(setupResult)) {
7646
7651
  setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
7647
7652
  if (isSSR) {
@@ -7737,13 +7742,13 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
7737
7742
  }
7738
7743
  }
7739
7744
  if (__VUE_OPTIONS_API__ && true) {
7740
- setCurrentInstance(instance);
7745
+ const reset = setCurrentInstance(instance);
7741
7746
  pauseTracking();
7742
7747
  try {
7743
7748
  applyOptions(instance);
7744
7749
  } finally {
7745
7750
  resetTracking();
7746
- unsetCurrentInstance();
7751
+ reset();
7747
7752
  }
7748
7753
  }
7749
7754
  if (!!(process.env.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR) {
@@ -7884,25 +7889,7 @@ function isClassComponent(value) {
7884
7889
  return isFunction(value) && "__vccOpts" in value;
7885
7890
  }
7886
7891
 
7887
- let isInComputedGetter = false;
7888
- function wrapComputedGetter(getter) {
7889
- return () => {
7890
- isInComputedGetter = true;
7891
- try {
7892
- return getter();
7893
- } finally {
7894
- isInComputedGetter = false;
7895
- }
7896
- };
7897
- }
7898
7892
  const computed = (getterOrOptions, debugOptions) => {
7899
- if (!!(process.env.NODE_ENV !== "production")) {
7900
- if (isFunction(getterOrOptions)) {
7901
- getterOrOptions = wrapComputedGetter(getterOrOptions);
7902
- } else {
7903
- getterOrOptions.get = wrapComputedGetter(getterOrOptions.get);
7904
- }
7905
- }
7906
7893
  return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
7907
7894
  };
7908
7895
 
@@ -8132,7 +8119,7 @@ function isMemoSame(cached, memo) {
8132
8119
  return true;
8133
8120
  }
8134
8121
 
8135
- const version = "3.4.6";
8122
+ const version = "3.4.8";
8136
8123
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8137
8124
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8138
8125
  const devtools = !!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__ ? devtools$1 : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/runtime-core",
3
- "version": "3.4.6",
3
+ "version": "3.4.8",
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/reactivity": "3.4.6",
36
- "@vue/shared": "3.4.6"
35
+ "@vue/reactivity": "3.4.8",
36
+ "@vue/shared": "3.4.8"
37
37
  }
38
38
  }