@vue/compat 3.6.0-rc.13 → 3.6.0-rc.14

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.6.0-rc.13
2
+ * @vue/compat v3.6.0-rc.14
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -516,6 +516,21 @@ function normalizeCssVarValue(value) {
516
516
  return String(value);
517
517
  }
518
518
  //#endregion
519
+ //#region packages/shared/src/vaporFlags.ts
520
+ /**
521
+ * The data of the comment a vapor server render opens the branch of a `v-if`
522
+ * chain with, `<!--[1-->`: the digits are the branch's position in the chain,
523
+ * and `<!--]-->` closes it like a fragment.
524
+ */
525
+ function isVaporBranchStart(data) {
526
+ if (data.length < 2 || data.charCodeAt(0) !== 91) return false;
527
+ for (let i = 1; i < data.length; i++) {
528
+ const c = data.charCodeAt(i);
529
+ if (c < 48 || c > 57) return false;
530
+ }
531
+ return true;
532
+ }
533
+ //#endregion
519
534
  //#region packages/reactivity/src/debug.ts
520
535
  const triggerEventInfos = [];
521
536
  function onTrack(sub, debugInfo) {
@@ -4413,6 +4428,8 @@ const getContainerType = (container) => {
4413
4428
  if (isMathMLContainer(container)) return "mathml";
4414
4429
  };
4415
4430
  const isComment = (node) => node.nodeType === 8;
4431
+ /** The data of a comment opening a range a hydration steps over as one. */
4432
+ const isRangeStart = (data) => data === "[" || data === "(" || isVaporBranchStart(data);
4416
4433
  function createHydrationFunctions(rendererInternals) {
4417
4434
  const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
4418
4435
  const hydrate = (vnode, container) => {
@@ -4430,7 +4447,7 @@ function createHydrationFunctions(rendererInternals) {
4430
4447
  };
4431
4448
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
4432
4449
  optimized = optimized || !!vnode.dynamicChildren;
4433
- const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
4450
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporBranchStart(node.data));
4434
4451
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
4435
4452
  const { type, ref, shapeFlag, patchFlag } = vnode;
4436
4453
  let domType = node.nodeType;
@@ -4628,7 +4645,7 @@ function createHydrationFunctions(rendererInternals) {
4628
4645
  };
4629
4646
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4630
4647
  if (!isNodeMismatchAllowed(node, vnode)) {
4631
- warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && (node.data === "[" || node.data === "(") ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
4648
+ warn$1(`Hydration node mismatch:\n- rendered on server:`, node, node.nodeType === 3 ? `(text)` : isComment(node) && isRangeStart(node.data) ? `(start of fragment)` : ``, `\n- expected on client:`, vnode.type);
4632
4649
  logMismatchError();
4633
4650
  }
4634
4651
  vnode.el = null;
@@ -4655,7 +4672,7 @@ function createHydrationFunctions(rendererInternals) {
4655
4672
  while (node) {
4656
4673
  node = nextSibling(node);
4657
4674
  if (node && isComment(node)) {
4658
- if (node.data === open) match++;
4675
+ if (node.data === open || isVaporInteropEnabled && open === "[" && isVaporBranchStart(node.data)) match++;
4659
4676
  if (node.data === close) {
4660
4677
  if (match === 0) return nextSibling(node);
4661
4678
  else match--;
@@ -4911,9 +4928,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4911
4928
  return teardown;
4912
4929
  };
4913
4930
  function forEachElement(node, cb) {
4914
- if (isComment(node) && (node.data === "[" || node.data === "(")) {
4931
+ if (isComment(node) && isRangeStart(node.data)) {
4915
4932
  const open = node.data;
4916
- const close = open === "[" ? "]" : ")";
4933
+ const close = open === "(" ? ")" : "]";
4917
4934
  let depth = 1;
4918
4935
  let next = node.nextSibling;
4919
4936
  while (next) {
@@ -4922,7 +4939,7 @@ function forEachElement(node, cb) {
4922
4939
  } else if (isComment(next)) {
4923
4940
  if (next.data === close) {
4924
4941
  if (--depth === 0) break;
4925
- } else if (next.data === open) depth++;
4942
+ } else if (close === "]" ? next.data === "[" || isVaporBranchStart(next.data) : next.data === open) depth++;
4926
4943
  }
4927
4944
  next = next.nextSibling;
4928
4945
  }
@@ -6672,7 +6689,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6672
6689
  if (options.el) return vm.$mount(options.el);
6673
6690
  else return vm;
6674
6691
  }
6675
- Vue.version = `2.6.14-compat:3.6.0-rc.13`;
6692
+ Vue.version = `2.6.14-compat:3.6.0-rc.14`;
6676
6693
  Vue.config = singletonApp.config;
6677
6694
  Vue.use = (plugin, ...options) => {
6678
6695
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -10231,7 +10248,7 @@ function isMemoSame(cached, memo) {
10231
10248
  }
10232
10249
  //#endregion
10233
10250
  //#region packages/runtime-core/src/index.ts
10234
- const version = "3.6.0-rc.13";
10251
+ const version = "3.6.0-rc.14";
10235
10252
  const warn = warn$1;
10236
10253
  /**
10237
10254
  * Runtime error messages. Only exposed in dev or esm builds.