@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.
package/dist/vue.cjs.js CHANGED
@@ -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
  **/
@@ -561,6 +561,21 @@ function normalizeCssVarValue(value) {
561
561
  return String(value);
562
562
  }
563
563
  //#endregion
564
+ //#region packages/shared/src/vaporFlags.ts
565
+ /**
566
+ * The data of the comment a vapor server render opens the branch of a `v-if`
567
+ * chain with, `<!--[1-->`: the digits are the branch's position in the chain,
568
+ * and `<!--]-->` closes it like a fragment.
569
+ */
570
+ function isVaporBranchStart(data) {
571
+ if (data.length < 2 || data.charCodeAt(0) !== 91) return false;
572
+ for (let i = 1; i < data.length; i++) {
573
+ const c = data.charCodeAt(i);
574
+ if (c < 48 || c > 57) return false;
575
+ }
576
+ return true;
577
+ }
578
+ //#endregion
564
579
  //#region packages/reactivity/src/debug.ts
565
580
  const triggerEventInfos = [];
566
581
  function onTrack(sub, debugInfo) {
@@ -4476,6 +4491,8 @@ const getContainerType = (container) => {
4476
4491
  if (isMathMLContainer(container)) return "mathml";
4477
4492
  };
4478
4493
  const isComment = (node) => node.nodeType === 8;
4494
+ /** The data of a comment opening a range a hydration steps over as one. */
4495
+ const isRangeStart = (data) => data === "[" || data === "(" || isVaporBranchStart(data);
4479
4496
  function createHydrationFunctions(rendererInternals) {
4480
4497
  const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
4481
4498
  const hydrate = (vnode, container) => {
@@ -4493,7 +4510,7 @@ function createHydrationFunctions(rendererInternals) {
4493
4510
  };
4494
4511
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
4495
4512
  optimized = optimized || !!vnode.dynamicChildren;
4496
- const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
4513
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporBranchStart(node.data));
4497
4514
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
4498
4515
  const { type, ref, shapeFlag, patchFlag } = vnode;
4499
4516
  let domType = node.nodeType;
@@ -4691,7 +4708,7 @@ function createHydrationFunctions(rendererInternals) {
4691
4708
  };
4692
4709
  const handleMismatch = (node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragment) => {
4693
4710
  if (!isNodeMismatchAllowed(node, vnode)) {
4694
- 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);
4711
+ 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);
4695
4712
  logMismatchError();
4696
4713
  }
4697
4714
  vnode.el = null;
@@ -4718,7 +4735,7 @@ function createHydrationFunctions(rendererInternals) {
4718
4735
  while (node) {
4719
4736
  node = nextSibling(node);
4720
4737
  if (node && isComment(node)) {
4721
- if (node.data === open) match++;
4738
+ if (node.data === open || isVaporInteropEnabled && open === "[" && isVaporBranchStart(node.data)) match++;
4722
4739
  if (node.data === close) {
4723
4740
  if (match === 0) return nextSibling(node);
4724
4741
  else match--;
@@ -4974,9 +4991,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4974
4991
  return teardown;
4975
4992
  };
4976
4993
  function forEachElement(node, cb) {
4977
- if (isComment(node) && (node.data === "[" || node.data === "(")) {
4994
+ if (isComment(node) && isRangeStart(node.data)) {
4978
4995
  const open = node.data;
4979
- const close = open === "[" ? "]" : ")";
4996
+ const close = open === "(" ? ")" : "]";
4980
4997
  let depth = 1;
4981
4998
  let next = node.nextSibling;
4982
4999
  while (next) {
@@ -4985,7 +5002,7 @@ function forEachElement(node, cb) {
4985
5002
  } else if (isComment(next)) {
4986
5003
  if (next.data === close) {
4987
5004
  if (--depth === 0) break;
4988
- } else if (next.data === open) depth++;
5005
+ } else if (close === "]" ? next.data === "[" || isVaporBranchStart(next.data) : next.data === open) depth++;
4989
5006
  }
4990
5007
  next = next.nextSibling;
4991
5008
  }
@@ -6757,7 +6774,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6757
6774
  if (options.el) return vm.$mount(options.el);
6758
6775
  else return vm;
6759
6776
  }
6760
- Vue.version = `2.6.14-compat:3.6.0-rc.13`;
6777
+ Vue.version = `2.6.14-compat:3.6.0-rc.14`;
6761
6778
  Vue.config = singletonApp.config;
6762
6779
  Vue.use = (plugin, ...options) => {
6763
6780
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -10327,7 +10344,7 @@ function isMemoSame(cached, memo) {
10327
10344
  }
10328
10345
  //#endregion
10329
10346
  //#region packages/runtime-core/src/index.ts
10330
- const version = "3.6.0-rc.13";
10347
+ const version = "3.6.0-rc.14";
10331
10348
  const warn = warn$1;
10332
10349
  /**
10333
10350
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -14118,7 +14135,15 @@ const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
14118
14135
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
14119
14136
  const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
14120
14137
  const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
14138
+ const asciiIdentifierRE = /^[A-Za-z_$][\w$]*$/;
14139
+ const isReservedWord = /*@__PURE__*/ makeMap("await,break,case,catch,class,const,continue,debugger,default,delete,do,else,enum,export,extends,false,finally,for,function,if,implements,import,in,instanceof,interface,let,new,null,package,private,protected,public,return,static,super,switch,this,throw,true,try,typeof,undefined,var,void,while,with,yield");
14140
+ const isUnparsedIdentifier = (exp) => {
14141
+ if (exp.ast !== null) return false;
14142
+ const content = getExpSource(exp);
14143
+ return asciiIdentifierRE.test(content) && !isReservedWord(content);
14144
+ };
14121
14145
  const isMemberExpressionNode = (exp, context) => {
14146
+ if (isUnparsedIdentifier(exp)) return true;
14122
14147
  try {
14123
14148
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
14124
14149
  ret = unwrapTSNode(ret);
@@ -14129,6 +14154,7 @@ const isMemberExpressionNode = (exp, context) => {
14129
14154
  };
14130
14155
  const isMemberExpression = isMemberExpressionNode;
14131
14156
  const isFnExpressionNode = (exp, context) => {
14157
+ if (isUnparsedIdentifier(exp)) return false;
14132
14158
  try {
14133
14159
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
14134
14160
  if (ret.type === "Program") {
@@ -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
  **/
@@ -467,6 +467,21 @@ function getSequence(arr) {
467
467
  return result;
468
468
  }
469
469
  //#endregion
470
+ //#region packages/shared/src/vaporFlags.ts
471
+ /**
472
+ * The data of the comment a vapor server render opens the branch of a `v-if`
473
+ * chain with, `<!--[1-->`: the digits are the branch's position in the chain,
474
+ * and `<!--]-->` closes it like a fragment.
475
+ */
476
+ function isVaporBranchStart(data) {
477
+ if (data.length < 2 || data.charCodeAt(0) !== 91) return false;
478
+ for (let i = 1; i < data.length; i++) {
479
+ const c = data.charCodeAt(i);
480
+ if (c < 48 || c > 57) return false;
481
+ }
482
+ return true;
483
+ }
484
+ //#endregion
470
485
  //#region packages/reactivity/src/system.ts
471
486
  const notifyBuffer = [];
472
487
  let batchDepth = 0;
@@ -3676,6 +3691,8 @@ const getContainerType = (container) => {
3676
3691
  if (isMathMLContainer(container)) return "mathml";
3677
3692
  };
3678
3693
  const isComment = (node) => node.nodeType === 8;
3694
+ /** The data of a comment opening a range a hydration steps over as one. */
3695
+ const isRangeStart = (data) => data === "[" || data === "(" || isVaporBranchStart(data);
3679
3696
  function createHydrationFunctions(rendererInternals) {
3680
3697
  const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
3681
3698
  const hydrate = (vnode, container) => {
@@ -3692,7 +3709,7 @@ function createHydrationFunctions(rendererInternals) {
3692
3709
  };
3693
3710
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
3694
3711
  optimized = optimized || !!vnode.dynamicChildren;
3695
- const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(");
3712
+ const isFragmentStart = isComment(node) && (node.data === "[" || node.data === "(" || isVaporInteropEnabled && isVaporBranchStart(node.data));
3696
3713
  const onMismatch = () => handleMismatch(node, vnode, parentComponent, parentSuspense, slotScopeIds, isFragmentStart);
3697
3714
  const { type, ref, shapeFlag, patchFlag } = vnode;
3698
3715
  let domType = node.nodeType;
@@ -3902,7 +3919,7 @@ function createHydrationFunctions(rendererInternals) {
3902
3919
  while (node) {
3903
3920
  node = nextSibling(node);
3904
3921
  if (node && isComment(node)) {
3905
- if (node.data === open) match++;
3922
+ if (node.data === open || isVaporInteropEnabled && open === "[" && isVaporBranchStart(node.data)) match++;
3906
3923
  if (node.data === close) {
3907
3924
  if (match === 0) return nextSibling(node);
3908
3925
  else match--;
@@ -4045,9 +4062,9 @@ const hydrateOnInteraction = (interactions = []) => (hydrate, forEach) => {
4045
4062
  return teardown;
4046
4063
  };
4047
4064
  function forEachElement(node, cb) {
4048
- if (isComment(node) && (node.data === "[" || node.data === "(")) {
4065
+ if (isComment(node) && isRangeStart(node.data)) {
4049
4066
  const open = node.data;
4050
- const close = open === "[" ? "]" : ")";
4067
+ const close = open === "(" ? ")" : "]";
4051
4068
  let depth = 1;
4052
4069
  let next = node.nextSibling;
4053
4070
  while (next) {
@@ -4056,7 +4073,7 @@ function forEachElement(node, cb) {
4056
4073
  } else if (isComment(next)) {
4057
4074
  if (next.data === close) {
4058
4075
  if (--depth === 0) break;
4059
- } else if (next.data === open) depth++;
4076
+ } else if (close === "]" ? next.data === "[" || isVaporBranchStart(next.data) : next.data === open) depth++;
4060
4077
  }
4061
4078
  next = next.nextSibling;
4062
4079
  }
@@ -5619,7 +5636,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
5619
5636
  if (options.el) return vm.$mount(options.el);
5620
5637
  else return vm;
5621
5638
  }
5622
- Vue.version = `2.6.14-compat:3.6.0-rc.13`;
5639
+ Vue.version = `2.6.14-compat:3.6.0-rc.14`;
5623
5640
  Vue.config = singletonApp.config;
5624
5641
  Vue.use = (plugin, ...options) => {
5625
5642
  if (plugin && isFunction(plugin.install)) plugin.install(Vue, ...options);
@@ -8468,7 +8485,7 @@ function isMemoSame(cached, memo) {
8468
8485
  }
8469
8486
  //#endregion
8470
8487
  //#region packages/runtime-core/src/index.ts
8471
- const version = "3.6.0-rc.13";
8488
+ const version = "3.6.0-rc.14";
8472
8489
  const warn = NOOP;
8473
8490
  /**
8474
8491
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -12101,7 +12118,15 @@ const nonIdentifierRE = /^$|^\d|[^\$\w\xA0-\uFFFF]/;
12101
12118
  const isSimpleIdentifier = (name) => !nonIdentifierRE.test(name);
12102
12119
  const validFirstIdentCharRE = /[A-Za-z_$\xA0-\uFFFF]/;
12103
12120
  const getExpSource = (exp) => exp.type === 4 ? exp.content : exp.loc.source;
12121
+ const asciiIdentifierRE = /^[A-Za-z_$][\w$]*$/;
12122
+ const isReservedWord = /*@__PURE__*/ makeMap("await,break,case,catch,class,const,continue,debugger,default,delete,do,else,enum,export,extends,false,finally,for,function,if,implements,import,in,instanceof,interface,let,new,null,package,private,protected,public,return,static,super,switch,this,throw,true,try,typeof,undefined,var,void,while,with,yield");
12123
+ const isUnparsedIdentifier = (exp) => {
12124
+ if (exp.ast !== null) return false;
12125
+ const content = getExpSource(exp);
12126
+ return asciiIdentifierRE.test(content) && !isReservedWord(content);
12127
+ };
12104
12128
  const isMemberExpressionNode = (exp, context) => {
12129
+ if (isUnparsedIdentifier(exp)) return true;
12105
12130
  try {
12106
12131
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
12107
12132
  ret = unwrapTSNode(ret);
@@ -12112,6 +12137,7 @@ const isMemberExpressionNode = (exp, context) => {
12112
12137
  };
12113
12138
  const isMemberExpression = isMemberExpressionNode;
12114
12139
  const isFnExpressionNode = (exp, context) => {
12140
+ if (isUnparsedIdentifier(exp)) return false;
12115
12141
  try {
12116
12142
  let ret = exp.ast || (0, _babel_parser.parseExpression)(getExpSource(exp), { plugins: context.expressionPlugins ? [...context.expressionPlugins, "typescript"] : ["typescript"] });
12117
12143
  if (ret.type === "Program") {
@@ -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.