@vue/compat 3.5.32 → 3.5.34

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.5.32
2
+ * @vue/compat v3.5.34
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -354,12 +354,18 @@ class EffectScope {
354
354
  */
355
355
  this.cleanups = [];
356
356
  this._isPaused = false;
357
+ this._warnOnRun = true;
357
358
  this.__v_skip = true;
358
- this.parent = activeEffectScope;
359
359
  if (!detached && activeEffectScope) {
360
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
361
- this
362
- ) - 1;
360
+ if (activeEffectScope.active) {
361
+ this.parent = activeEffectScope;
362
+ this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
363
+ this
364
+ ) - 1;
365
+ } else {
366
+ this._active = false;
367
+ this._warnOnRun = false;
368
+ }
363
369
  }
364
370
  }
365
371
  get active() {
@@ -407,7 +413,7 @@ class EffectScope {
407
413
  } finally {
408
414
  activeEffectScope = currentEffectScope;
409
415
  }
410
- } else if (!!(process.env.NODE_ENV !== "production")) {
416
+ } else if (!!(process.env.NODE_ENV !== "production") && this._warnOnRun) {
411
417
  warn$2(`cannot run an inactive effect scope.`);
412
418
  }
413
419
  }
@@ -427,7 +433,18 @@ class EffectScope {
427
433
  */
428
434
  off() {
429
435
  if (this._on > 0 && --this._on === 0) {
430
- activeEffectScope = this.prevScope;
436
+ if (activeEffectScope === this) {
437
+ activeEffectScope = this.prevScope;
438
+ } else {
439
+ let current = activeEffectScope;
440
+ while (current) {
441
+ if (current.prevScope === this) {
442
+ current.prevScope = this.prevScope;
443
+ break;
444
+ }
445
+ current = current.prevScope;
446
+ }
447
+ }
431
448
  this.prevScope = void 0;
432
449
  }
433
450
  }
@@ -502,8 +519,12 @@ class ReactiveEffect {
502
519
  */
503
520
  this.cleanup = void 0;
504
521
  this.scheduler = void 0;
505
- if (activeEffectScope && activeEffectScope.active) {
506
- activeEffectScope.effects.push(this);
522
+ if (activeEffectScope) {
523
+ if (activeEffectScope.active) {
524
+ activeEffectScope.effects.push(this);
525
+ } else {
526
+ this.flags &= -2;
527
+ }
507
528
  }
508
529
  }
509
530
  pause() {
@@ -3714,7 +3735,7 @@ const TeleportImpl = {
3714
3735
  mc: mountChildren,
3715
3736
  pc: patchChildren,
3716
3737
  pbc: patchBlockChildren,
3717
- o: { insert, querySelector, createText, createComment }
3738
+ o: { insert, querySelector, createText, createComment, parentNode }
3718
3739
  } = internals;
3719
3740
  const disabled = isTeleportDisabled(n2.props);
3720
3741
  let { dynamicChildren } = n2;
@@ -3762,7 +3783,8 @@ const TeleportImpl = {
3762
3783
  if (pendingMounts.get(vnode) !== mountJob) return;
3763
3784
  pendingMounts.delete(vnode);
3764
3785
  if (isTeleportDisabled(vnode.props)) {
3765
- mount(vnode, container, vnode.anchor);
3786
+ const mountContainer = parentNode(vnode.el) || container;
3787
+ mount(vnode, mountContainer, vnode.anchor);
3766
3788
  updateCssVars(vnode, true);
3767
3789
  }
3768
3790
  mountToTarget(vnode);
@@ -3924,7 +3946,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
3924
3946
  if (isReorder) {
3925
3947
  insert(el, container, parentAnchor);
3926
3948
  }
3927
- if (!isReorder || isTeleportDisabled(props)) {
3949
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3928
3950
  if (shapeFlag & 16) {
3929
3951
  for (let i = 0; i < children.length; i++) {
3930
3952
  move(
@@ -4098,10 +4120,14 @@ const BaseTransitionImpl = {
4098
4120
  const state = useTransitionState();
4099
4121
  return () => {
4100
4122
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
4101
- if (!children || !children.length) {
4123
+ const child = children && children.length ? findNonCommentChild(children) : (
4124
+ // Keep explicit default-slot conditionals on the same transition path
4125
+ // as regular v-if branches, which render a comment placeholder.
4126
+ instance.subTree ? createCommentVNode() : void 0
4127
+ );
4128
+ if (!child) {
4102
4129
  return;
4103
4130
  }
4104
- const child = findNonCommentChild(children);
4105
4131
  const rawProps = toRaw(props);
4106
4132
  const { mode } = rawProps;
4107
4133
  if (!!(process.env.NODE_ENV !== "production") && mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
@@ -7480,7 +7506,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7480
7506
  return vm;
7481
7507
  }
7482
7508
  }
7483
- Vue.version = `2.6.14-compat:${"3.5.32"}`;
7509
+ Vue.version = `2.6.14-compat:${"3.5.34"}`;
7484
7510
  Vue.config = singletonApp.config;
7485
7511
  Vue.use = (plugin, ...options) => {
7486
7512
  if (plugin && isFunction(plugin.install)) {
@@ -9117,7 +9143,7 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
9117
9143
  const receivedType = toRawType(value);
9118
9144
  const expectedValue = styleValue(value, expectedType);
9119
9145
  const receivedValue = styleValue(value, receivedType);
9120
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
9146
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) {
9121
9147
  message += ` with value ${expectedValue}`;
9122
9148
  }
9123
9149
  message += `, got ${receivedType} `;
@@ -9127,7 +9153,9 @@ function getInvalidTypeMessage(name, value, expectedTypes) {
9127
9153
  return message;
9128
9154
  }
9129
9155
  function styleValue(value, type) {
9130
- if (type === "String") {
9156
+ if (isSymbol(value)) {
9157
+ return value.toString();
9158
+ } else if (type === "String") {
9131
9159
  return `"${value}"`;
9132
9160
  } else if (type === "Number") {
9133
9161
  return `${Number(value)}`;
@@ -9139,8 +9167,11 @@ function isExplicable(type) {
9139
9167
  const explicitTypes = ["string", "number", "boolean"];
9140
9168
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
9141
9169
  }
9142
- function isBoolean(...args) {
9143
- return args.some((elem) => elem.toLowerCase() === "boolean");
9170
+ function isCoercible(...args) {
9171
+ return args.every((elem) => {
9172
+ const value = elem.toLowerCase();
9173
+ return value !== "boolean" && value !== "symbol";
9174
+ });
9144
9175
  }
9145
9176
 
9146
9177
  const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
@@ -11232,13 +11263,14 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11232
11263
  suspense.isHydrating = false;
11233
11264
  } else if (!resume) {
11234
11265
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
11266
+ let hasUpdatedAnchor = false;
11235
11267
  if (delayEnter) {
11236
11268
  activeBranch.transition.afterLeave = () => {
11237
11269
  if (pendingId === suspense.pendingId) {
11238
11270
  move(
11239
11271
  pendingBranch,
11240
11272
  container2,
11241
- anchor === initialAnchor ? next(activeBranch) : anchor,
11273
+ anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor,
11242
11274
  0
11243
11275
  );
11244
11276
  queuePostFlushCb(effects);
@@ -11251,6 +11283,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
11251
11283
  if (activeBranch && !suspense.isFallbackMountPending) {
11252
11284
  if (parentNode(activeBranch.el) === container2) {
11253
11285
  anchor = next(activeBranch);
11286
+ hasUpdatedAnchor = true;
11254
11287
  }
11255
11288
  unmount(activeBranch, parentComponent2, suspense, true);
11256
11289
  if (!delayEnter && isInFallback && vnode2.ssFallback) {
@@ -12650,7 +12683,7 @@ function isMemoSame(cached, memo) {
12650
12683
  return true;
12651
12684
  }
12652
12685
 
12653
- const version = "3.5.32";
12686
+ const version = "3.5.34";
12654
12687
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
12655
12688
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12656
12689
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -13241,7 +13274,19 @@ function patchStyle(el, prev, next) {
13241
13274
  if (key === "display") {
13242
13275
  hasControlledDisplay = true;
13243
13276
  }
13244
- setStyle(style, key, next[key]);
13277
+ const value = next[key];
13278
+ if (value != null) {
13279
+ if (!shouldPreserveTextareaResizeStyle(
13280
+ el,
13281
+ key,
13282
+ !isString(prev) && prev ? prev[key] : void 0,
13283
+ value
13284
+ )) {
13285
+ setStyle(style, key, value);
13286
+ }
13287
+ } else {
13288
+ setStyle(style, key, "");
13289
+ }
13245
13290
  }
13246
13291
  } else {
13247
13292
  if (isCssString) {
@@ -13314,6 +13359,9 @@ function autoPrefix(style, rawName) {
13314
13359
  }
13315
13360
  return rawName;
13316
13361
  }
13362
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
13363
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
13364
+ }
13317
13365
 
13318
13366
  const xlinkNS = "http://www.w3.org/1999/xlink";
13319
13367
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.32
2
+ * @vue/compat v3.5.34
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -357,12 +357,18 @@ var Vue = (function () {
357
357
  */
358
358
  this.cleanups = [];
359
359
  this._isPaused = false;
360
+ this._warnOnRun = true;
360
361
  this.__v_skip = true;
361
- this.parent = activeEffectScope;
362
362
  if (!detached && activeEffectScope) {
363
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
364
- this
365
- ) - 1;
363
+ if (activeEffectScope.active) {
364
+ this.parent = activeEffectScope;
365
+ this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
366
+ this
367
+ ) - 1;
368
+ } else {
369
+ this._active = false;
370
+ this._warnOnRun = false;
371
+ }
366
372
  }
367
373
  }
368
374
  get active() {
@@ -410,7 +416,7 @@ var Vue = (function () {
410
416
  } finally {
411
417
  activeEffectScope = currentEffectScope;
412
418
  }
413
- } else {
419
+ } else if (this._warnOnRun) {
414
420
  warn$2(`cannot run an inactive effect scope.`);
415
421
  }
416
422
  }
@@ -430,7 +436,18 @@ var Vue = (function () {
430
436
  */
431
437
  off() {
432
438
  if (this._on > 0 && --this._on === 0) {
433
- activeEffectScope = this.prevScope;
439
+ if (activeEffectScope === this) {
440
+ activeEffectScope = this.prevScope;
441
+ } else {
442
+ let current = activeEffectScope;
443
+ while (current) {
444
+ if (current.prevScope === this) {
445
+ current.prevScope = this.prevScope;
446
+ break;
447
+ }
448
+ current = current.prevScope;
449
+ }
450
+ }
434
451
  this.prevScope = void 0;
435
452
  }
436
453
  }
@@ -505,8 +522,12 @@ var Vue = (function () {
505
522
  */
506
523
  this.cleanup = void 0;
507
524
  this.scheduler = void 0;
508
- if (activeEffectScope && activeEffectScope.active) {
509
- activeEffectScope.effects.push(this);
525
+ if (activeEffectScope) {
526
+ if (activeEffectScope.active) {
527
+ activeEffectScope.effects.push(this);
528
+ } else {
529
+ this.flags &= -2;
530
+ }
510
531
  }
511
532
  }
512
533
  pause() {
@@ -3671,7 +3692,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3671
3692
  mc: mountChildren,
3672
3693
  pc: patchChildren,
3673
3694
  pbc: patchBlockChildren,
3674
- o: { insert, querySelector, createText, createComment }
3695
+ o: { insert, querySelector, createText, createComment, parentNode }
3675
3696
  } = internals;
3676
3697
  const disabled = isTeleportDisabled(n2.props);
3677
3698
  let { dynamicChildren } = n2;
@@ -3719,7 +3740,8 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3719
3740
  if (pendingMounts.get(vnode) !== mountJob) return;
3720
3741
  pendingMounts.delete(vnode);
3721
3742
  if (isTeleportDisabled(vnode.props)) {
3722
- mount(vnode, container, vnode.anchor);
3743
+ const mountContainer = parentNode(vnode.el) || container;
3744
+ mount(vnode, mountContainer, vnode.anchor);
3723
3745
  updateCssVars(vnode, true);
3724
3746
  }
3725
3747
  mountToTarget(vnode);
@@ -3881,7 +3903,7 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3881
3903
  if (isReorder) {
3882
3904
  insert(el, container, parentAnchor);
3883
3905
  }
3884
- if (!isReorder || isTeleportDisabled(props)) {
3906
+ if (!pendingMounts.has(vnode) && (!isReorder || isTeleportDisabled(props))) {
3885
3907
  if (shapeFlag & 16) {
3886
3908
  for (let i = 0; i < children.length; i++) {
3887
3909
  move(
@@ -4055,10 +4077,14 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
4055
4077
  const state = useTransitionState();
4056
4078
  return () => {
4057
4079
  const children = slots.default && getTransitionRawChildren(slots.default(), true);
4058
- if (!children || !children.length) {
4080
+ const child = children && children.length ? findNonCommentChild(children) : (
4081
+ // Keep explicit default-slot conditionals on the same transition path
4082
+ // as regular v-if branches, which render a comment placeholder.
4083
+ instance.subTree ? createCommentVNode() : void 0
4084
+ );
4085
+ if (!child) {
4059
4086
  return;
4060
4087
  }
4061
- const child = findNonCommentChild(children);
4062
4088
  const rawProps = toRaw(props);
4063
4089
  const { mode } = rawProps;
4064
4090
  if (mode && mode !== "in-out" && mode !== "out-in" && mode !== "default") {
@@ -7414,7 +7440,7 @@ If this is a native custom element, make sure to exclude it from component resol
7414
7440
  return vm;
7415
7441
  }
7416
7442
  }
7417
- Vue.version = `2.6.14-compat:${"3.5.32"}`;
7443
+ Vue.version = `2.6.14-compat:${"3.5.34"}`;
7418
7444
  Vue.config = singletonApp.config;
7419
7445
  Vue.use = (plugin, ...options) => {
7420
7446
  if (plugin && isFunction(plugin.install)) {
@@ -9049,7 +9075,7 @@ If you want to remount the same app, move your app creation logic into a factory
9049
9075
  const receivedType = toRawType(value);
9050
9076
  const expectedValue = styleValue(value, expectedType);
9051
9077
  const receivedValue = styleValue(value, receivedType);
9052
- if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean(expectedType, receivedType)) {
9078
+ if (expectedTypes.length === 1 && isExplicable(expectedType) && isCoercible(expectedType, receivedType)) {
9053
9079
  message += ` with value ${expectedValue}`;
9054
9080
  }
9055
9081
  message += `, got ${receivedType} `;
@@ -9059,7 +9085,9 @@ If you want to remount the same app, move your app creation logic into a factory
9059
9085
  return message;
9060
9086
  }
9061
9087
  function styleValue(value, type) {
9062
- if (type === "String") {
9088
+ if (isSymbol(value)) {
9089
+ return value.toString();
9090
+ } else if (type === "String") {
9063
9091
  return `"${value}"`;
9064
9092
  } else if (type === "Number") {
9065
9093
  return `${Number(value)}`;
@@ -9071,8 +9099,11 @@ If you want to remount the same app, move your app creation logic into a factory
9071
9099
  const explicitTypes = ["string", "number", "boolean"];
9072
9100
  return explicitTypes.some((elem) => type.toLowerCase() === elem);
9073
9101
  }
9074
- function isBoolean(...args) {
9075
- return args.some((elem) => elem.toLowerCase() === "boolean");
9102
+ function isCoercible(...args) {
9103
+ return args.every((elem) => {
9104
+ const value = elem.toLowerCase();
9105
+ return value !== "boolean" && value !== "symbol";
9106
+ });
9076
9107
  }
9077
9108
 
9078
9109
  const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
@@ -11126,13 +11157,14 @@ If you want to remount the same app, move your app creation logic into a factory
11126
11157
  suspense.isHydrating = false;
11127
11158
  } else if (!resume) {
11128
11159
  delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
11160
+ let hasUpdatedAnchor = false;
11129
11161
  if (delayEnter) {
11130
11162
  activeBranch.transition.afterLeave = () => {
11131
11163
  if (pendingId === suspense.pendingId) {
11132
11164
  move(
11133
11165
  pendingBranch,
11134
11166
  container2,
11135
- anchor === initialAnchor ? next(activeBranch) : anchor,
11167
+ anchor === initialAnchor && !hasUpdatedAnchor ? next(activeBranch) : anchor,
11136
11168
  0
11137
11169
  );
11138
11170
  queuePostFlushCb(effects);
@@ -11145,6 +11177,7 @@ If you want to remount the same app, move your app creation logic into a factory
11145
11177
  if (activeBranch && !suspense.isFallbackMountPending) {
11146
11178
  if (parentNode(activeBranch.el) === container2) {
11147
11179
  anchor = next(activeBranch);
11180
+ hasUpdatedAnchor = true;
11148
11181
  }
11149
11182
  unmount(activeBranch, parentComponent2, suspense, true);
11150
11183
  if (!delayEnter && isInFallback && vnode2.ssFallback) {
@@ -12516,7 +12549,7 @@ Component that was made reactive: `,
12516
12549
  return true;
12517
12550
  }
12518
12551
 
12519
- const version = "3.5.32";
12552
+ const version = "3.5.34";
12520
12553
  const warn = warn$1 ;
12521
12554
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12522
12555
  const devtools = devtools$1 ;
@@ -13088,7 +13121,19 @@ Component that was made reactive: `,
13088
13121
  if (key === "display") {
13089
13122
  hasControlledDisplay = true;
13090
13123
  }
13091
- setStyle(style, key, next[key]);
13124
+ const value = next[key];
13125
+ if (value != null) {
13126
+ if (!shouldPreserveTextareaResizeStyle(
13127
+ el,
13128
+ key,
13129
+ !isString(prev) && prev ? prev[key] : void 0,
13130
+ value
13131
+ )) {
13132
+ setStyle(style, key, value);
13133
+ }
13134
+ } else {
13135
+ setStyle(style, key, "");
13136
+ }
13092
13137
  }
13093
13138
  } else {
13094
13139
  if (isCssString) {
@@ -13161,6 +13206,9 @@ Component that was made reactive: `,
13161
13206
  }
13162
13207
  return rawName;
13163
13208
  }
13209
+ function shouldPreserveTextareaResizeStyle(el, key, prev, next) {
13210
+ return el.tagName === "TEXTAREA" && (key === "width" || key === "height") && isString(next) && prev === next;
13211
+ }
13164
13212
 
13165
13213
  const xlinkNS = "http://www.w3.org/1999/xlink";
13166
13214
  function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBooleanAttr(key)) {