@vue/compat 3.5.3 → 3.5.5

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.3
2
+ * @vue/compat v3.5.5
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -8,9 +8,10 @@ var Vue = (function () {
8
8
 
9
9
  /*! #__NO_SIDE_EFFECTS__ */
10
10
  // @__NO_SIDE_EFFECTS__
11
- function makeMap(str, expectsLowerCase) {
12
- const set = new Set(str.split(","));
13
- return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
11
+ function makeMap(str) {
12
+ const map = /* @__PURE__ */ Object.create(null);
13
+ for (const key of str.split(",")) map[key] = 1;
14
+ return (val) => val in map;
14
15
  }
15
16
 
16
17
  const EMPTY_OBJ = Object.freeze({}) ;
@@ -665,9 +666,11 @@ var Vue = (function () {
665
666
  function cleanupDeps(sub) {
666
667
  let head;
667
668
  let tail = sub.depsTail;
668
- for (let link = tail; link; link = link.prevDep) {
669
+ let link = tail;
670
+ while (link) {
671
+ const prev = link.prevDep;
669
672
  if (link.version === -1) {
670
- if (link === tail) tail = link.prevDep;
673
+ if (link === tail) tail = prev;
671
674
  removeSub(link);
672
675
  removeDep(link);
673
676
  } else {
@@ -675,13 +678,14 @@ var Vue = (function () {
675
678
  }
676
679
  link.dep.activeLink = link.prevActiveLink;
677
680
  link.prevActiveLink = void 0;
681
+ link = prev;
678
682
  }
679
683
  sub.deps = head;
680
684
  sub.depsTail = tail;
681
685
  }
682
686
  function isDirty(sub) {
683
687
  for (let link = sub.deps; link; link = link.nextDep) {
684
- if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) === false || link.dep.version !== link.version) {
688
+ if (link.dep.version !== link.version || link.dep.computed && refreshComputed(link.dep.computed) || link.dep.version !== link.version) {
685
689
  return true;
686
690
  }
687
691
  }
@@ -691,9 +695,6 @@ var Vue = (function () {
691
695
  return false;
692
696
  }
693
697
  function refreshComputed(computed) {
694
- if (computed.flags & 2) {
695
- return false;
696
- }
697
698
  if (computed.flags & 4 && !(computed.flags & 16)) {
698
699
  return;
699
700
  }
@@ -806,6 +807,14 @@ var Vue = (function () {
806
807
  }
807
808
 
808
809
  let globalVersion = 0;
810
+ class Link {
811
+ constructor(sub, dep) {
812
+ this.sub = sub;
813
+ this.dep = dep;
814
+ this.version = dep.version;
815
+ this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
816
+ }
817
+ }
809
818
  class Dep {
810
819
  constructor(computed) {
811
820
  this.computed = computed;
@@ -828,16 +837,7 @@ var Vue = (function () {
828
837
  }
829
838
  let link = this.activeLink;
830
839
  if (link === void 0 || link.sub !== activeSub) {
831
- link = this.activeLink = {
832
- dep: this,
833
- sub: activeSub,
834
- version: this.version,
835
- nextDep: void 0,
836
- prevDep: void 0,
837
- nextSub: void 0,
838
- prevSub: void 0,
839
- prevActiveLink: void 0
840
- };
840
+ link = this.activeLink = new Link(activeSub, this);
841
841
  if (!activeSub.deps) {
842
842
  activeSub.deps = activeSub.depsTail = link;
843
843
  } else {
@@ -960,9 +960,23 @@ var Vue = (function () {
960
960
  globalVersion++;
961
961
  return;
962
962
  }
963
- let deps = [];
963
+ const run = (dep) => {
964
+ if (dep) {
965
+ {
966
+ dep.trigger({
967
+ target,
968
+ type,
969
+ key,
970
+ newValue,
971
+ oldValue,
972
+ oldTarget
973
+ });
974
+ }
975
+ }
976
+ };
977
+ startBatch();
964
978
  if (type === "clear") {
965
- deps = [...depsMap.values()];
979
+ depsMap.forEach(run);
966
980
  } else {
967
981
  const targetIsArray = isArray(target);
968
982
  const isArrayIndex = targetIsArray && isIntegerKey(key);
@@ -970,57 +984,43 @@ var Vue = (function () {
970
984
  const newLength = Number(newValue);
971
985
  depsMap.forEach((dep, key2) => {
972
986
  if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) {
973
- deps.push(dep);
987
+ run(dep);
974
988
  }
975
989
  });
976
990
  } else {
977
- const push = (dep) => dep && deps.push(dep);
978
991
  if (key !== void 0) {
979
- push(depsMap.get(key));
992
+ run(depsMap.get(key));
980
993
  }
981
994
  if (isArrayIndex) {
982
- push(depsMap.get(ARRAY_ITERATE_KEY));
995
+ run(depsMap.get(ARRAY_ITERATE_KEY));
983
996
  }
984
997
  switch (type) {
985
998
  case "add":
986
999
  if (!targetIsArray) {
987
- push(depsMap.get(ITERATE_KEY));
1000
+ run(depsMap.get(ITERATE_KEY));
988
1001
  if (isMap(target)) {
989
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
1002
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
990
1003
  }
991
1004
  } else if (isArrayIndex) {
992
- push(depsMap.get("length"));
1005
+ run(depsMap.get("length"));
993
1006
  }
994
1007
  break;
995
1008
  case "delete":
996
1009
  if (!targetIsArray) {
997
- push(depsMap.get(ITERATE_KEY));
1010
+ run(depsMap.get(ITERATE_KEY));
998
1011
  if (isMap(target)) {
999
- push(depsMap.get(MAP_KEY_ITERATE_KEY));
1012
+ run(depsMap.get(MAP_KEY_ITERATE_KEY));
1000
1013
  }
1001
1014
  }
1002
1015
  break;
1003
1016
  case "set":
1004
1017
  if (isMap(target)) {
1005
- push(depsMap.get(ITERATE_KEY));
1018
+ run(depsMap.get(ITERATE_KEY));
1006
1019
  }
1007
1020
  break;
1008
1021
  }
1009
1022
  }
1010
1023
  }
1011
- startBatch();
1012
- for (const dep of deps) {
1013
- {
1014
- dep.trigger({
1015
- target,
1016
- type,
1017
- key,
1018
- newValue,
1019
- oldValue,
1020
- oldTarget
1021
- });
1022
- }
1023
- }
1024
1024
  endBatch();
1025
1025
  }
1026
1026
  function getDepFromReactive(object, key) {
@@ -1758,7 +1758,7 @@ var Vue = (function () {
1758
1758
  return raw ? toRaw(raw) : observed;
1759
1759
  }
1760
1760
  function markRaw(value) {
1761
- if (Object.isExtensible(value)) {
1761
+ if (!hasOwn(value, "__v_skip") && Object.isExtensible(value)) {
1762
1762
  def(value, "__v_skip", true);
1763
1763
  }
1764
1764
  return value;
@@ -1968,8 +1968,8 @@ var Vue = (function () {
1968
1968
  * @internal
1969
1969
  */
1970
1970
  notify() {
1971
+ this.flags |= 16;
1971
1972
  if (activeSub !== this) {
1972
- this.flags |= 16;
1973
1973
  this.dep.notify();
1974
1974
  }
1975
1975
  }
@@ -2657,23 +2657,19 @@ var Vue = (function () {
2657
2657
  }
2658
2658
  }
2659
2659
  function checkRecursiveUpdates(seen, fn) {
2660
- if (!seen.has(fn)) {
2661
- seen.set(fn, 1);
2662
- } else {
2663
- const count = seen.get(fn);
2664
- if (count > RECURSION_LIMIT) {
2665
- const instance = fn.i;
2666
- const componentName = instance && getComponentName(instance.type);
2667
- handleError(
2668
- `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
2669
- null,
2670
- 10
2671
- );
2672
- return true;
2673
- } else {
2674
- seen.set(fn, count + 1);
2675
- }
2660
+ const count = seen.get(fn) || 0;
2661
+ if (count > RECURSION_LIMIT) {
2662
+ const instance = fn.i;
2663
+ const componentName = instance && getComponentName(instance.type);
2664
+ handleError(
2665
+ `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
2666
+ null,
2667
+ 10
2668
+ );
2669
+ return true;
2676
2670
  }
2671
+ seen.set(fn, count + 1);
2672
+ return false;
2677
2673
  }
2678
2674
 
2679
2675
  let isHmrUpdating = false;
@@ -2754,7 +2750,9 @@ var Vue = (function () {
2754
2750
  dirtyInstances.delete(instance);
2755
2751
  } else if (instance.parent) {
2756
2752
  queueJob(() => {
2753
+ isHmrUpdating = true;
2757
2754
  instance.parent.update();
2755
+ isHmrUpdating = false;
2758
2756
  dirtyInstances.delete(instance);
2759
2757
  });
2760
2758
  } else if (instance.appContext.reload) {
@@ -3573,6 +3571,9 @@ Details: https://v3-migration.vuejs.org/breaking-changes/migration-build.html`
3573
3571
  insert(mainAnchor, container, anchor);
3574
3572
  const mount = (container2, anchor2) => {
3575
3573
  if (shapeFlag & 16) {
3574
+ if (parentComponent && parentComponent.isCE) {
3575
+ parentComponent.ce._teleportTarget = container2;
3576
+ }
3576
3577
  mountChildren(
3577
3578
  children,
3578
3579
  container2,
@@ -4606,7 +4607,11 @@ Server rendered element contains more child nodes than client vdom.`
4606
4607
  remove(cur);
4607
4608
  }
4608
4609
  } else if (shapeFlag & 8) {
4609
- if (el.textContent !== vnode.children) {
4610
+ let clientText = vnode.children;
4611
+ if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4612
+ clientText = clientText.slice(1);
4613
+ }
4614
+ if (el.textContent !== clientText) {
4610
4615
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4611
4616
  warn$1(
4612
4617
  `Hydration text content mismatch on`,
@@ -4805,7 +4810,7 @@ Server rendered element contains fewer child nodes than client vdom.`
4805
4810
  }
4806
4811
  };
4807
4812
  const isTemplateNode = (node) => {
4808
- return node.nodeType === 1 && node.tagName.toLowerCase() === "template";
4813
+ return node.nodeType === 1 && node.tagName === "TEMPLATE";
4809
4814
  };
4810
4815
  return [hydrate, hydrateNode];
4811
4816
  }
@@ -5157,7 +5162,7 @@ Server rendered element contains fewer child nodes than client vdom.`
5157
5162
  load().then(() => {
5158
5163
  loaded.value = true;
5159
5164
  if (instance.parent && isKeepAlive(instance.parent.vnode)) {
5160
- queueJob(instance.parent.update);
5165
+ instance.parent.update();
5161
5166
  }
5162
5167
  }).catch((err) => {
5163
5168
  onError(err);
@@ -5843,13 +5848,15 @@ If this is a native custom element, make sure to exclude it from component resol
5843
5848
  const sourceIsArray = isArray(source);
5844
5849
  if (sourceIsArray || isString(source)) {
5845
5850
  const sourceIsReactiveArray = sourceIsArray && isReactive(source);
5851
+ let needsWrap = false;
5846
5852
  if (sourceIsReactiveArray) {
5853
+ needsWrap = !isShallow(source);
5847
5854
  source = shallowReadArray(source);
5848
5855
  }
5849
5856
  ret = new Array(source.length);
5850
5857
  for (let i = 0, l = source.length; i < l; i++) {
5851
5858
  ret[i] = renderItem(
5852
- sourceIsReactiveArray ? toReactive(source[i]) : source[i],
5859
+ needsWrap ? toReactive(source[i]) : source[i],
5853
5860
  i,
5854
5861
  void 0,
5855
5862
  cached && cached[i]
@@ -7097,7 +7104,7 @@ If this is a native custom element, make sure to exclude it from component resol
7097
7104
  return vm;
7098
7105
  }
7099
7106
  }
7100
- Vue.version = `2.6.14-compat:${"3.5.3"}`;
7107
+ Vue.version = `2.6.14-compat:${"3.5.5"}`;
7101
7108
  Vue.config = singletonApp.config;
7102
7109
  Vue.use = (plugin, ...options) => {
7103
7110
  if (plugin && isFunction(plugin.install)) {
@@ -8919,6 +8926,7 @@ If you want to remount the same app, move your app creation logic into a factory
8919
8926
  }
8920
8927
  }
8921
8928
  if (instance.asyncDep) {
8929
+ if (isHmrUpdating) initialVNode.el = null;
8922
8930
  parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized);
8923
8931
  if (!initialVNode.el) {
8924
8932
  const placeholder = instance.subTree = createVNode(Comment);
@@ -12174,7 +12182,7 @@ Component that was made reactive: `,
12174
12182
  return true;
12175
12183
  }
12176
12184
 
12177
- const version = "3.5.3";
12185
+ const version = "3.5.5";
12178
12186
  const warn = warn$1 ;
12179
12187
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
12180
12188
  const devtools = devtools$1 ;
@@ -13143,6 +13151,7 @@ Expected function or array of functions, received type ${typeof value}.`
13143
13151
  }
13144
13152
  }
13145
13153
  connectedCallback() {
13154
+ if (!this.isConnected) return;
13146
13155
  if (!this.shadowRoot) {
13147
13156
  this._parseSlots();
13148
13157
  }
@@ -13185,7 +13194,7 @@ Expected function or array of functions, received type ${typeof value}.`
13185
13194
  this._ob = null;
13186
13195
  }
13187
13196
  this._app && this._app.unmount();
13188
- this._instance.ce = void 0;
13197
+ if (this._instance) this._instance.ce = void 0;
13189
13198
  this._app = this._instance = null;
13190
13199
  }
13191
13200
  });
@@ -13404,7 +13413,7 @@ Expected function or array of functions, received type ${typeof value}.`
13404
13413
  }
13405
13414
  }
13406
13415
  /**
13407
- * Only called when shaddowRoot is false
13416
+ * Only called when shadowRoot is false
13408
13417
  */
13409
13418
  _parseSlots() {
13410
13419
  const slots = this._slots = {};
@@ -13416,10 +13425,10 @@ Expected function or array of functions, received type ${typeof value}.`
13416
13425
  }
13417
13426
  }
13418
13427
  /**
13419
- * Only called when shaddowRoot is false
13428
+ * Only called when shadowRoot is false
13420
13429
  */
13421
13430
  _renderSlots() {
13422
- const outlets = this.querySelectorAll("slot");
13431
+ const outlets = (this._teleportTarget || this).querySelectorAll("slot");
13423
13432
  const scopeId = this._instance.type.__scopeId;
13424
13433
  for (let i = 0; i < outlets.length; i++) {
13425
13434
  const o = outlets[i];
@@ -13595,7 +13604,7 @@ Expected function or array of functions, received type ${typeof value}.`
13595
13604
  child,
13596
13605
  resolveTransitionHooks(child, cssTransitionProps, state, instance)
13597
13606
  );
13598
- } else {
13607
+ } else if (child.type !== Text) {
13599
13608
  warn(`<TransitionGroup> children must be keyed.`);
13600
13609
  }
13601
13610
  }
@@ -14796,7 +14805,7 @@ Make sure to use the production build (*.prod.js) when deploying for production.
14796
14805
  this.sequenceIndex += 1;
14797
14806
  } else if (this.sequenceIndex === 0) {
14798
14807
  if (this.currentSequence === Sequences.TitleEnd || this.currentSequence === Sequences.TextareaEnd && !this.inSFCRoot) {
14799
- if (c === this.delimiterOpen[0]) {
14808
+ if (!this.inVPre && c === this.delimiterOpen[0]) {
14800
14809
  this.state = 2;
14801
14810
  this.delimiterIndex = 0;
14802
14811
  this.stateInterpolationOpen(c);
@@ -15766,6 +15775,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
15766
15775
  getNamespace: () => 0,
15767
15776
  isVoidTag: NO,
15768
15777
  isPreTag: NO,
15778
+ isIgnoreNewlineTag: NO,
15769
15779
  isCustomElement: NO,
15770
15780
  onError: defaultOnError,
15771
15781
  onWarn: defaultOnWarn,
@@ -16208,7 +16218,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16208
16218
  el.innerLoc.end.offset
16209
16219
  );
16210
16220
  }
16211
- const { tag, ns } = el;
16221
+ const { tag, ns, children } = el;
16212
16222
  if (!inVPre) {
16213
16223
  if (tag === "slot") {
16214
16224
  el.tagType = 2;
@@ -16219,7 +16229,13 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16219
16229
  }
16220
16230
  }
16221
16231
  if (!tokenizer.inRCDATA) {
16222
- el.children = condenseWhitespace(el.children, el.tag);
16232
+ el.children = condenseWhitespace(children);
16233
+ }
16234
+ if (ns === 0 && currentOptions.isIgnoreNewlineTag(tag)) {
16235
+ const first = children[0];
16236
+ if (first && first.type === 2) {
16237
+ first.content = first.content.replace(/^\r?\n/, "");
16238
+ }
16223
16239
  }
16224
16240
  if (ns === 0 && currentOptions.isPreTag(tag)) {
16225
16241
  inPre--;
@@ -16371,12 +16387,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16371
16387
  }
16372
16388
  }
16373
16389
  }
16374
- if (inPre && tag && currentOptions.isPreTag(tag)) {
16375
- const first = nodes[0];
16376
- if (first && first.type === 2) {
16377
- first.content = first.content.replace(/^\r?\n/, "");
16378
- }
16379
- }
16380
16390
  return removedWhitespace ? nodes.filter(Boolean) : nodes;
16381
16391
  }
16382
16392
  function isAllWhitespace(str) {
@@ -16984,10 +16994,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
16984
16994
  }
16985
16995
  } else if (children.length > 1) {
16986
16996
  let patchFlag = 64;
16987
- let patchFlagText = PatchFlagNames[64];
16988
16997
  if (children.filter((c) => c.type !== 3).length === 1) {
16989
16998
  patchFlag |= 2048;
16990
- patchFlagText += `, ${PatchFlagNames[2048]}`;
16991
16999
  }
16992
17000
  root.codegenNode = createVNodeCall(
16993
17001
  context,
@@ -17895,10 +17903,8 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
17895
17903
  return vnodeCall;
17896
17904
  } else {
17897
17905
  let patchFlag = 64;
17898
- let patchFlagText = PatchFlagNames[64];
17899
17906
  if (!branch.isTemplateIf && children.filter((c) => c.type !== 3).length === 1) {
17900
17907
  patchFlag |= 2048;
17901
- patchFlagText += `, ${PatchFlagNames[2048]}`;
17902
17908
  }
17903
17909
  return createVNodeCall(
17904
17910
  context,
@@ -19646,6 +19652,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19646
19652
  isVoidTag,
19647
19653
  isNativeTag: (tag) => isHTMLTag(tag) || isSVGTag(tag) || isMathMLTag(tag),
19648
19654
  isPreTag: (tag) => tag === "pre",
19655
+ isIgnoreNewlineTag: (tag) => tag === "pre" || tag === "textarea",
19649
19656
  decodeEntities: decodeHtmlBrowser ,
19650
19657
  isBuiltInComponent: (tag) => {
19651
19658
  if (tag === "Transition" || tag === "transition") {
@@ -19873,10 +19880,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19873
19880
  `stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
19874
19881
  );
19875
19882
  const maybeKeyModifier = /* @__PURE__ */ makeMap("left,right");
19876
- const isKeyboardEvent = /* @__PURE__ */ makeMap(
19877
- `onkeyup,onkeydown,onkeypress`,
19878
- true
19879
- );
19883
+ const isKeyboardEvent = /* @__PURE__ */ makeMap(`onkeyup,onkeydown,onkeypress`);
19880
19884
  const resolveModifiers = (key, modifiers, context, loc) => {
19881
19885
  const keyModifiers = [];
19882
19886
  const nonKeyModifiers = [];
@@ -19894,7 +19898,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19894
19898
  } else {
19895
19899
  if (maybeKeyModifier(modifier)) {
19896
19900
  if (isStaticExp(key)) {
19897
- if (isKeyboardEvent(key.content)) {
19901
+ if (isKeyboardEvent(key.content.toLowerCase())) {
19898
19902
  keyModifiers.push(modifier);
19899
19903
  } else {
19900
19904
  nonKeyModifiers.push(modifier);
@@ -19947,7 +19951,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
19947
19951
  ]);
19948
19952
  }
19949
19953
  if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
19950
- (!isStaticExp(key) || isKeyboardEvent(key.content))) {
19954
+ (!isStaticExp(key) || isKeyboardEvent(key.content.toLowerCase()))) {
19951
19955
  handlerExp = createCallExpression(context.helper(V_ON_WITH_KEYS), [
19952
19956
  handlerExp,
19953
19957
  JSON.stringify(keyModifiers)