@vue/compat 3.4.0-beta.3 → 3.4.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.
@@ -1964,8 +1964,10 @@ function checkRecursiveUpdates(seen, fn) {
1964
1964
  if (count > RECURSION_LIMIT) {
1965
1965
  const instance = fn.ownerInstance;
1966
1966
  const componentName = instance && getComponentName(instance.type);
1967
- warn(
1968
- `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.`
1967
+ handleError(
1968
+ `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.`,
1969
+ null,
1970
+ 10
1969
1971
  );
1970
1972
  return true;
1971
1973
  } else {
@@ -6517,7 +6519,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6517
6519
  return vm;
6518
6520
  }
6519
6521
  }
6520
- Vue.version = `2.6.14-compat:${"3.4.0-beta.3"}`;
6522
+ Vue.version = `2.6.14-compat:${"3.4.0-rc.1"}`;
6521
6523
  Vue.config = singletonApp.config;
6522
6524
  Vue.use = (p, ...options) => {
6523
6525
  if (p && isFunction(p.install)) {
@@ -8258,9 +8260,9 @@ function propHasMismatch(el, key, clientValue) {
8258
8260
  let actual;
8259
8261
  let expected;
8260
8262
  if (key === "class") {
8261
- actual = el.className;
8262
- expected = normalizeClass(clientValue);
8263
- if (actual !== expected) {
8263
+ actual = toClassSet(el.getAttribute("class") || "");
8264
+ expected = toClassSet(normalizeClass(clientValue));
8265
+ if (!isSetEqual(actual, expected)) {
8264
8266
  mismatchType = mismatchKey = `class`;
8265
8267
  }
8266
8268
  } else if (key === "style") {
@@ -8292,6 +8294,20 @@ function propHasMismatch(el, key, clientValue) {
8292
8294
  }
8293
8295
  return false;
8294
8296
  }
8297
+ function toClassSet(str) {
8298
+ return new Set(str.trim().split(/\s+/));
8299
+ }
8300
+ function isSetEqual(a, b) {
8301
+ if (a.size !== b.size) {
8302
+ return false;
8303
+ }
8304
+ for (const s of a) {
8305
+ if (!b.has(s)) {
8306
+ return false;
8307
+ }
8308
+ }
8309
+ return true;
8310
+ }
8295
8311
 
8296
8312
  let supported;
8297
8313
  let perf;
@@ -11305,7 +11321,7 @@ function isMemoSame(cached, memo) {
11305
11321
  return true;
11306
11322
  }
11307
11323
 
11308
- const version = "3.4.0-beta.3";
11324
+ const version = "3.4.0-rc.1";
11309
11325
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11310
11326
  const _ssrUtils = {
11311
11327
  createComponentInstance,
@@ -12813,7 +12829,9 @@ const modifierGuards = {
12813
12829
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12814
12830
  };
12815
12831
  const withModifiers = (fn, modifiers) => {
12816
- return fn._withMods || (fn._withMods = (event, ...args) => {
12832
+ const cache = fn._withMods || (fn._withMods = {});
12833
+ const cacheKey = modifiers.join(".");
12834
+ return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
12817
12835
  for (let i = 0; i < modifiers.length; i++) {
12818
12836
  const guard = modifierGuards[modifiers[i]];
12819
12837
  if (guard && guard(event, modifiers))
@@ -12848,7 +12866,9 @@ const withKeys = (fn, modifiers) => {
12848
12866
  );
12849
12867
  }
12850
12868
  }
12851
- return fn._withKeys || (fn._withKeys = (event) => {
12869
+ const cache = fn._withKeys || (fn._withKeys = {});
12870
+ const cacheKey = modifiers.join(".");
12871
+ return cache[cacheKey] || (cache[cacheKey] = (event) => {
12852
12872
  if (!("key" in event)) {
12853
12873
  return;
12854
12874
  }
@@ -14687,12 +14707,6 @@ const tokenizer = new Tokenizer(stack, {
14687
14707
  loc: getLoc(start - 1, end),
14688
14708
  codegenNode: void 0
14689
14709
  };
14690
- if (tokenizer.inSFCRoot) {
14691
- currentOpenTag.innerLoc = getLoc(
14692
- end + fastForward(end) + 1,
14693
- end
14694
- );
14695
- }
14696
14710
  },
14697
14711
  onopentagend(end) {
14698
14712
  endOpenTag(end);
@@ -15017,6 +15031,9 @@ function getSlice(start, end) {
15017
15031
  return currentInput.slice(start, end);
15018
15032
  }
15019
15033
  function endOpenTag(end) {
15034
+ if (tokenizer.inSFCRoot) {
15035
+ currentOpenTag.innerLoc = getLoc(end + 1, end + 1);
15036
+ }
15020
15037
  addNode(currentOpenTag);
15021
15038
  const { tag, ns } = currentOpenTag;
15022
15039
  if (ns === 0 && currentOptions.isPreTag(tag)) {
@@ -15057,7 +15074,7 @@ function onCloseTag(el, end, isImplied = false) {
15057
15074
  if (isImplied) {
15058
15075
  setLocEnd(el.loc, backTrack(end, 60));
15059
15076
  } else {
15060
- setLocEnd(el.loc, end + fastForward(end) + 1);
15077
+ setLocEnd(el.loc, end + 1);
15061
15078
  }
15062
15079
  if (tokenizer.inSFCRoot) {
15063
15080
  if (el.children.length) {
@@ -15152,13 +15169,6 @@ function onCloseTag(el, end, isImplied = false) {
15152
15169
  }
15153
15170
  }
15154
15171
  }
15155
- function fastForward(start, c) {
15156
- let offset = 0;
15157
- while (currentInput.charCodeAt(start + offset) !== 62 && start + offset < currentInput.length) {
15158
- offset++;
15159
- }
15160
- return offset;
15161
- }
15162
15172
  function backTrack(index, c) {
15163
15173
  let i = index;
15164
15174
  while (currentInput.charCodeAt(i) !== c && i >= 0)
@@ -1961,8 +1961,10 @@ var Vue = (function () {
1961
1961
  if (count > RECURSION_LIMIT) {
1962
1962
  const instance = fn.ownerInstance;
1963
1963
  const componentName = instance && getComponentName(instance.type);
1964
- warn(
1965
- `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.`
1964
+ handleError(
1965
+ `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.`,
1966
+ null,
1967
+ 10
1966
1968
  );
1967
1969
  return true;
1968
1970
  } else {
@@ -6480,7 +6482,7 @@ If this is a native custom element, make sure to exclude it from component resol
6480
6482
  return vm;
6481
6483
  }
6482
6484
  }
6483
- Vue.version = `2.6.14-compat:${"3.4.0-beta.3"}`;
6485
+ Vue.version = `2.6.14-compat:${"3.4.0-rc.1"}`;
6484
6486
  Vue.config = singletonApp.config;
6485
6487
  Vue.use = (p, ...options) => {
6486
6488
  if (p && isFunction(p.install)) {
@@ -8208,9 +8210,9 @@ Server rendered element contains fewer child nodes than client vdom.`
8208
8210
  let actual;
8209
8211
  let expected;
8210
8212
  if (key === "class") {
8211
- actual = el.className;
8212
- expected = normalizeClass(clientValue);
8213
- if (actual !== expected) {
8213
+ actual = toClassSet(el.getAttribute("class") || "");
8214
+ expected = toClassSet(normalizeClass(clientValue));
8215
+ if (!isSetEqual(actual, expected)) {
8214
8216
  mismatchType = mismatchKey = `class`;
8215
8217
  }
8216
8218
  } else if (key === "style") {
@@ -8242,6 +8244,20 @@ Server rendered element contains fewer child nodes than client vdom.`
8242
8244
  }
8243
8245
  return false;
8244
8246
  }
8247
+ function toClassSet(str) {
8248
+ return new Set(str.trim().split(/\s+/));
8249
+ }
8250
+ function isSetEqual(a, b) {
8251
+ if (a.size !== b.size) {
8252
+ return false;
8253
+ }
8254
+ for (const s of a) {
8255
+ if (!b.has(s)) {
8256
+ return false;
8257
+ }
8258
+ }
8259
+ return true;
8260
+ }
8245
8261
 
8246
8262
  let supported;
8247
8263
  let perf;
@@ -11178,7 +11194,7 @@ Component that was made reactive: `,
11178
11194
  return true;
11179
11195
  }
11180
11196
 
11181
- const version = "3.4.0-beta.3";
11197
+ const version = "3.4.0-rc.1";
11182
11198
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11183
11199
  const ssrUtils = null;
11184
11200
  const resolveFilter = resolveFilter$1 ;
@@ -12625,7 +12641,9 @@ Component that was made reactive: `,
12625
12641
  exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m))
12626
12642
  };
12627
12643
  const withModifiers = (fn, modifiers) => {
12628
- return fn._withMods || (fn._withMods = (event, ...args) => {
12644
+ const cache = fn._withMods || (fn._withMods = {});
12645
+ const cacheKey = modifiers.join(".");
12646
+ return cache[cacheKey] || (cache[cacheKey] = (event, ...args) => {
12629
12647
  for (let i = 0; i < modifiers.length; i++) {
12630
12648
  const guard = modifierGuards[modifiers[i]];
12631
12649
  if (guard && guard(event, modifiers))
@@ -12660,7 +12678,9 @@ Component that was made reactive: `,
12660
12678
  );
12661
12679
  }
12662
12680
  }
12663
- return fn._withKeys || (fn._withKeys = (event) => {
12681
+ const cache = fn._withKeys || (fn._withKeys = {});
12682
+ const cacheKey = modifiers.join(".");
12683
+ return cache[cacheKey] || (cache[cacheKey] = (event) => {
12664
12684
  if (!("key" in event)) {
12665
12685
  return;
12666
12686
  }
@@ -14498,12 +14518,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14498
14518
  loc: getLoc(start - 1, end),
14499
14519
  codegenNode: void 0
14500
14520
  };
14501
- if (tokenizer.inSFCRoot) {
14502
- currentOpenTag.innerLoc = getLoc(
14503
- end + fastForward(end) + 1,
14504
- end
14505
- );
14506
- }
14507
14521
  },
14508
14522
  onopentagend(end) {
14509
14523
  endOpenTag(end);
@@ -14828,6 +14842,9 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14828
14842
  return currentInput.slice(start, end);
14829
14843
  }
14830
14844
  function endOpenTag(end) {
14845
+ if (tokenizer.inSFCRoot) {
14846
+ currentOpenTag.innerLoc = getLoc(end + 1, end + 1);
14847
+ }
14831
14848
  addNode(currentOpenTag);
14832
14849
  const { tag, ns } = currentOpenTag;
14833
14850
  if (ns === 0 && currentOptions.isPreTag(tag)) {
@@ -14868,7 +14885,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14868
14885
  if (isImplied) {
14869
14886
  setLocEnd(el.loc, backTrack(end, 60));
14870
14887
  } else {
14871
- setLocEnd(el.loc, end + fastForward(end) + 1);
14888
+ setLocEnd(el.loc, end + 1);
14872
14889
  }
14873
14890
  if (tokenizer.inSFCRoot) {
14874
14891
  if (el.children.length) {
@@ -14963,13 +14980,6 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
14963
14980
  }
14964
14981
  }
14965
14982
  }
14966
- function fastForward(start, c) {
14967
- let offset = 0;
14968
- while (currentInput.charCodeAt(start + offset) !== 62 && start + offset < currentInput.length) {
14969
- offset++;
14970
- }
14971
- return offset;
14972
- }
14973
14983
  function backTrack(index, c) {
14974
14984
  let i = index;
14975
14985
  while (currentInput.charCodeAt(i) !== c && i >= 0)