@vue/compiler-core 3.4.14 → 3.4.16

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/compiler-core v3.4.14
2
+ * @vue/compiler-core v3.4.16
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1439,8 +1439,10 @@ const ErrorCodes = {
1439
1439
  "50": "X_SCOPE_ID_NOT_SUPPORTED",
1440
1440
  "X_VNODE_HOOKS": 51,
1441
1441
  "51": "X_VNODE_HOOKS",
1442
- "__EXTEND_POINT__": 52,
1443
- "52": "__EXTEND_POINT__"
1442
+ "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52,
1443
+ "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT",
1444
+ "__EXTEND_POINT__": 53,
1445
+ "53": "__EXTEND_POINT__"
1444
1446
  };
1445
1447
  const errorMessages = {
1446
1448
  // parse errors
@@ -1481,6 +1483,7 @@ const errorMessages = {
1481
1483
  [32]: `v-for has invalid expression.`,
1482
1484
  [33]: `<template v-for> key should be placed on the <template> tag.`,
1483
1485
  [34]: `v-bind is missing expression.`,
1486
+ [52]: `v-bind with same-name shorthand only allows static argument.`,
1484
1487
  [35]: `v-on is missing expression.`,
1485
1488
  [36]: `Unexpected custom directive on <slot> outlet.`,
1486
1489
  [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
@@ -1501,7 +1504,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
1501
1504
  [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
1502
1505
  [50]: `"scopeId" option is only supported in module mode.`,
1503
1506
  // just to fulfill types
1504
- [52]: ``
1507
+ [53]: ``
1505
1508
  };
1506
1509
 
1507
1510
  function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
@@ -5835,8 +5838,15 @@ function processSlotOutlet(node, context) {
5835
5838
  }
5836
5839
  } else {
5837
5840
  if (p.name === "bind" && isStaticArgOf(p.arg, "name")) {
5838
- if (p.exp)
5841
+ if (p.exp) {
5839
5842
  slotName = p.exp;
5843
+ } else if (p.arg && p.arg.type === 4) {
5844
+ const name = shared.camelize(p.arg.content);
5845
+ slotName = p.exp = createSimpleExpression(name, false, p.arg.loc);
5846
+ {
5847
+ slotName = p.exp = processExpression(p.exp, context);
5848
+ }
5849
+ }
5840
5850
  } else {
5841
5851
  if (p.name === "bind" && p.arg && isStaticExp(p.arg)) {
5842
5852
  p.arg.content = shared.camelize(p.arg.content);
@@ -5976,7 +5986,32 @@ const transformBind = (dir, _node, context) => {
5976
5986
  const { modifiers, loc } = dir;
5977
5987
  const arg = dir.arg;
5978
5988
  let { exp } = dir;
5979
- if (!exp && arg.type === 4) {
5989
+ if (exp && exp.type === 4 && !exp.content.trim()) {
5990
+ {
5991
+ context.onError(
5992
+ createCompilerError(34, loc)
5993
+ );
5994
+ return {
5995
+ props: [
5996
+ createObjectProperty(arg, createSimpleExpression("", true, loc))
5997
+ ]
5998
+ };
5999
+ }
6000
+ }
6001
+ if (!exp) {
6002
+ if (arg.type !== 4 || !arg.isStatic) {
6003
+ context.onError(
6004
+ createCompilerError(
6005
+ 52,
6006
+ arg.loc
6007
+ )
6008
+ );
6009
+ return {
6010
+ props: [
6011
+ createObjectProperty(arg, createSimpleExpression("", true, loc))
6012
+ ]
6013
+ };
6014
+ }
5980
6015
  const propName = shared.camelize(arg.content);
5981
6016
  exp = dir.exp = createSimpleExpression(propName, false, arg.loc);
5982
6017
  {
@@ -6009,12 +6044,6 @@ const transformBind = (dir, _node, context) => {
6009
6044
  injectPrefix(arg, "^");
6010
6045
  }
6011
6046
  }
6012
- if (!exp || exp.type === 4 && !exp.content.trim()) {
6013
- context.onError(createCompilerError(34, loc));
6014
- return {
6015
- props: [createObjectProperty(arg, createSimpleExpression("", true, loc))]
6016
- };
6017
- }
6018
6047
  return {
6019
6048
  props: [createObjectProperty(arg, exp)]
6020
6049
  };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.4.14
2
+ * @vue/compiler-core v3.4.16
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1435,8 +1435,10 @@ const ErrorCodes = {
1435
1435
  "50": "X_SCOPE_ID_NOT_SUPPORTED",
1436
1436
  "X_VNODE_HOOKS": 51,
1437
1437
  "51": "X_VNODE_HOOKS",
1438
- "__EXTEND_POINT__": 52,
1439
- "52": "__EXTEND_POINT__"
1438
+ "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52,
1439
+ "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT",
1440
+ "__EXTEND_POINT__": 53,
1441
+ "53": "__EXTEND_POINT__"
1440
1442
  };
1441
1443
  const errorMessages = {
1442
1444
  // parse errors
@@ -1477,6 +1479,7 @@ const errorMessages = {
1477
1479
  [32]: `v-for has invalid expression.`,
1478
1480
  [33]: `<template v-for> key should be placed on the <template> tag.`,
1479
1481
  [34]: `v-bind is missing expression.`,
1482
+ [52]: `v-bind with same-name shorthand only allows static argument.`,
1480
1483
  [35]: `v-on is missing expression.`,
1481
1484
  [36]: `Unexpected custom directive on <slot> outlet.`,
1482
1485
  [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
@@ -1497,7 +1500,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
1497
1500
  [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
1498
1501
  [50]: `"scopeId" option is only supported in module mode.`,
1499
1502
  // just to fulfill types
1500
- [52]: ``
1503
+ [53]: ``
1501
1504
  };
1502
1505
 
1503
1506
  function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
@@ -5719,8 +5722,15 @@ function processSlotOutlet(node, context) {
5719
5722
  }
5720
5723
  } else {
5721
5724
  if (p.name === "bind" && isStaticArgOf(p.arg, "name")) {
5722
- if (p.exp)
5725
+ if (p.exp) {
5723
5726
  slotName = p.exp;
5727
+ } else if (p.arg && p.arg.type === 4) {
5728
+ const name = shared.camelize(p.arg.content);
5729
+ slotName = p.exp = createSimpleExpression(name, false, p.arg.loc);
5730
+ {
5731
+ slotName = p.exp = processExpression(p.exp, context);
5732
+ }
5733
+ }
5724
5734
  } else {
5725
5735
  if (p.name === "bind" && p.arg && isStaticExp(p.arg)) {
5726
5736
  p.arg.content = shared.camelize(p.arg.content);
@@ -5857,7 +5867,32 @@ const transformBind = (dir, _node, context) => {
5857
5867
  const { modifiers, loc } = dir;
5858
5868
  const arg = dir.arg;
5859
5869
  let { exp } = dir;
5860
- if (!exp && arg.type === 4) {
5870
+ if (exp && exp.type === 4 && !exp.content.trim()) {
5871
+ {
5872
+ context.onError(
5873
+ createCompilerError(34, loc)
5874
+ );
5875
+ return {
5876
+ props: [
5877
+ createObjectProperty(arg, createSimpleExpression("", true, loc))
5878
+ ]
5879
+ };
5880
+ }
5881
+ }
5882
+ if (!exp) {
5883
+ if (arg.type !== 4 || !arg.isStatic) {
5884
+ context.onError(
5885
+ createCompilerError(
5886
+ 52,
5887
+ arg.loc
5888
+ )
5889
+ );
5890
+ return {
5891
+ props: [
5892
+ createObjectProperty(arg, createSimpleExpression("", true, loc))
5893
+ ]
5894
+ };
5895
+ }
5861
5896
  const propName = shared.camelize(arg.content);
5862
5897
  exp = dir.exp = createSimpleExpression(propName, false, arg.loc);
5863
5898
  {
@@ -5890,12 +5925,6 @@ const transformBind = (dir, _node, context) => {
5890
5925
  injectPrefix(arg, "^");
5891
5926
  }
5892
5927
  }
5893
- if (!exp || exp.type === 4 && !exp.content.trim()) {
5894
- context.onError(createCompilerError(34, loc));
5895
- return {
5896
- props: [createObjectProperty(arg, createSimpleExpression("", true, loc))]
5897
- };
5898
- }
5899
5928
  return {
5900
5929
  props: [createObjectProperty(arg, exp)]
5901
5930
  };
@@ -612,7 +612,8 @@ export declare enum ErrorCodes {
612
612
  X_CACHE_HANDLER_NOT_SUPPORTED = 49,
613
613
  X_SCOPE_ID_NOT_SUPPORTED = 50,
614
614
  X_VNODE_HOOKS = 51,
615
- __EXTEND_POINT__ = 52
615
+ X_V_BIND_INVALID_SAME_NAME_ARGUMENT = 52,
616
+ __EXTEND_POINT__ = 53
616
617
  }
617
618
  export declare const errorMessages: Record<ErrorCodes, string>;
618
619
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-core v3.4.14
2
+ * @vue/compiler-core v3.4.16
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1259,7 +1259,7 @@ function defaultOnWarn(msg) {
1259
1259
  !!(process.env.NODE_ENV !== "production") && console.warn(`[Vue warn] ${msg.message}`);
1260
1260
  }
1261
1261
  function createCompilerError(code, loc, messages, additionalMessage) {
1262
- const msg = !!(process.env.NODE_ENV !== "production") || false ? (messages || errorMessages)[code] + (additionalMessage || ``) : `https://vuejs.org/errors/#compiler-${code}`;
1262
+ const msg = !!(process.env.NODE_ENV !== "production") || false ? (messages || errorMessages)[code] + (additionalMessage || ``) : `https://vuejs.org/error-reference/#compiler-${code}`;
1263
1263
  const error = new SyntaxError(String(msg));
1264
1264
  error.code = code;
1265
1265
  error.loc = loc;
@@ -1370,8 +1370,10 @@ const ErrorCodes = {
1370
1370
  "50": "X_SCOPE_ID_NOT_SUPPORTED",
1371
1371
  "X_VNODE_HOOKS": 51,
1372
1372
  "51": "X_VNODE_HOOKS",
1373
- "__EXTEND_POINT__": 52,
1374
- "52": "__EXTEND_POINT__"
1373
+ "X_V_BIND_INVALID_SAME_NAME_ARGUMENT": 52,
1374
+ "52": "X_V_BIND_INVALID_SAME_NAME_ARGUMENT",
1375
+ "__EXTEND_POINT__": 53,
1376
+ "53": "__EXTEND_POINT__"
1375
1377
  };
1376
1378
  const errorMessages = {
1377
1379
  // parse errors
@@ -1412,6 +1414,7 @@ const errorMessages = {
1412
1414
  [32]: `v-for has invalid expression.`,
1413
1415
  [33]: `<template v-for> key should be placed on the <template> tag.`,
1414
1416
  [34]: `v-bind is missing expression.`,
1417
+ [52]: `v-bind with same-name shorthand only allows static argument.`,
1415
1418
  [35]: `v-on is missing expression.`,
1416
1419
  [36]: `Unexpected custom directive on <slot> outlet.`,
1417
1420
  [37]: `Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.`,
@@ -1432,7 +1435,7 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
1432
1435
  [49]: `"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.`,
1433
1436
  [50]: `"scopeId" option is only supported in module mode.`,
1434
1437
  // just to fulfill types
1435
- [52]: ``
1438
+ [53]: ``
1436
1439
  };
1437
1440
 
1438
1441
  function walkIdentifiers(root, onIdentifier, includeAll = false, parentStack = [], knownIds = /* @__PURE__ */ Object.create(null)) {
@@ -3224,8 +3227,7 @@ function generate(ast, options = {}) {
3224
3227
  const helpers = Array.from(ast.helpers);
3225
3228
  const hasHelpers = helpers.length > 0;
3226
3229
  const useWithBlock = !prefixIdentifiers && mode !== "module";
3227
- const isSetupInlined = false;
3228
- const preambleContext = isSetupInlined ? createCodegenContext(ast, options) : context;
3230
+ const preambleContext = context;
3229
3231
  {
3230
3232
  genFunctionPreamble(ast, preambleContext);
3231
3233
  }
@@ -3293,7 +3295,7 @@ function generate(ast, options = {}) {
3293
3295
  return {
3294
3296
  ast,
3295
3297
  code: context.code,
3296
- preamble: isSetupInlined ? preambleContext.code : ``,
3298
+ preamble: ``,
3297
3299
  map: context.map ? context.map.toJSON() : void 0
3298
3300
  };
3299
3301
  }
@@ -5081,8 +5083,12 @@ function processSlotOutlet(node, context) {
5081
5083
  }
5082
5084
  } else {
5083
5085
  if (p.name === "bind" && isStaticArgOf(p.arg, "name")) {
5084
- if (p.exp)
5086
+ if (p.exp) {
5085
5087
  slotName = p.exp;
5088
+ } else if (p.arg && p.arg.type === 4) {
5089
+ const name = camelize(p.arg.content);
5090
+ slotName = p.exp = createSimpleExpression(name, false, p.arg.loc);
5091
+ }
5086
5092
  } else {
5087
5093
  if (p.name === "bind" && p.arg && isStaticExp(p.arg)) {
5088
5094
  p.arg.content = camelize(p.arg.content);
@@ -5200,7 +5206,25 @@ const transformBind = (dir, _node, context) => {
5200
5206
  const { modifiers, loc } = dir;
5201
5207
  const arg = dir.arg;
5202
5208
  let { exp } = dir;
5203
- if (!exp && arg.type === 4) {
5209
+ if (exp && exp.type === 4 && !exp.content.trim()) {
5210
+ {
5211
+ exp = void 0;
5212
+ }
5213
+ }
5214
+ if (!exp) {
5215
+ if (arg.type !== 4 || !arg.isStatic) {
5216
+ context.onError(
5217
+ createCompilerError(
5218
+ 52,
5219
+ arg.loc
5220
+ )
5221
+ );
5222
+ return {
5223
+ props: [
5224
+ createObjectProperty(arg, createSimpleExpression("", true, loc))
5225
+ ]
5226
+ };
5227
+ }
5204
5228
  const propName = camelize(arg.content);
5205
5229
  exp = dir.exp = createSimpleExpression(propName, false, arg.loc);
5206
5230
  }
@@ -5230,12 +5254,6 @@ const transformBind = (dir, _node, context) => {
5230
5254
  injectPrefix(arg, "^");
5231
5255
  }
5232
5256
  }
5233
- if (!exp || exp.type === 4 && !exp.content.trim()) {
5234
- context.onError(createCompilerError(34, loc));
5235
- return {
5236
- props: [createObjectProperty(arg, createSimpleExpression("", true, loc))]
5237
- };
5238
- }
5239
5257
  return {
5240
5258
  props: [createObjectProperty(arg, exp)]
5241
5259
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-core",
3
- "version": "3.4.14",
3
+ "version": "3.4.16",
4
4
  "description": "@vue/compiler-core",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-core.esm-bundler.js",
@@ -46,13 +46,13 @@
46
46
  },
47
47
  "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
48
48
  "dependencies": {
49
- "@babel/parser": "^7.23.6",
49
+ "@babel/parser": "^7.23.9",
50
50
  "entities": "^4.5.0",
51
51
  "estree-walker": "^2.0.2",
52
52
  "source-map-js": "^1.0.2",
53
- "@vue/shared": "3.4.14"
53
+ "@vue/shared": "3.4.16"
54
54
  },
55
55
  "devDependencies": {
56
- "@babel/types": "^7.23.6"
56
+ "@babel/types": "^7.23.9"
57
57
  }
58
58
  }