@vue/compat 3.5.0-beta.3 → 3.5.0-rc.1

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.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.0-beta.3
2
+ * @vue/compat v3.5.0-rc.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -455,12 +455,13 @@ class EffectScope {
455
455
  pause() {
456
456
  if (this._active) {
457
457
  this._isPaused = true;
458
+ let i, l;
458
459
  if (this.scopes) {
459
- for (let i = 0, l = this.scopes.length; i < l; i++) {
460
+ for (i = 0, l = this.scopes.length; i < l; i++) {
460
461
  this.scopes[i].pause();
461
462
  }
462
463
  }
463
- for (let i = 0, l = this.effects.length; i < l; i++) {
464
+ for (i = 0, l = this.effects.length; i < l; i++) {
464
465
  this.effects[i].pause();
465
466
  }
466
467
  }
@@ -472,12 +473,13 @@ class EffectScope {
472
473
  if (this._active) {
473
474
  if (this._isPaused) {
474
475
  this._isPaused = false;
476
+ let i, l;
475
477
  if (this.scopes) {
476
- for (let i = 0, l = this.scopes.length; i < l; i++) {
478
+ for (i = 0, l = this.scopes.length; i < l; i++) {
477
479
  this.scopes[i].resume();
478
480
  }
479
481
  }
480
- for (let i = 0, l = this.effects.length; i < l; i++) {
482
+ for (i = 0, l = this.effects.length; i < l; i++) {
481
483
  this.effects[i].resume();
482
484
  }
483
485
  }
@@ -670,11 +672,9 @@ function startBatch() {
670
672
  batchDepth++;
671
673
  }
672
674
  function endBatch() {
673
- if (batchDepth > 1) {
674
- batchDepth--;
675
+ if (--batchDepth > 0) {
675
676
  return;
676
677
  }
677
- batchDepth--;
678
678
  let error;
679
679
  while (batchedEffect) {
680
680
  let e = batchedEffect;
@@ -1333,7 +1333,12 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1333
1333
  }
1334
1334
  }
1335
1335
  const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
1336
- const result = Reflect.set(target, key, value, receiver);
1336
+ const result = Reflect.set(
1337
+ target,
1338
+ key,
1339
+ value,
1340
+ isRef(target) ? target : receiver
1341
+ );
1337
1342
  if (target === toRaw(receiver)) {
1338
1343
  if (!hadKey) {
1339
1344
  trigger(target, "add", key, value);
@@ -2146,18 +2151,25 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2146
2151
  const depth = deep === true ? Infinity : deep;
2147
2152
  getter = () => traverse(baseGetter(), depth);
2148
2153
  }
2154
+ const scope = getCurrentScope();
2155
+ const watchHandle = () => {
2156
+ effect.stop();
2157
+ if (scope) {
2158
+ remove(scope.effects, effect);
2159
+ }
2160
+ };
2149
2161
  if (once) {
2150
2162
  if (cb) {
2151
2163
  const _cb = cb;
2152
2164
  cb = (...args) => {
2153
2165
  _cb(...args);
2154
- effect.stop();
2166
+ watchHandle();
2155
2167
  };
2156
2168
  } else {
2157
2169
  const _getter = getter;
2158
2170
  getter = () => {
2159
2171
  _getter();
2160
- effect.stop();
2172
+ watchHandle();
2161
2173
  };
2162
2174
  }
2163
2175
  }
@@ -2226,13 +2238,6 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2226
2238
  } else {
2227
2239
  effect.run();
2228
2240
  }
2229
- const scope = getCurrentScope();
2230
- const watchHandle = () => {
2231
- effect.stop();
2232
- if (scope) {
2233
- remove(scope.effects, effect);
2234
- }
2235
- };
2236
2241
  watchHandle.pause = effect.pause.bind(effect);
2237
2242
  watchHandle.resume = effect.resume.bind(effect);
2238
2243
  watchHandle.stop = watchHandle;
@@ -4212,7 +4217,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4212
4217
  // @__NO_SIDE_EFFECTS__
4213
4218
  function defineComponent(options, extraOptions) {
4214
4219
  return isFunction(options) ? (
4215
- // #8326: extend call and options.name access are considered side-effects
4220
+ // #8236: extend call and options.name access are considered side-effects
4216
4221
  // by Rollup, so we have to wrap it in a pure-annotated IIFE.
4217
4222
  /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
4218
4223
  ) : options;
@@ -5339,6 +5344,7 @@ const KeepAliveImpl = {
5339
5344
  );
5340
5345
  const { include, exclude, max } = props;
5341
5346
  if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
5347
+ vnode.shapeFlag &= ~256;
5342
5348
  current = vnode;
5343
5349
  return rawVNode;
5344
5350
  }
@@ -7087,7 +7093,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7087
7093
  return vm;
7088
7094
  }
7089
7095
  }
7090
- Vue.version = `2.6.14-compat:${"3.5.0-beta.3"}`;
7096
+ Vue.version = `2.6.14-compat:${"3.5.0-rc.1"}`;
7091
7097
  Vue.config = singletonApp.config;
7092
7098
  Vue.use = (plugin, ...options) => {
7093
7099
  if (plugin && isFunction(plugin.install)) {
@@ -12223,7 +12229,7 @@ function isMemoSame(cached, memo) {
12223
12229
  return true;
12224
12230
  }
12225
12231
 
12226
- const version = "3.5.0-beta.3";
12232
+ const version = "3.5.0-rc.1";
12227
12233
  const warn = warn$1 ;
12228
12234
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12229
12235
  const devtools = devtools$1 ;
@@ -12856,8 +12862,9 @@ function compatCoerceAttr(el, key, value, instance = null) {
12856
12862
 
12857
12863
  function patchDOMProp(el, key, value, parentComponent) {
12858
12864
  if (key === "innerHTML" || key === "textContent") {
12859
- if (value == null) return;
12860
- el[key] = value;
12865
+ if (value != null) {
12866
+ el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
12867
+ }
12861
12868
  return;
12862
12869
  }
12863
12870
  const tag = el.tagName;
@@ -13300,6 +13307,9 @@ class VueElement extends BaseClass {
13300
13307
  delete this._props[key];
13301
13308
  } else {
13302
13309
  this._props[key] = val;
13310
+ if (key === "key" && this._app) {
13311
+ this._app._ceVNode.key = val;
13312
+ }
13303
13313
  }
13304
13314
  if (shouldUpdate && this._instance) {
13305
13315
  this._update();
@@ -18051,7 +18061,7 @@ function genNode(node, context) {
18051
18061
  case 26:
18052
18062
  genReturnStatement(node, context);
18053
18063
  break;
18054
- /* istanbul ignore next */
18064
+ /* v8 ignore start */
18055
18065
  case 10:
18056
18066
  break;
18057
18067
  default:
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.0-beta.3
2
+ * @vue/compat v3.5.0-rc.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -379,12 +379,13 @@ class EffectScope {
379
379
  pause() {
380
380
  if (this._active) {
381
381
  this._isPaused = true;
382
+ let i, l;
382
383
  if (this.scopes) {
383
- for (let i = 0, l = this.scopes.length; i < l; i++) {
384
+ for (i = 0, l = this.scopes.length; i < l; i++) {
384
385
  this.scopes[i].pause();
385
386
  }
386
387
  }
387
- for (let i = 0, l = this.effects.length; i < l; i++) {
388
+ for (i = 0, l = this.effects.length; i < l; i++) {
388
389
  this.effects[i].pause();
389
390
  }
390
391
  }
@@ -396,12 +397,13 @@ class EffectScope {
396
397
  if (this._active) {
397
398
  if (this._isPaused) {
398
399
  this._isPaused = false;
400
+ let i, l;
399
401
  if (this.scopes) {
400
- for (let i = 0, l = this.scopes.length; i < l; i++) {
402
+ for (i = 0, l = this.scopes.length; i < l; i++) {
401
403
  this.scopes[i].resume();
402
404
  }
403
405
  }
404
- for (let i = 0, l = this.effects.length; i < l; i++) {
406
+ for (i = 0, l = this.effects.length; i < l; i++) {
405
407
  this.effects[i].resume();
406
408
  }
407
409
  }
@@ -583,11 +585,9 @@ function startBatch() {
583
585
  batchDepth++;
584
586
  }
585
587
  function endBatch() {
586
- if (batchDepth > 1) {
587
- batchDepth--;
588
+ if (--batchDepth > 0) {
588
589
  return;
589
590
  }
590
- batchDepth--;
591
591
  let error;
592
592
  while (batchedEffect) {
593
593
  let e = batchedEffect;
@@ -1206,7 +1206,12 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1206
1206
  }
1207
1207
  }
1208
1208
  const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
1209
- const result = Reflect.set(target, key, value, receiver);
1209
+ const result = Reflect.set(
1210
+ target,
1211
+ key,
1212
+ value,
1213
+ isRef(target) ? target : receiver
1214
+ );
1210
1215
  if (target === toRaw(receiver)) {
1211
1216
  if (!hadKey) {
1212
1217
  trigger(target, "add", key, value);
@@ -1937,18 +1942,25 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
1937
1942
  const depth = deep === true ? Infinity : deep;
1938
1943
  getter = () => traverse(baseGetter(), depth);
1939
1944
  }
1945
+ const scope = getCurrentScope();
1946
+ const watchHandle = () => {
1947
+ effect.stop();
1948
+ if (scope) {
1949
+ remove(scope.effects, effect);
1950
+ }
1951
+ };
1940
1952
  if (once) {
1941
1953
  if (cb) {
1942
1954
  const _cb = cb;
1943
1955
  cb = (...args) => {
1944
1956
  _cb(...args);
1945
- effect.stop();
1957
+ watchHandle();
1946
1958
  };
1947
1959
  } else {
1948
1960
  const _getter = getter;
1949
1961
  getter = () => {
1950
1962
  _getter();
1951
- effect.stop();
1963
+ watchHandle();
1952
1964
  };
1953
1965
  }
1954
1966
  }
@@ -2013,13 +2025,6 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2013
2025
  } else {
2014
2026
  effect.run();
2015
2027
  }
2016
- const scope = getCurrentScope();
2017
- const watchHandle = () => {
2018
- effect.stop();
2019
- if (scope) {
2020
- remove(scope.effects, effect);
2021
- }
2022
- };
2023
2028
  watchHandle.pause = effect.pause.bind(effect);
2024
2029
  watchHandle.resume = effect.resume.bind(effect);
2025
2030
  watchHandle.stop = watchHandle;
@@ -3297,7 +3302,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
3297
3302
  // @__NO_SIDE_EFFECTS__
3298
3303
  function defineComponent(options, extraOptions) {
3299
3304
  return isFunction(options) ? (
3300
- // #8326: extend call and options.name access are considered side-effects
3305
+ // #8236: extend call and options.name access are considered side-effects
3301
3306
  // by Rollup, so we have to wrap it in a pure-annotated IIFE.
3302
3307
  /* @__PURE__ */ (() => extend$1({ name: options.name }, extraOptions, { setup: options }))()
3303
3308
  ) : options;
@@ -4225,6 +4230,7 @@ const KeepAliveImpl = {
4225
4230
  );
4226
4231
  const { include, exclude, max } = props;
4227
4232
  if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
4233
+ vnode.shapeFlag &= ~256;
4228
4234
  current = vnode;
4229
4235
  return rawVNode;
4230
4236
  }
@@ -5697,7 +5703,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5697
5703
  return vm;
5698
5704
  }
5699
5705
  }
5700
- Vue.version = `2.6.14-compat:${"3.5.0-beta.3"}`;
5706
+ Vue.version = `2.6.14-compat:${"3.5.0-rc.1"}`;
5701
5707
  Vue.config = singletonApp.config;
5702
5708
  Vue.use = (plugin, ...options) => {
5703
5709
  if (plugin && isFunction(plugin.install)) {
@@ -9833,7 +9839,7 @@ function isMemoSame(cached, memo) {
9833
9839
  return true;
9834
9840
  }
9835
9841
 
9836
- const version = "3.5.0-beta.3";
9842
+ const version = "3.5.0-rc.1";
9837
9843
  const warn$1 = NOOP;
9838
9844
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9839
9845
  const devtools = void 0;
@@ -10451,8 +10457,9 @@ function compatCoerceAttr(el, key, value, instance = null) {
10451
10457
 
10452
10458
  function patchDOMProp(el, key, value, parentComponent) {
10453
10459
  if (key === "innerHTML" || key === "textContent") {
10454
- if (value == null) return;
10455
- el[key] = value;
10460
+ if (value != null) {
10461
+ el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
10462
+ }
10456
10463
  return;
10457
10464
  }
10458
10465
  const tag = el.tagName;
@@ -10860,6 +10867,9 @@ class VueElement extends BaseClass {
10860
10867
  delete this._props[key];
10861
10868
  } else {
10862
10869
  this._props[key] = val;
10870
+ if (key === "key" && this._app) {
10871
+ this._app._ceVNode.key = val;
10872
+ }
10863
10873
  }
10864
10874
  if (shouldUpdate && this._instance) {
10865
10875
  this._update();
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compat v3.5.0-beta.3
2
+ * @vue/compat v3.5.0-rc.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -404,12 +404,13 @@ class EffectScope {
404
404
  pause() {
405
405
  if (this._active) {
406
406
  this._isPaused = true;
407
+ let i, l;
407
408
  if (this.scopes) {
408
- for (let i = 0, l = this.scopes.length; i < l; i++) {
409
+ for (i = 0, l = this.scopes.length; i < l; i++) {
409
410
  this.scopes[i].pause();
410
411
  }
411
412
  }
412
- for (let i = 0, l = this.effects.length; i < l; i++) {
413
+ for (i = 0, l = this.effects.length; i < l; i++) {
413
414
  this.effects[i].pause();
414
415
  }
415
416
  }
@@ -421,12 +422,13 @@ class EffectScope {
421
422
  if (this._active) {
422
423
  if (this._isPaused) {
423
424
  this._isPaused = false;
425
+ let i, l;
424
426
  if (this.scopes) {
425
- for (let i = 0, l = this.scopes.length; i < l; i++) {
427
+ for (i = 0, l = this.scopes.length; i < l; i++) {
426
428
  this.scopes[i].resume();
427
429
  }
428
430
  }
429
- for (let i = 0, l = this.effects.length; i < l; i++) {
431
+ for (i = 0, l = this.effects.length; i < l; i++) {
430
432
  this.effects[i].resume();
431
433
  }
432
434
  }
@@ -619,11 +621,9 @@ function startBatch() {
619
621
  batchDepth++;
620
622
  }
621
623
  function endBatch() {
622
- if (batchDepth > 1) {
623
- batchDepth--;
624
+ if (--batchDepth > 0) {
624
625
  return;
625
626
  }
626
- batchDepth--;
627
627
  let error;
628
628
  while (batchedEffect) {
629
629
  let e = batchedEffect;
@@ -1282,7 +1282,12 @@ class MutableReactiveHandler extends BaseReactiveHandler {
1282
1282
  }
1283
1283
  }
1284
1284
  const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);
1285
- const result = Reflect.set(target, key, value, receiver);
1285
+ const result = Reflect.set(
1286
+ target,
1287
+ key,
1288
+ value,
1289
+ isRef(target) ? target : receiver
1290
+ );
1286
1291
  if (target === toRaw(receiver)) {
1287
1292
  if (!hadKey) {
1288
1293
  trigger(target, "add", key, value);
@@ -2095,18 +2100,25 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2095
2100
  const depth = deep === true ? Infinity : deep;
2096
2101
  getter = () => traverse(baseGetter(), depth);
2097
2102
  }
2103
+ const scope = getCurrentScope();
2104
+ const watchHandle = () => {
2105
+ effect.stop();
2106
+ if (scope) {
2107
+ remove(scope.effects, effect);
2108
+ }
2109
+ };
2098
2110
  if (once) {
2099
2111
  if (cb) {
2100
2112
  const _cb = cb;
2101
2113
  cb = (...args) => {
2102
2114
  _cb(...args);
2103
- effect.stop();
2115
+ watchHandle();
2104
2116
  };
2105
2117
  } else {
2106
2118
  const _getter = getter;
2107
2119
  getter = () => {
2108
2120
  _getter();
2109
- effect.stop();
2121
+ watchHandle();
2110
2122
  };
2111
2123
  }
2112
2124
  }
@@ -2175,13 +2187,6 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
2175
2187
  } else {
2176
2188
  effect.run();
2177
2189
  }
2178
- const scope = getCurrentScope();
2179
- const watchHandle = () => {
2180
- effect.stop();
2181
- if (scope) {
2182
- remove(scope.effects, effect);
2183
- }
2184
- };
2185
2190
  watchHandle.pause = effect.pause.bind(effect);
2186
2191
  watchHandle.resume = effect.resume.bind(effect);
2187
2192
  watchHandle.stop = watchHandle;
@@ -4161,7 +4166,7 @@ function getTransitionRawChildren(children, keepComment = false, parentKey) {
4161
4166
  // @__NO_SIDE_EFFECTS__
4162
4167
  function defineComponent(options, extraOptions) {
4163
4168
  return isFunction(options) ? (
4164
- // #8326: extend call and options.name access are considered side-effects
4169
+ // #8236: extend call and options.name access are considered side-effects
4165
4170
  // by Rollup, so we have to wrap it in a pure-annotated IIFE.
4166
4171
  /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))()
4167
4172
  ) : options;
@@ -5288,6 +5293,7 @@ const KeepAliveImpl = {
5288
5293
  );
5289
5294
  const { include, exclude, max } = props;
5290
5295
  if (include && (!name || !matches(include, name)) || exclude && name && matches(exclude, name)) {
5296
+ vnode.shapeFlag &= ~256;
5291
5297
  current = vnode;
5292
5298
  return rawVNode;
5293
5299
  }
@@ -7036,7 +7042,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
7036
7042
  return vm;
7037
7043
  }
7038
7044
  }
7039
- Vue.version = `2.6.14-compat:${"3.5.0-beta.3"}`;
7045
+ Vue.version = `2.6.14-compat:${"3.5.0-rc.1"}`;
7040
7046
  Vue.config = singletonApp.config;
7041
7047
  Vue.use = (plugin, ...options) => {
7042
7048
  if (plugin && isFunction(plugin.install)) {
@@ -12172,7 +12178,7 @@ function isMemoSame(cached, memo) {
12172
12178
  return true;
12173
12179
  }
12174
12180
 
12175
- const version = "3.5.0-beta.3";
12181
+ const version = "3.5.0-rc.1";
12176
12182
  const warn = warn$1 ;
12177
12183
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12178
12184
  const devtools = devtools$1 ;
@@ -12871,8 +12877,9 @@ function compatCoerceAttr(el, key, value, instance = null) {
12871
12877
 
12872
12878
  function patchDOMProp(el, key, value, parentComponent) {
12873
12879
  if (key === "innerHTML" || key === "textContent") {
12874
- if (value == null) return;
12875
- el[key] = value;
12880
+ if (value != null) {
12881
+ el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
12882
+ }
12876
12883
  return;
12877
12884
  }
12878
12885
  const tag = el.tagName;
@@ -13315,6 +13322,9 @@ class VueElement extends BaseClass {
13315
13322
  delete this._props[key];
13316
13323
  } else {
13317
13324
  this._props[key] = val;
13325
+ if (key === "key" && this._app) {
13326
+ this._app._ceVNode.key = val;
13327
+ }
13318
13328
  }
13319
13329
  if (shouldUpdate && this._instance) {
13320
13330
  this._update();
@@ -17457,7 +17467,7 @@ function genNode(node, context) {
17457
17467
  break;
17458
17468
  case 26:
17459
17469
  break;
17460
- /* istanbul ignore next */
17470
+ /* v8 ignore start */
17461
17471
  case 10:
17462
17472
  break;
17463
17473
  default: