@vue/compat 3.3.9 → 3.3.11

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.
@@ -12,8 +12,8 @@ const EMPTY_ARR = !!(process.env.NODE_ENV !== "production") ? Object.freeze([])
12
12
  const NOOP = () => {
13
13
  };
14
14
  const NO = () => false;
15
- const onRE = /^on[^a-z]/;
16
- const isOn = (key) => onRE.test(key);
15
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
16
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
17
17
  const isModelListener = (key) => key.startsWith("onUpdate:");
18
18
  const extend = Object.assign;
19
19
  const remove = (arr, el) => {
@@ -235,20 +235,29 @@ const replacer = (_key, val) => {
235
235
  return replacer(_key, val.value);
236
236
  } else if (isMap(val)) {
237
237
  return {
238
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
239
- entries[`${key} =>`] = val2;
240
- return entries;
241
- }, {})
238
+ [`Map(${val.size})`]: [...val.entries()].reduce(
239
+ (entries, [key, val2], i) => {
240
+ entries[stringifySymbol(key, i) + " =>"] = val2;
241
+ return entries;
242
+ },
243
+ {}
244
+ )
242
245
  };
243
246
  } else if (isSet(val)) {
244
247
  return {
245
- [`Set(${val.size})`]: [...val.values()]
248
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
246
249
  };
250
+ } else if (isSymbol(val)) {
251
+ return stringifySymbol(val);
247
252
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
248
253
  return String(val);
249
254
  }
250
255
  return val;
251
256
  };
257
+ const stringifySymbol = (v, i = "") => {
258
+ var _a;
259
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
260
+ };
252
261
 
253
262
  function warn$1(msg, ...args) {
254
263
  console.warn(`[Vue warn] ${msg}`, ...args);
@@ -676,8 +685,13 @@ class BaseReactiveHandler {
676
685
  return isReadonly2;
677
686
  } else if (key === "__v_isShallow") {
678
687
  return shallow;
679
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
680
- return target;
688
+ } else if (key === "__v_raw") {
689
+ if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
690
+ // this means the reciever is a user proxy of the reactive proxy
691
+ Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
692
+ return target;
693
+ }
694
+ return;
681
695
  }
682
696
  const targetIsArray = isArray(target);
683
697
  if (!isReadonly2) {
@@ -1698,13 +1712,16 @@ function queuePostFlushCb(cb) {
1698
1712
  }
1699
1713
  queueFlush();
1700
1714
  }
1701
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1715
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1702
1716
  if (!!(process.env.NODE_ENV !== "production")) {
1703
1717
  seen = seen || /* @__PURE__ */ new Map();
1704
1718
  }
1705
1719
  for (; i < queue.length; i++) {
1706
1720
  const cb = queue[i];
1707
1721
  if (cb && cb.pre) {
1722
+ if (instance && cb.id !== instance.uid) {
1723
+ continue;
1724
+ }
1708
1725
  if (!!(process.env.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) {
1709
1726
  continue;
1710
1727
  }
@@ -3324,7 +3341,12 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
3324
3341
  if (delayEnter) {
3325
3342
  activeBranch.transition.afterLeave = () => {
3326
3343
  if (pendingId === suspense.pendingId) {
3327
- move(pendingBranch, container2, anchor2, 0);
3344
+ move(
3345
+ pendingBranch,
3346
+ container2,
3347
+ next(activeBranch),
3348
+ 0
3349
+ );
3328
3350
  queuePostFlushCb(effects);
3329
3351
  }
3330
3352
  };
@@ -6252,7 +6274,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6252
6274
  return vm;
6253
6275
  }
6254
6276
  }
6255
- Vue.version = `2.6.14-compat:${"3.3.9"}`;
6277
+ Vue.version = `2.6.14-compat:${"3.3.11"}`;
6256
6278
  Vue.config = singletonApp.config;
6257
6279
  Vue.use = (p, ...options) => {
6258
6280
  if (p && isFunction(p.install)) {
@@ -8927,7 +8949,7 @@ function baseCreateRenderer(options, createHydrationFns) {
8927
8949
  updateProps(instance, nextVNode.props, prevProps, optimized);
8928
8950
  updateSlots(instance, nextVNode.children, optimized);
8929
8951
  pauseTracking();
8930
- flushPreFlushCbs();
8952
+ flushPreFlushCbs(instance);
8931
8953
  resetTracking();
8932
8954
  };
8933
8955
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
@@ -10714,9 +10736,9 @@ function initCustomFormatter() {
10714
10736
  return;
10715
10737
  }
10716
10738
  const vueStyle = { style: "color:#3ba776" };
10717
- const numberStyle = { style: "color:#0b1bc9" };
10718
- const stringStyle = { style: "color:#b62e24" };
10719
- const keywordStyle = { style: "color:#9d288c" };
10739
+ const numberStyle = { style: "color:#1677ff" };
10740
+ const stringStyle = { style: "color:#f5222d" };
10741
+ const keywordStyle = { style: "color:#eb2f96" };
10720
10742
  const formatter = {
10721
10743
  header(obj) {
10722
10744
  if (!isObject(obj)) {
@@ -10910,7 +10932,7 @@ function isMemoSame(cached, memo) {
10910
10932
  return true;
10911
10933
  }
10912
10934
 
10913
- const version = "3.3.9";
10935
+ const version = "3.3.11";
10914
10936
  const _ssrUtils = {
10915
10937
  createComponentInstance,
10916
10938
  setupComponent,
@@ -11624,7 +11646,8 @@ function patchStopImmediatePropagation(e, value) {
11624
11646
  }
11625
11647
  }
11626
11648
 
11627
- const nativeOnRE = /^on[a-z]/;
11649
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11650
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11628
11651
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11629
11652
  if (key === "class") {
11630
11653
  patchClass(el, nextValue, isSVG);
@@ -11658,7 +11681,7 @@ function shouldSetAsProp(el, key, value, isSVG) {
11658
11681
  if (key === "innerHTML" || key === "textContent") {
11659
11682
  return true;
11660
11683
  }
11661
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11684
+ if (key in el && isNativeOn(key) && isFunction(value)) {
11662
11685
  return true;
11663
11686
  }
11664
11687
  return false;
@@ -11675,7 +11698,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
11675
11698
  if (key === "type" && el.tagName === "TEXTAREA") {
11676
11699
  return false;
11677
11700
  }
11678
- if (nativeOnRE.test(key) && isString(value)) {
11701
+ if (key === "width" || key === "height") {
11702
+ const tag = el.tagName;
11703
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
11704
+ return false;
11705
+ }
11706
+ }
11707
+ if (isNativeOn(key) && isString(value)) {
11679
11708
  return false;
11680
11709
  }
11681
11710
  return key in el;
@@ -12399,14 +12428,14 @@ const modifierGuards = {
12399
12428
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12400
12429
  };
12401
12430
  const withModifiers = (fn, modifiers) => {
12402
- return (event, ...args) => {
12431
+ return fn._withMods || (fn._withMods = (event, ...args) => {
12403
12432
  for (let i = 0; i < modifiers.length; i++) {
12404
12433
  const guard = modifierGuards[modifiers[i]];
12405
12434
  if (guard && guard(event, modifiers))
12406
12435
  return;
12407
12436
  }
12408
12437
  return fn(event, ...args);
12409
- };
12438
+ });
12410
12439
  };
12411
12440
  const keyNames = {
12412
12441
  esc: "escape",
@@ -12434,7 +12463,7 @@ const withKeys = (fn, modifiers) => {
12434
12463
  );
12435
12464
  }
12436
12465
  }
12437
- return (event) => {
12466
+ return fn._withKeys || (fn._withKeys = (event) => {
12438
12467
  if (!("key" in event)) {
12439
12468
  return;
12440
12469
  }
@@ -12462,7 +12491,7 @@ const withKeys = (fn, modifiers) => {
12462
12491
  }
12463
12492
  }
12464
12493
  }
12465
- };
12494
+ });
12466
12495
  };
12467
12496
 
12468
12497
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
@@ -15,8 +15,8 @@ var Vue = (function () {
15
15
  const NOOP = () => {
16
16
  };
17
17
  const NO = () => false;
18
- const onRE = /^on[^a-z]/;
19
- const isOn = (key) => onRE.test(key);
18
+ const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
19
+ (key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
20
20
  const isModelListener = (key) => key.startsWith("onUpdate:");
21
21
  const extend = Object.assign;
22
22
  const remove = (arr, el) => {
@@ -238,20 +238,29 @@ var Vue = (function () {
238
238
  return replacer(_key, val.value);
239
239
  } else if (isMap(val)) {
240
240
  return {
241
- [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {
242
- entries[`${key} =>`] = val2;
243
- return entries;
244
- }, {})
241
+ [`Map(${val.size})`]: [...val.entries()].reduce(
242
+ (entries, [key, val2], i) => {
243
+ entries[stringifySymbol(key, i) + " =>"] = val2;
244
+ return entries;
245
+ },
246
+ {}
247
+ )
245
248
  };
246
249
  } else if (isSet(val)) {
247
250
  return {
248
- [`Set(${val.size})`]: [...val.values()]
251
+ [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
249
252
  };
253
+ } else if (isSymbol(val)) {
254
+ return stringifySymbol(val);
250
255
  } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
251
256
  return String(val);
252
257
  }
253
258
  return val;
254
259
  };
260
+ const stringifySymbol = (v, i = "") => {
261
+ var _a;
262
+ return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
263
+ };
255
264
 
256
265
  function warn$1(msg, ...args) {
257
266
  console.warn(`[Vue warn] ${msg}`, ...args);
@@ -675,8 +684,13 @@ var Vue = (function () {
675
684
  return isReadonly2;
676
685
  } else if (key === "__v_isShallow") {
677
686
  return shallow;
678
- } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {
679
- return target;
687
+ } else if (key === "__v_raw") {
688
+ if (receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
689
+ // this means the reciever is a user proxy of the reactive proxy
690
+ Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
691
+ return target;
692
+ }
693
+ return;
680
694
  }
681
695
  const targetIsArray = isArray(target);
682
696
  if (!isReadonly2) {
@@ -1687,13 +1701,16 @@ var Vue = (function () {
1687
1701
  }
1688
1702
  queueFlush();
1689
1703
  }
1690
- function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
1704
+ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
1691
1705
  {
1692
1706
  seen = seen || /* @__PURE__ */ new Map();
1693
1707
  }
1694
1708
  for (; i < queue.length; i++) {
1695
1709
  const cb = queue[i];
1696
1710
  if (cb && cb.pre) {
1711
+ if (instance && cb.id !== instance.uid) {
1712
+ continue;
1713
+ }
1697
1714
  if (checkRecursiveUpdates(seen, cb)) {
1698
1715
  continue;
1699
1716
  }
@@ -3310,7 +3327,12 @@ If this is a native custom element, make sure to exclude it from component resol
3310
3327
  if (delayEnter) {
3311
3328
  activeBranch.transition.afterLeave = () => {
3312
3329
  if (pendingId === suspense.pendingId) {
3313
- move(pendingBranch, container2, anchor2, 0);
3330
+ move(
3331
+ pendingBranch,
3332
+ container2,
3333
+ next(activeBranch),
3334
+ 0
3335
+ );
3314
3336
  queuePostFlushCb(effects);
3315
3337
  }
3316
3338
  };
@@ -6207,7 +6229,7 @@ If this is a native custom element, make sure to exclude it from component resol
6207
6229
  return vm;
6208
6230
  }
6209
6231
  }
6210
- Vue.version = `2.6.14-compat:${"3.3.9"}`;
6232
+ Vue.version = `2.6.14-compat:${"3.3.11"}`;
6211
6233
  Vue.config = singletonApp.config;
6212
6234
  Vue.use = (p, ...options) => {
6213
6235
  if (p && isFunction(p.install)) {
@@ -8845,7 +8867,7 @@ If you want to remount the same app, move your app creation logic into a factory
8845
8867
  updateProps(instance, nextVNode.props, prevProps, optimized);
8846
8868
  updateSlots(instance, nextVNode.children, optimized);
8847
8869
  pauseTracking();
8848
- flushPreFlushCbs();
8870
+ flushPreFlushCbs(instance);
8849
8871
  resetTracking();
8850
8872
  };
8851
8873
  const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized = false) => {
@@ -10598,9 +10620,9 @@ Component that was made reactive: `,
10598
10620
  return;
10599
10621
  }
10600
10622
  const vueStyle = { style: "color:#3ba776" };
10601
- const numberStyle = { style: "color:#0b1bc9" };
10602
- const stringStyle = { style: "color:#b62e24" };
10603
- const keywordStyle = { style: "color:#9d288c" };
10623
+ const numberStyle = { style: "color:#1677ff" };
10624
+ const stringStyle = { style: "color:#f5222d" };
10625
+ const keywordStyle = { style: "color:#eb2f96" };
10604
10626
  const formatter = {
10605
10627
  header(obj) {
10606
10628
  if (!isObject(obj)) {
@@ -10794,7 +10816,7 @@ Component that was made reactive: `,
10794
10816
  return true;
10795
10817
  }
10796
10818
 
10797
- const version = "3.3.9";
10819
+ const version = "3.3.11";
10798
10820
  const ssrUtils = null;
10799
10821
  const resolveFilter = resolveFilter$1 ;
10800
10822
  const _compatUtils = {
@@ -11493,7 +11515,8 @@ Component that was made reactive: `,
11493
11515
  }
11494
11516
  }
11495
11517
 
11496
- const nativeOnRE = /^on[a-z]/;
11518
+ const isNativeOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter
11519
+ key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123;
11497
11520
  const patchProp = (el, key, prevValue, nextValue, isSVG = false, prevChildren, parentComponent, parentSuspense, unmountChildren) => {
11498
11521
  if (key === "class") {
11499
11522
  patchClass(el, nextValue, isSVG);
@@ -11527,7 +11550,7 @@ Component that was made reactive: `,
11527
11550
  if (key === "innerHTML" || key === "textContent") {
11528
11551
  return true;
11529
11552
  }
11530
- if (key in el && nativeOnRE.test(key) && isFunction(value)) {
11553
+ if (key in el && isNativeOn(key) && isFunction(value)) {
11531
11554
  return true;
11532
11555
  }
11533
11556
  return false;
@@ -11544,7 +11567,13 @@ Component that was made reactive: `,
11544
11567
  if (key === "type" && el.tagName === "TEXTAREA") {
11545
11568
  return false;
11546
11569
  }
11547
- if (nativeOnRE.test(key) && isString(value)) {
11570
+ if (key === "width" || key === "height") {
11571
+ const tag = el.tagName;
11572
+ if (tag === "IMG" || tag === "VIDEO" || tag === "CANVAS" || tag === "SOURCE") {
11573
+ return false;
11574
+ }
11575
+ }
11576
+ if (isNativeOn(key) && isString(value)) {
11548
11577
  return false;
11549
11578
  }
11550
11579
  return key in el;
@@ -12222,14 +12251,14 @@ Component that was made reactive: `,
12222
12251
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12223
12252
  };
12224
12253
  const withModifiers = (fn, modifiers) => {
12225
- return (event, ...args) => {
12254
+ return fn._withMods || (fn._withMods = (event, ...args) => {
12226
12255
  for (let i = 0; i < modifiers.length; i++) {
12227
12256
  const guard = modifierGuards[modifiers[i]];
12228
12257
  if (guard && guard(event, modifiers))
12229
12258
  return;
12230
12259
  }
12231
12260
  return fn(event, ...args);
12232
- };
12261
+ });
12233
12262
  };
12234
12263
  const keyNames = {
12235
12264
  esc: "escape",
@@ -12257,7 +12286,7 @@ Component that was made reactive: `,
12257
12286
  );
12258
12287
  }
12259
12288
  }
12260
- return (event) => {
12289
+ return fn._withKeys || (fn._withKeys = (event) => {
12261
12290
  if (!("key" in event)) {
12262
12291
  return;
12263
12292
  }
@@ -12285,7 +12314,7 @@ Component that was made reactive: `,
12285
12314
  }
12286
12315
  }
12287
12316
  }
12288
- };
12317
+ });
12289
12318
  };
12290
12319
 
12291
12320
  const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);