@vue/runtime-core 3.4.4 → 3.4.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.
@@ -343,7 +343,9 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
343
343
  }
344
344
  function flushPostFlushCbs(seen) {
345
345
  if (pendingPostFlushCbs.length) {
346
- const deduped = [...new Set(pendingPostFlushCbs)];
346
+ const deduped = [...new Set(pendingPostFlushCbs)].sort(
347
+ (a, b) => getId(a) - getId(b)
348
+ );
347
349
  pendingPostFlushCbs.length = 0;
348
350
  if (activePostFlushCbs) {
349
351
  activePostFlushCbs.push(...deduped);
@@ -353,7 +355,6 @@ function flushPostFlushCbs(seen) {
353
355
  {
354
356
  seen = seen || /* @__PURE__ */ new Map();
355
357
  }
356
- activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
357
358
  for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
358
359
  if (checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
359
360
  continue;
@@ -1446,6 +1447,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1446
1447
  {
1447
1448
  assertNumber(timeout, `Suspense timeout`);
1448
1449
  }
1450
+ const initialAnchor = anchor;
1449
1451
  const suspense = {
1450
1452
  vnode,
1451
1453
  parent: parentSuspense,
@@ -1453,7 +1455,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1453
1455
  namespace,
1454
1456
  container,
1455
1457
  hiddenContainer,
1456
- anchor,
1457
1458
  deps: 0,
1458
1459
  pendingId: suspenseId++,
1459
1460
  timeout: typeof timeout === "number" ? timeout : -1,
@@ -1496,20 +1497,21 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1496
1497
  move(
1497
1498
  pendingBranch,
1498
1499
  container2,
1499
- next(activeBranch),
1500
+ anchor === initialAnchor ? next(activeBranch) : anchor,
1500
1501
  0
1501
1502
  );
1502
1503
  queuePostFlushCb(effects);
1503
1504
  }
1504
1505
  };
1505
1506
  }
1506
- let { anchor: anchor2 } = suspense;
1507
1507
  if (activeBranch) {
1508
- anchor2 = next(activeBranch);
1508
+ if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
1509
+ anchor = next(activeBranch);
1510
+ }
1509
1511
  unmount(activeBranch, parentComponent2, suspense, true);
1510
1512
  }
1511
1513
  if (!delayEnter) {
1512
- move(pendingBranch, container2, anchor2, 0);
1514
+ move(pendingBranch, container2, anchor, 0);
1513
1515
  }
1514
1516
  }
1515
1517
  setActiveBranch(suspense, pendingBranch);
@@ -1944,10 +1946,11 @@ function doWatch(source, cb, {
1944
1946
  scheduler = () => queueJob(job);
1945
1947
  }
1946
1948
  const effect = new reactivity.ReactiveEffect(getter, shared.NOOP, scheduler);
1949
+ const scope = reactivity.getCurrentScope();
1947
1950
  const unwatch = () => {
1948
1951
  effect.stop();
1949
- if (instance && instance.scope) {
1950
- shared.remove(instance.scope.effects, effect);
1952
+ if (scope) {
1953
+ shared.remove(scope.effects, effect);
1951
1954
  }
1952
1955
  };
1953
1956
  {
@@ -4919,7 +4922,7 @@ Server rendered element contains more child nodes than client vdom.`
4919
4922
  if (props) {
4920
4923
  {
4921
4924
  for (const key in props) {
4922
- if (propHasMismatch(el, key, props[key])) {
4925
+ if (propHasMismatch(el, key, props[key], vnode)) {
4923
4926
  hasMismatch = true;
4924
4927
  }
4925
4928
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -5094,7 +5097,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5094
5097
  };
5095
5098
  return [hydrate, hydrateNode];
5096
5099
  }
5097
- function propHasMismatch(el, key, clientValue) {
5100
+ function propHasMismatch(el, key, clientValue, vnode) {
5098
5101
  let mismatchType;
5099
5102
  let mismatchKey;
5100
5103
  let actual;
@@ -5106,14 +5109,23 @@ function propHasMismatch(el, key, clientValue) {
5106
5109
  mismatchType = mismatchKey = `class`;
5107
5110
  }
5108
5111
  } else if (key === "style") {
5109
- actual = el.getAttribute("style");
5110
- expected = shared.isString(clientValue) ? clientValue : shared.stringifyStyle(shared.normalizeStyle(clientValue));
5111
- if (actual !== expected) {
5112
+ actual = toStyleMap(el.getAttribute("style") || "");
5113
+ expected = toStyleMap(
5114
+ shared.isString(clientValue) ? clientValue : shared.stringifyStyle(shared.normalizeStyle(clientValue))
5115
+ );
5116
+ if (vnode.dirs) {
5117
+ for (const { dir, value } of vnode.dirs) {
5118
+ if (dir.name === "show" && !value) {
5119
+ expected.set("display", "none");
5120
+ }
5121
+ }
5122
+ }
5123
+ if (!isMapEqual(actual, expected)) {
5112
5124
  mismatchType = mismatchKey = "style";
5113
5125
  }
5114
5126
  } else if (el instanceof SVGElement && shared.isKnownSvgAttr(key) || el instanceof HTMLElement && (shared.isBooleanAttr(key) || shared.isKnownHtmlAttr(key))) {
5115
- actual = el.hasAttribute(key) && el.getAttribute(key);
5116
- expected = shared.isBooleanAttr(key) ? shared.includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
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);
5117
5129
  if (actual !== expected) {
5118
5130
  mismatchType = `attribute`;
5119
5131
  mismatchKey = key;
@@ -5148,6 +5160,29 @@ function isSetEqual(a, b) {
5148
5160
  }
5149
5161
  return true;
5150
5162
  }
5163
+ function toStyleMap(str) {
5164
+ const styleMap = /* @__PURE__ */ new Map();
5165
+ for (const item of str.split(";")) {
5166
+ let [key, value] = item.split(":");
5167
+ key = key == null ? void 0 : key.trim();
5168
+ value = value == null ? void 0 : value.trim();
5169
+ if (key && value) {
5170
+ styleMap.set(key, value);
5171
+ }
5172
+ }
5173
+ return styleMap;
5174
+ }
5175
+ function isMapEqual(a, b) {
5176
+ if (a.size !== b.size) {
5177
+ return false;
5178
+ }
5179
+ for (const [key, value] of a) {
5180
+ if (value !== b.get(key)) {
5181
+ return false;
5182
+ }
5183
+ }
5184
+ return true;
5185
+ }
5151
5186
 
5152
5187
  let supported;
5153
5188
  let perf;
@@ -5736,7 +5771,11 @@ function baseCreateRenderer(options, createHydrationFns) {
5736
5771
  hostInsert(fragmentStartAnchor, container, anchor);
5737
5772
  hostInsert(fragmentEndAnchor, container, anchor);
5738
5773
  mountChildren(
5739
- n2.children,
5774
+ // #10007
5775
+ // such fragment like `<></>` will be compiled into
5776
+ // a fragment which doesn't have a children.
5777
+ // In this case fallback to an empty array
5778
+ n2.children || [],
5740
5779
  container,
5741
5780
  fragmentEndAnchor,
5742
5781
  parentComponent,
@@ -6570,6 +6609,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6570
6609
  }
6571
6610
  return hostNextSibling(vnode.anchor || vnode.el);
6572
6611
  };
6612
+ let isFlushing = false;
6573
6613
  const render = (vnode, container, namespace) => {
6574
6614
  if (vnode == null) {
6575
6615
  if (container._vnode) {
@@ -6586,8 +6626,12 @@ function baseCreateRenderer(options, createHydrationFns) {
6586
6626
  namespace
6587
6627
  );
6588
6628
  }
6589
- flushPreFlushCbs();
6590
- flushPostFlushCbs();
6629
+ if (!isFlushing) {
6630
+ isFlushing = true;
6631
+ flushPreFlushCbs();
6632
+ flushPostFlushCbs();
6633
+ isFlushing = false;
6634
+ }
6591
6635
  container._vnode = vnode;
6592
6636
  };
6593
6637
  const internals = {
@@ -7430,7 +7474,14 @@ function createComponentInstance(vnode, parent, suspense) {
7430
7474
  return instance;
7431
7475
  }
7432
7476
  let currentInstance = null;
7433
- const getCurrentInstance = () => currentInstance || currentRenderingInstance;
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
+ };
7434
7485
  let internalSetCurrentInstance;
7435
7486
  let setInSSRSetupState;
7436
7487
  {
@@ -7761,7 +7812,25 @@ function isClassComponent(value) {
7761
7812
  return shared.isFunction(value) && "__vccOpts" in value;
7762
7813
  }
7763
7814
 
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
+ }
7764
7826
  const computed = (getterOrOptions, debugOptions) => {
7827
+ {
7828
+ if (shared.isFunction(getterOrOptions)) {
7829
+ getterOrOptions = wrapComputedGetter(getterOrOptions);
7830
+ } else {
7831
+ getterOrOptions.get = wrapComputedGetter(getterOrOptions.get);
7832
+ }
7833
+ }
7765
7834
  return reactivity.computed(getterOrOptions, debugOptions, isInSSRComponentSetup);
7766
7835
  };
7767
7836
 
@@ -7991,7 +8060,7 @@ function isMemoSame(cached, memo) {
7991
8060
  return true;
7992
8061
  }
7993
8062
 
7994
- const version = "3.4.4";
8063
+ const version = "3.4.6";
7995
8064
  const warn = warn$1 ;
7996
8065
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
7997
8066
  const devtools = devtools$1 ;
@@ -214,14 +214,15 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
214
214
  }
215
215
  function flushPostFlushCbs(seen) {
216
216
  if (pendingPostFlushCbs.length) {
217
- const deduped = [...new Set(pendingPostFlushCbs)];
217
+ const deduped = [...new Set(pendingPostFlushCbs)].sort(
218
+ (a, b) => getId(a) - getId(b)
219
+ );
218
220
  pendingPostFlushCbs.length = 0;
219
221
  if (activePostFlushCbs) {
220
222
  activePostFlushCbs.push(...deduped);
221
223
  return;
222
224
  }
223
225
  activePostFlushCbs = deduped;
224
- activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
225
226
  for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
226
227
  activePostFlushCbs[postFlushIndex]();
227
228
  }
@@ -935,6 +936,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
935
936
  }
936
937
  }
937
938
  const timeout = vnode.props ? shared.toNumber(vnode.props.timeout) : void 0;
939
+ const initialAnchor = anchor;
938
940
  const suspense = {
939
941
  vnode,
940
942
  parent: parentSuspense,
@@ -942,7 +944,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
942
944
  namespace,
943
945
  container,
944
946
  hiddenContainer,
945
- anchor,
946
947
  deps: 0,
947
948
  pendingId: suspenseId++,
948
949
  timeout: typeof timeout === "number" ? timeout : -1,
@@ -973,20 +974,21 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
973
974
  move(
974
975
  pendingBranch,
975
976
  container2,
976
- next(activeBranch),
977
+ anchor === initialAnchor ? next(activeBranch) : anchor,
977
978
  0
978
979
  );
979
980
  queuePostFlushCb(effects);
980
981
  }
981
982
  };
982
983
  }
983
- let { anchor: anchor2 } = suspense;
984
984
  if (activeBranch) {
985
- anchor2 = next(activeBranch);
985
+ if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
986
+ anchor = next(activeBranch);
987
+ }
986
988
  unmount(activeBranch, parentComponent2, suspense, true);
987
989
  }
988
990
  if (!delayEnter) {
989
- move(pendingBranch, container2, anchor2, 0);
991
+ move(pendingBranch, container2, anchor, 0);
990
992
  }
991
993
  }
992
994
  setActiveBranch(suspense, pendingBranch);
@@ -1370,10 +1372,11 @@ function doWatch(source, cb, {
1370
1372
  scheduler = () => queueJob(job);
1371
1373
  }
1372
1374
  const effect = new reactivity.ReactiveEffect(getter, shared.NOOP, scheduler);
1375
+ const scope = reactivity.getCurrentScope();
1373
1376
  const unwatch = () => {
1374
1377
  effect.stop();
1375
- if (instance && instance.scope) {
1376
- shared.remove(instance.scope.effects, effect);
1378
+ if (scope) {
1379
+ shared.remove(scope.effects, effect);
1377
1380
  }
1378
1381
  };
1379
1382
  if (cb) {
@@ -4455,7 +4458,11 @@ function baseCreateRenderer(options, createHydrationFns) {
4455
4458
  hostInsert(fragmentStartAnchor, container, anchor);
4456
4459
  hostInsert(fragmentEndAnchor, container, anchor);
4457
4460
  mountChildren(
4458
- n2.children,
4461
+ // #10007
4462
+ // such fragment like `<></>` will be compiled into
4463
+ // a fragment which doesn't have a children.
4464
+ // In this case fallback to an empty array
4465
+ n2.children || [],
4459
4466
  container,
4460
4467
  fragmentEndAnchor,
4461
4468
  parentComponent,
@@ -5203,6 +5210,7 @@ function baseCreateRenderer(options, createHydrationFns) {
5203
5210
  }
5204
5211
  return hostNextSibling(vnode.anchor || vnode.el);
5205
5212
  };
5213
+ let isFlushing = false;
5206
5214
  const render = (vnode, container, namespace) => {
5207
5215
  if (vnode == null) {
5208
5216
  if (container._vnode) {
@@ -5219,8 +5227,12 @@ function baseCreateRenderer(options, createHydrationFns) {
5219
5227
  namespace
5220
5228
  );
5221
5229
  }
5222
- flushPreFlushCbs();
5223
- flushPostFlushCbs();
5230
+ if (!isFlushing) {
5231
+ isFlushing = true;
5232
+ flushPreFlushCbs();
5233
+ flushPostFlushCbs();
5234
+ isFlushing = false;
5235
+ }
5224
5236
  container._vnode = vnode;
5225
5237
  };
5226
5238
  const internals = {
@@ -6003,7 +6015,9 @@ function createComponentInstance(vnode, parent, suspense) {
6003
6015
  return instance;
6004
6016
  }
6005
6017
  let currentInstance = null;
6006
- const getCurrentInstance = () => currentInstance || currentRenderingInstance;
6018
+ const getCurrentInstance = () => {
6019
+ return currentInstance || currentRenderingInstance;
6020
+ };
6007
6021
  let internalSetCurrentInstance;
6008
6022
  let setInSSRSetupState;
6009
6023
  {
@@ -6254,7 +6268,7 @@ function isMemoSame(cached, memo) {
6254
6268
  return true;
6255
6269
  }
6256
6270
 
6257
- const version = "3.4.4";
6271
+ const version = "3.4.6";
6258
6272
  const warn$1 = shared.NOOP;
6259
6273
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6260
6274
  const devtools = void 0;
@@ -185,7 +185,6 @@ export interface SuspenseBoundary {
185
185
  namespace: ElementNamespace;
186
186
  container: RendererElement;
187
187
  hiddenContainer: RendererElement;
188
- anchor: RendererNode | null;
189
188
  activeBranch: VNode | null;
190
189
  pendingBranch: VNode | null;
191
190
  deps: number;
@@ -1,6 +1,6 @@
1
- import { pauseTracking, resetTracking, isRef, toRaw, isShallow as isShallow$1, isReactive, ReactiveEffect, ref, shallowReadonly, track, customRef, reactive, shallowReactive, trigger, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity';
1
+ 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
2
  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
- import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, capitalize, toNumber, hasChanged, isSet, isMap, isPlainObject, remove, isBuiltInDirective, invokeArrayFns, isRegExp, isGloballyAllowed, NO, def, isReservedProp, EMPTY_ARR, toRawType, makeMap, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr } from '@vue/shared';
3
+ 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';
4
4
  export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
5
5
 
6
6
  const stack = [];
@@ -345,7 +345,9 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
345
345
  }
346
346
  function flushPostFlushCbs(seen) {
347
347
  if (pendingPostFlushCbs.length) {
348
- const deduped = [...new Set(pendingPostFlushCbs)];
348
+ const deduped = [...new Set(pendingPostFlushCbs)].sort(
349
+ (a, b) => getId(a) - getId(b)
350
+ );
349
351
  pendingPostFlushCbs.length = 0;
350
352
  if (activePostFlushCbs) {
351
353
  activePostFlushCbs.push(...deduped);
@@ -355,7 +357,6 @@ function flushPostFlushCbs(seen) {
355
357
  if (!!(process.env.NODE_ENV !== "production")) {
356
358
  seen = seen || /* @__PURE__ */ new Map();
357
359
  }
358
- activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
359
360
  for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
360
361
  if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
361
362
  continue;
@@ -1448,6 +1449,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1448
1449
  if (!!(process.env.NODE_ENV !== "production")) {
1449
1450
  assertNumber(timeout, `Suspense timeout`);
1450
1451
  }
1452
+ const initialAnchor = anchor;
1451
1453
  const suspense = {
1452
1454
  vnode,
1453
1455
  parent: parentSuspense,
@@ -1455,7 +1457,6 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1455
1457
  namespace,
1456
1458
  container,
1457
1459
  hiddenContainer,
1458
- anchor,
1459
1460
  deps: 0,
1460
1461
  pendingId: suspenseId++,
1461
1462
  timeout: typeof timeout === "number" ? timeout : -1,
@@ -1498,20 +1499,21 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
1498
1499
  move(
1499
1500
  pendingBranch,
1500
1501
  container2,
1501
- next(activeBranch),
1502
+ anchor === initialAnchor ? next(activeBranch) : anchor,
1502
1503
  0
1503
1504
  );
1504
1505
  queuePostFlushCb(effects);
1505
1506
  }
1506
1507
  };
1507
1508
  }
1508
- let { anchor: anchor2 } = suspense;
1509
1509
  if (activeBranch) {
1510
- anchor2 = next(activeBranch);
1510
+ if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
1511
+ anchor = next(activeBranch);
1512
+ }
1511
1513
  unmount(activeBranch, parentComponent2, suspense, true);
1512
1514
  }
1513
1515
  if (!delayEnter) {
1514
- move(pendingBranch, container2, anchor2, 0);
1516
+ move(pendingBranch, container2, anchor, 0);
1515
1517
  }
1516
1518
  }
1517
1519
  setActiveBranch(suspense, pendingBranch);
@@ -1946,10 +1948,11 @@ function doWatch(source, cb, {
1946
1948
  scheduler = () => queueJob(job);
1947
1949
  }
1948
1950
  const effect = new ReactiveEffect(getter, NOOP, scheduler);
1951
+ const scope = getCurrentScope();
1949
1952
  const unwatch = () => {
1950
1953
  effect.stop();
1951
- if (instance && instance.scope) {
1952
- remove(instance.scope.effects, effect);
1954
+ if (scope) {
1955
+ remove(scope.effects, effect);
1953
1956
  }
1954
1957
  };
1955
1958
  if (!!(process.env.NODE_ENV !== "production")) {
@@ -4927,7 +4930,7 @@ Server rendered element contains more child nodes than client vdom.`
4927
4930
  if (props) {
4928
4931
  if (!!(process.env.NODE_ENV !== "production") || forcePatch || !optimized || patchFlag & (16 | 32)) {
4929
4932
  for (const key in props) {
4930
- if (!!(process.env.NODE_ENV !== "production") && propHasMismatch(el, key, props[key])) {
4933
+ if (!!(process.env.NODE_ENV !== "production") && propHasMismatch(el, key, props[key], vnode)) {
4931
4934
  hasMismatch = true;
4932
4935
  }
4933
4936
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -5112,7 +5115,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5112
5115
  };
5113
5116
  return [hydrate, hydrateNode];
5114
5117
  }
5115
- function propHasMismatch(el, key, clientValue) {
5118
+ function propHasMismatch(el, key, clientValue, vnode) {
5116
5119
  let mismatchType;
5117
5120
  let mismatchKey;
5118
5121
  let actual;
@@ -5124,14 +5127,23 @@ function propHasMismatch(el, key, clientValue) {
5124
5127
  mismatchType = mismatchKey = `class`;
5125
5128
  }
5126
5129
  } else if (key === "style") {
5127
- actual = el.getAttribute("style");
5128
- expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));
5129
- if (actual !== expected) {
5130
+ actual = toStyleMap(el.getAttribute("style") || "");
5131
+ expected = toStyleMap(
5132
+ isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue))
5133
+ );
5134
+ if (vnode.dirs) {
5135
+ for (const { dir, value } of vnode.dirs) {
5136
+ if (dir.name === "show" && !value) {
5137
+ expected.set("display", "none");
5138
+ }
5139
+ }
5140
+ }
5141
+ if (!isMapEqual(actual, expected)) {
5130
5142
  mismatchType = mismatchKey = "style";
5131
5143
  }
5132
5144
  } else if (el instanceof SVGElement && isKnownSvgAttr(key) || el instanceof HTMLElement && (isBooleanAttr(key) || isKnownHtmlAttr(key))) {
5133
- actual = el.hasAttribute(key) && el.getAttribute(key);
5134
- expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? false : String(clientValue);
5145
+ actual = el.hasAttribute(key) ? el.getAttribute(key) : key in el ? el[key] : "";
5146
+ expected = isBooleanAttr(key) ? includeBooleanAttr(clientValue) ? "" : false : clientValue == null ? "" : String(clientValue);
5135
5147
  if (actual !== expected) {
5136
5148
  mismatchType = `attribute`;
5137
5149
  mismatchKey = key;
@@ -5166,6 +5178,29 @@ function isSetEqual(a, b) {
5166
5178
  }
5167
5179
  return true;
5168
5180
  }
5181
+ function toStyleMap(str) {
5182
+ const styleMap = /* @__PURE__ */ new Map();
5183
+ for (const item of str.split(";")) {
5184
+ let [key, value] = item.split(":");
5185
+ key = key == null ? void 0 : key.trim();
5186
+ value = value == null ? void 0 : value.trim();
5187
+ if (key && value) {
5188
+ styleMap.set(key, value);
5189
+ }
5190
+ }
5191
+ return styleMap;
5192
+ }
5193
+ function isMapEqual(a, b) {
5194
+ if (a.size !== b.size) {
5195
+ return false;
5196
+ }
5197
+ for (const [key, value] of a) {
5198
+ if (value !== b.get(key)) {
5199
+ return false;
5200
+ }
5201
+ }
5202
+ return true;
5203
+ }
5169
5204
 
5170
5205
  let supported;
5171
5206
  let perf;
@@ -5779,7 +5814,11 @@ function baseCreateRenderer(options, createHydrationFns) {
5779
5814
  hostInsert(fragmentStartAnchor, container, anchor);
5780
5815
  hostInsert(fragmentEndAnchor, container, anchor);
5781
5816
  mountChildren(
5782
- n2.children,
5817
+ // #10007
5818
+ // such fragment like `<></>` will be compiled into
5819
+ // a fragment which doesn't have a children.
5820
+ // In this case fallback to an empty array
5821
+ n2.children || [],
5783
5822
  container,
5784
5823
  fragmentEndAnchor,
5785
5824
  parentComponent,
@@ -6626,6 +6665,7 @@ function baseCreateRenderer(options, createHydrationFns) {
6626
6665
  }
6627
6666
  return hostNextSibling(vnode.anchor || vnode.el);
6628
6667
  };
6668
+ let isFlushing = false;
6629
6669
  const render = (vnode, container, namespace) => {
6630
6670
  if (vnode == null) {
6631
6671
  if (container._vnode) {
@@ -6642,8 +6682,12 @@ function baseCreateRenderer(options, createHydrationFns) {
6642
6682
  namespace
6643
6683
  );
6644
6684
  }
6645
- flushPreFlushCbs();
6646
- flushPostFlushCbs();
6685
+ if (!isFlushing) {
6686
+ isFlushing = true;
6687
+ flushPreFlushCbs();
6688
+ flushPostFlushCbs();
6689
+ isFlushing = false;
6690
+ }
6647
6691
  container._vnode = vnode;
6648
6692
  };
6649
6693
  const internals = {
@@ -7488,7 +7532,14 @@ function createComponentInstance(vnode, parent, suspense) {
7488
7532
  return instance;
7489
7533
  }
7490
7534
  let currentInstance = null;
7491
- const getCurrentInstance = () => currentInstance || currentRenderingInstance;
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
+ };
7492
7543
  let internalSetCurrentInstance;
7493
7544
  let setInSSRSetupState;
7494
7545
  {
@@ -7833,7 +7884,25 @@ function isClassComponent(value) {
7833
7884
  return isFunction(value) && "__vccOpts" in value;
7834
7885
  }
7835
7886
 
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
+ }
7836
7898
  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
+ }
7837
7906
  return computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup);
7838
7907
  };
7839
7908
 
@@ -8063,7 +8132,7 @@ function isMemoSame(cached, memo) {
8063
8132
  return true;
8064
8133
  }
8065
8134
 
8066
- const version = "3.4.4";
8135
+ const version = "3.4.6";
8067
8136
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
8068
8137
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
8069
8138
  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.4",
3
+ "version": "3.4.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.4.4",
36
- "@vue/reactivity": "3.4.4"
35
+ "@vue/reactivity": "3.4.6",
36
+ "@vue/shared": "3.4.6"
37
37
  }
38
38
  }