@vue/compiler-sfc 3.2.23 → 3.2.27

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.
@@ -14,7 +14,7 @@ var url = require('url');
14
14
  var CompilerSSR = require('@vue/compiler-ssr');
15
15
  var fs = require('fs');
16
16
  var util$2 = require('util');
17
- var refTransform = require('@vue/ref-transform');
17
+ var reactivityTransform = require('@vue/reactivity-transform');
18
18
  var _postcss = require('postcss');
19
19
 
20
20
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
@@ -1086,7 +1086,7 @@ function getImportsExpressionExp(path, hash, loc, context) {
1086
1086
  }
1087
1087
  else {
1088
1088
  name = `_imports_${context.imports.length}`;
1089
- exp = compilerCore.createSimpleExpression(name, false, loc, 2 /* CAN_HOIST */);
1089
+ exp = compilerCore.createSimpleExpression(name, false, loc, 3 /* CAN_STRINGIFY */);
1090
1090
  context.imports.push({ exp, path });
1091
1091
  }
1092
1092
  if (!hash) {
@@ -1100,12 +1100,12 @@ function getImportsExpressionExp(path, hash, loc, context) {
1100
1100
  h.content === hashExp);
1101
1101
  });
1102
1102
  if (existingHoistIndex > -1) {
1103
- return compilerCore.createSimpleExpression(`_hoisted_${existingHoistIndex + 1}`, false, loc, 2 /* CAN_HOIST */);
1103
+ return compilerCore.createSimpleExpression(`_hoisted_${existingHoistIndex + 1}`, false, loc, 3 /* CAN_STRINGIFY */);
1104
1104
  }
1105
- return context.hoist(compilerCore.createSimpleExpression(hashExp, false, loc, 2 /* CAN_HOIST */));
1105
+ return context.hoist(compilerCore.createSimpleExpression(hashExp, false, loc, 3 /* CAN_STRINGIFY */));
1106
1106
  }
1107
1107
  else {
1108
- return compilerCore.createSimpleExpression(`''`, false, loc, 2 /* CAN_HOIST */);
1108
+ return compilerCore.createSimpleExpression(`''`, false, loc, 3 /* CAN_STRINGIFY */);
1109
1109
  }
1110
1110
  }
1111
1111
 
@@ -1134,7 +1134,7 @@ const transformSrcset = (node, context, options = defaultAssetUrlOptions) => {
1134
1134
  .split(' ', 2);
1135
1135
  return { url, descriptor };
1136
1136
  });
1137
- // data urls contains comma after the ecoding so we need to re-merge
1137
+ // data urls contains comma after the encoding so we need to re-merge
1138
1138
  // them
1139
1139
  for (let i = 0; i < imageCandidates.length; i++) {
1140
1140
  const { url } = imageCandidates[i];
@@ -1178,17 +1178,17 @@ const transformSrcset = (node, context, options = defaultAssetUrlOptions) => {
1178
1178
  if (path) {
1179
1179
  const existingImportsIndex = context.imports.findIndex(i => i.path === path);
1180
1180
  if (existingImportsIndex > -1) {
1181
- exp = compilerCore.createSimpleExpression(`_imports_${existingImportsIndex}`, false, attr.loc, 2 /* CAN_HOIST */);
1181
+ exp = compilerCore.createSimpleExpression(`_imports_${existingImportsIndex}`, false, attr.loc, 3 /* CAN_STRINGIFY */);
1182
1182
  }
1183
1183
  else {
1184
- exp = compilerCore.createSimpleExpression(`_imports_${context.imports.length}`, false, attr.loc, 2 /* CAN_HOIST */);
1184
+ exp = compilerCore.createSimpleExpression(`_imports_${context.imports.length}`, false, attr.loc, 3 /* CAN_STRINGIFY */);
1185
1185
  context.imports.push({ exp, path });
1186
1186
  }
1187
1187
  compoundExpression.children.push(exp);
1188
1188
  }
1189
1189
  }
1190
1190
  else {
1191
- const exp = compilerCore.createSimpleExpression(`"${url}"`, false, attr.loc, 2 /* CAN_HOIST */);
1191
+ const exp = compilerCore.createSimpleExpression(`"${url}"`, false, attr.loc, 3 /* CAN_STRINGIFY */);
1192
1192
  compoundExpression.children.push(exp);
1193
1193
  }
1194
1194
  const isNotLast = imageCandidates.length - 1 > index;
@@ -1203,7 +1203,7 @@ const transformSrcset = (node, context, options = defaultAssetUrlOptions) => {
1203
1203
  }
1204
1204
  });
1205
1205
  const hoisted = context.hoist(compoundExpression);
1206
- hoisted.constType = 2 /* CAN_HOIST */;
1206
+ hoisted.constType = 3 /* CAN_STRINGIFY */;
1207
1207
  node.props[index] = {
1208
1208
  type: 7 /* DIRECTIVE */,
1209
1209
  name: 'bind',
@@ -3276,6 +3276,8 @@ const DEFINE_PROPS = 'defineProps';
3276
3276
  const DEFINE_EMITS = 'defineEmits';
3277
3277
  const DEFINE_EXPOSE = 'defineExpose';
3278
3278
  const WITH_DEFAULTS = 'withDefaults';
3279
+ // constants
3280
+ const DEFAULT_VAR = `__default__`;
3279
3281
  const isBuiltInDir = shared.makeMap(`once,memo,if,else,else-if,slot,text,html,on,bind,model,show,cloak,is`);
3280
3282
  /**
3281
3283
  * Compile `<script setup>`
@@ -3285,8 +3287,11 @@ const isBuiltInDir = shared.makeMap(`once,memo,if,else,else-if,slot,text,html,on
3285
3287
  function compileScript(sfc, options) {
3286
3288
  let { script, scriptSetup, source, filename } = sfc;
3287
3289
  // feature flags
3288
- const enableRefTransform = !!options.refSugar || !!options.refTransform;
3289
- const enablePropsTransform = !!options.propsDestructureTransform;
3290
+ // TODO remove support for deprecated options when out of experimental
3291
+ const enableRefTransform = !!options.reactivityTransform ||
3292
+ !!options.refSugar ||
3293
+ !!options.refTransform;
3294
+ const enablePropsTransform = !!options.reactivityTransform || !!options.propsDestructureTransform;
3290
3295
  const isProd = !!options.isProd;
3291
3296
  const genSourceMap = options.sourceMap !== false;
3292
3297
  let refBindings;
@@ -3327,11 +3332,11 @@ function compileScript(sfc, options) {
3327
3332
  sourceType: 'module'
3328
3333
  }).program;
3329
3334
  const bindings = analyzeScriptBindings(scriptAst.body);
3330
- if (enableRefTransform && refTransform.shouldTransform(content)) {
3335
+ if (enableRefTransform && reactivityTransform.shouldTransform(content)) {
3331
3336
  const s = new MagicString__default(source);
3332
3337
  const startOffset = script.loc.start.offset;
3333
3338
  const endOffset = script.loc.end.offset;
3334
- const { importedHelpers } = refTransform.transformAST(scriptAst, s, startOffset);
3339
+ const { importedHelpers } = reactivityTransform.transformAST(scriptAst, s, startOffset);
3335
3340
  if (importedHelpers.length) {
3336
3341
  s.prepend(`import { ${importedHelpers
3337
3342
  .map(h => `${h} as _${h}`)
@@ -3349,9 +3354,9 @@ function compileScript(sfc, options) {
3349
3354
  }
3350
3355
  }
3351
3356
  if (cssVars.length) {
3352
- content = rewriteDefault(content, `__default__`, plugins);
3357
+ content = rewriteDefault(content, DEFAULT_VAR, plugins);
3353
3358
  content += genNormalScriptCssVarsCode(cssVars, bindings, scopeId, isProd);
3354
- content += `\nexport default __default__`;
3359
+ content += `\nexport default ${DEFAULT_VAR}`;
3355
3360
  }
3356
3361
  return Object.assign(Object.assign({}, script), { content,
3357
3362
  map,
@@ -3373,7 +3378,6 @@ function compileScript(sfc, options) {
3373
3378
  }
3374
3379
  // metadata that needs to be returned
3375
3380
  const bindingMetadata = {};
3376
- const defaultTempVar = `__default__`;
3377
3381
  const helperImports = new Set();
3378
3382
  const userImports = Object.create(null);
3379
3383
  const userImportAlias = Object.create(null);
@@ -3486,7 +3490,7 @@ function compileScript(sfc, options) {
3486
3490
  };
3487
3491
  }
3488
3492
  else if (prop.value.type === 'Identifier') {
3489
- // simple destucture
3493
+ // simple destructure
3490
3494
  propsDestructuredBindings[propKey] = {
3491
3495
  local: prop.value.name
3492
3496
  };
@@ -3641,7 +3645,7 @@ function compileScript(sfc, options) {
3641
3645
  }
3642
3646
  /**
3643
3647
  * check defaults. If the default object is an object literal with only
3644
- * static properties, we can directly generate more optimzied default
3648
+ * static properties, we can directly generate more optimized default
3645
3649
  * declarations. Otherwise we will have to fallback to runtime merging.
3646
3650
  */
3647
3651
  function hasStaticWithDefaults() {
@@ -3738,7 +3742,6 @@ function compileScript(sfc, options) {
3738
3742
  // 1. process normal <script> first if it exists
3739
3743
  let scriptAst;
3740
3744
  if (script) {
3741
- // import dedupe between <script> and <script setup>
3742
3745
  scriptAst = parse(script.content, {
3743
3746
  plugins,
3744
3747
  sourceType: 'module'
@@ -3756,9 +3759,10 @@ function compileScript(sfc, options) {
3756
3759
  else if (node.type === 'ExportDefaultDeclaration') {
3757
3760
  // export default
3758
3761
  defaultExport = node;
3762
+ // export default { ... } --> const __default__ = { ... }
3759
3763
  const start = node.start + scriptStartOffset;
3760
3764
  const end = node.declaration.start + scriptStartOffset;
3761
- s.overwrite(start, end, `const ${defaultTempVar} = `);
3765
+ s.overwrite(start, end, `const ${DEFAULT_VAR} = `);
3762
3766
  }
3763
3767
  else if (node.type === 'ExportNamedDeclaration') {
3764
3768
  const defaultSpecifier = node.specifiers.find(s => s.exported.type === 'Identifier' && s.exported.name === 'default');
@@ -3775,12 +3779,12 @@ function compileScript(sfc, options) {
3775
3779
  // export { x as default } from './x'
3776
3780
  // rewrite to `import { x as __default__ } from './x'` and
3777
3781
  // add to top
3778
- s.prepend(`import { ${defaultSpecifier.local.name} as ${defaultTempVar} } from '${node.source.value}'\n`);
3782
+ s.prepend(`import { ${defaultSpecifier.local.name} as ${DEFAULT_VAR} } from '${node.source.value}'\n`);
3779
3783
  }
3780
3784
  else {
3781
3785
  // export { x as default }
3782
3786
  // rewrite to `const __default__ = x` and move to end
3783
- s.append(`\nconst ${defaultTempVar} = ${defaultSpecifier.local.name}\n`);
3787
+ s.appendLeft(scriptEndOffset, `\nconst ${DEFAULT_VAR} = ${defaultSpecifier.local.name}\n`);
3784
3788
  }
3785
3789
  }
3786
3790
  if (node.declaration) {
@@ -3796,13 +3800,19 @@ function compileScript(sfc, options) {
3796
3800
  }
3797
3801
  }
3798
3802
  // apply ref transform
3799
- if (enableRefTransform && refTransform.shouldTransform(script.content)) {
3800
- const { rootRefs: rootVars, importedHelpers } = refTransform.transformAST(scriptAst, s, scriptStartOffset);
3803
+ if (enableRefTransform && reactivityTransform.shouldTransform(script.content)) {
3804
+ const { rootRefs: rootVars, importedHelpers } = reactivityTransform.transformAST(scriptAst, s, scriptStartOffset);
3801
3805
  refBindings = rootVars;
3802
3806
  for (const h of importedHelpers) {
3803
3807
  helperImports.add(h);
3804
3808
  }
3805
3809
  }
3810
+ // <script> after <script setup>
3811
+ // we need to move the block up so that `const __default__` is
3812
+ // declared before being used in the actual component definition
3813
+ if (scriptStartOffset > startOffset) {
3814
+ s.move(scriptStartOffset, scriptEndOffset, 0);
3815
+ }
3806
3816
  }
3807
3817
  // 2. parse <script setup> and walk over top level statements
3808
3818
  const scriptSetupAst = parse(scriptSetup.content, {
@@ -3978,9 +3988,9 @@ function compileScript(sfc, options) {
3978
3988
  }
3979
3989
  }
3980
3990
  // 3. Apply ref sugar transform
3981
- if ((enableRefTransform && refTransform.shouldTransform(scriptSetup.content)) ||
3991
+ if ((enableRefTransform && reactivityTransform.shouldTransform(scriptSetup.content)) ||
3982
3992
  propsDestructureDecl) {
3983
- const { rootRefs, importedHelpers } = refTransform.transformAST(scriptSetupAst, s, startOffset, refBindings, propsDestructuredBindings, !enableRefTransform);
3993
+ const { rootRefs, importedHelpers } = reactivityTransform.transformAST(scriptSetupAst, s, startOffset, refBindings, propsDestructuredBindings);
3984
3994
  refBindings = refBindings ? [...refBindings, ...rootRefs] : rootRefs;
3985
3995
  for (const h of importedHelpers) {
3986
3996
  helperImports.add(h);
@@ -4205,29 +4215,24 @@ function compileScript(sfc, options) {
4205
4215
  // <script setup> components are closed by default. If the user did not
4206
4216
  // explicitly call `defineExpose`, call expose() with no args.
4207
4217
  const exposeCall = hasDefineExposeCall || options.inlineTemplate ? `` : ` expose();\n`;
4218
+ // wrap setup code with function.
4208
4219
  if (isTS) {
4209
4220
  // for TS, make sure the exported type is still valid type with
4210
4221
  // correct props information
4211
4222
  // we have to use object spread for types to be merged properly
4212
4223
  // user's TS setting should compile it down to proper targets
4213
- const def = defaultExport ? `\n ...${defaultTempVar},` : ``;
4214
- // wrap setup code with function.
4215
- // export the content of <script setup> as a named export, `setup`.
4216
- // this allows `import { setup } from '*.vue'` for testing purposes.
4217
- if (defaultExport) {
4218
- s.prependLeft(startOffset, `\n${hasAwait ? `async ` : ``}function setup(${args}) {\n`);
4219
- s.append(`\nexport default /*#__PURE__*/${helper(`defineComponent`)}({${def}${runtimeOptions}\n setup})`);
4220
- }
4221
- else {
4222
- s.prependLeft(startOffset, `\nexport default /*#__PURE__*/${helper(`defineComponent`)}({${def}${runtimeOptions}\n ${hasAwait ? `async ` : ``}setup(${args}) {\n${exposeCall}`);
4223
- s.appendRight(endOffset, `})`);
4224
- }
4224
+ // export default defineComponent({ ...__default__, ... })
4225
+ const def = defaultExport ? `\n ...${DEFAULT_VAR},` : ``;
4226
+ s.prependLeft(startOffset, `\nexport default /*#__PURE__*/${helper(`defineComponent`)}({${def}${runtimeOptions}\n ${hasAwait ? `async ` : ``}setup(${args}) {\n${exposeCall}`);
4227
+ s.appendRight(endOffset, `})`);
4225
4228
  }
4226
4229
  else {
4227
4230
  if (defaultExport) {
4228
- // can't rely on spread operator in non ts mode
4229
- s.prependLeft(startOffset, `\n${hasAwait ? `async ` : ``}function setup(${args}) {\n`);
4230
- s.append(`\nexport default /*#__PURE__*/ Object.assign(${defaultTempVar}, {${runtimeOptions}\n setup\n})\n`);
4231
+ // without TS, can't rely on rest spread, so we use Object.assign
4232
+ // export default Object.assign(__default__, { ... })
4233
+ s.prependLeft(startOffset, `\nexport default /*#__PURE__*/Object.assign(${DEFAULT_VAR}, {${runtimeOptions}\n ` +
4234
+ `${hasAwait ? `async ` : ``}setup(${args}) {\n${exposeCall}`);
4235
+ s.appendRight(endOffset, `})`);
4231
4236
  }
4232
4237
  else {
4233
4238
  s.prependLeft(startOffset, `\nexport default {${runtimeOptions}\n ` +
@@ -4327,7 +4332,7 @@ function walkObjectPattern(node, bindings, isConst, isDefineCall = false) {
4327
4332
  }
4328
4333
  else {
4329
4334
  // ...rest
4330
- // argument can only be identifer when destructuring
4335
+ // argument can only be identifier when destructuring
4331
4336
  const type = isConst ? "setup-const" /* SETUP_CONST */ : "setup-let" /* SETUP_LET */;
4332
4337
  registerBinding(bindings, p.argument, type);
4333
4338
  }
@@ -4348,7 +4353,7 @@ function walkPattern(node, bindings, isConst, isDefineCall = false) {
4348
4353
  registerBinding(bindings, node, type);
4349
4354
  }
4350
4355
  else if (node.type === 'RestElement') {
4351
- // argument can only be identifer when destructuring
4356
+ // argument can only be identifier when destructuring
4352
4357
  const type = isConst ? "setup-const" /* SETUP_CONST */ : "setup-let" /* SETUP_LET */;
4353
4358
  registerBinding(bindings, node.argument, type);
4354
4359
  }
@@ -8414,7 +8419,11 @@ var Parser = /*#__PURE__*/function () {
8414
8419
  }
8415
8420
 
8416
8421
  var hasClass = indexesOf(word, '.').filter(function (i) {
8417
- return word[i - 1] !== '\\';
8422
+ // Allow escaped dot within class name
8423
+ var escapedDot = word[i - 1] === '\\'; // Allow decimal numbers percent in @keyframes
8424
+
8425
+ var isKeyframesPercent = /^\d+\.\d+%$/.test(word);
8426
+ return !escapedDot && !isKeyframesPercent;
8418
8427
  });
8419
8428
  var hasId = indexesOf(word, '#').filter(function (i) {
8420
8429
  return word[i - 1] !== '\\';
@@ -14987,6 +14996,7 @@ var parse$2 = function(input) {
14987
14996
  after = token;
14988
14997
  } else if (prev && prev.type === "div") {
14989
14998
  prev.after = token;
14999
+ prev.sourceEndIndex += token.length;
14990
15000
  } else if (
14991
15001
  code === comma ||
14992
15002
  code === colon ||
@@ -15000,6 +15010,7 @@ var parse$2 = function(input) {
15000
15010
  tokens.push({
15001
15011
  type: "space",
15002
15012
  sourceIndex: pos,
15013
+ sourceEndIndex: next,
15003
15014
  value: token
15004
15015
  });
15005
15016
  }
@@ -15031,22 +15042,25 @@ var parse$2 = function(input) {
15031
15042
  }
15032
15043
  } while (escape);
15033
15044
  token.value = value.slice(pos + 1, next);
15034
-
15045
+ token.sourceEndIndex = token.unclosed ? next : next + 1;
15035
15046
  tokens.push(token);
15036
15047
  pos = next + 1;
15037
15048
  code = value.charCodeAt(pos);
15038
15049
 
15039
15050
  // Comments
15040
15051
  } else if (code === slash && value.charCodeAt(pos + 1) === star) {
15052
+ next = value.indexOf("*/", pos);
15053
+
15041
15054
  token = {
15042
15055
  type: "comment",
15043
- sourceIndex: pos
15056
+ sourceIndex: pos,
15057
+ sourceEndIndex: next + 2
15044
15058
  };
15045
15059
 
15046
- next = value.indexOf("*/", pos);
15047
15060
  if (next === -1) {
15048
15061
  token.unclosed = true;
15049
15062
  next = value.length;
15063
+ token.sourceEndIndex = next;
15050
15064
  }
15051
15065
 
15052
15066
  token.value = value.slice(pos + 2, next);
@@ -15066,6 +15080,7 @@ var parse$2 = function(input) {
15066
15080
  tokens.push({
15067
15081
  type: "word",
15068
15082
  sourceIndex: pos - before.length,
15083
+ sourceEndIndex: pos + token.length,
15069
15084
  value: token
15070
15085
  });
15071
15086
  pos += 1;
@@ -15078,6 +15093,7 @@ var parse$2 = function(input) {
15078
15093
  tokens.push({
15079
15094
  type: "div",
15080
15095
  sourceIndex: pos - before.length,
15096
+ sourceEndIndex: pos + token.length,
15081
15097
  value: token,
15082
15098
  before: before,
15083
15099
  after: ""
@@ -15133,6 +15149,7 @@ var parse$2 = function(input) {
15133
15149
  {
15134
15150
  type: "word",
15135
15151
  sourceIndex: pos,
15152
+ sourceEndIndex: whitespacePos + 1,
15136
15153
  value: value.slice(pos, whitespacePos + 1)
15137
15154
  }
15138
15155
  ];
@@ -15144,21 +15161,25 @@ var parse$2 = function(input) {
15144
15161
  token.nodes.push({
15145
15162
  type: "space",
15146
15163
  sourceIndex: whitespacePos + 1,
15164
+ sourceEndIndex: next,
15147
15165
  value: value.slice(whitespacePos + 1, next)
15148
15166
  });
15149
15167
  } else {
15150
15168
  token.after = value.slice(whitespacePos + 1, next);
15169
+ token.sourceEndIndex = next;
15151
15170
  }
15152
15171
  } else {
15153
15172
  token.after = "";
15154
15173
  token.nodes = [];
15155
15174
  }
15156
15175
  pos = next + 1;
15176
+ token.sourceEndIndex = token.unclosed ? next : pos;
15157
15177
  code = value.charCodeAt(pos);
15158
15178
  tokens.push(token);
15159
15179
  } else {
15160
15180
  balanced += 1;
15161
15181
  token.after = "";
15182
+ token.sourceEndIndex = pos + 1;
15162
15183
  tokens.push(token);
15163
15184
  stack.push(token);
15164
15185
  tokens = token.nodes = [];
@@ -15172,8 +15193,10 @@ var parse$2 = function(input) {
15172
15193
  code = value.charCodeAt(pos);
15173
15194
 
15174
15195
  parent.after = after;
15196
+ parent.sourceEndIndex += after.length;
15175
15197
  after = "";
15176
15198
  balanced -= 1;
15199
+ stack[stack.length - 1].sourceEndIndex = pos;
15177
15200
  stack.pop();
15178
15201
  parent = stack[balanced];
15179
15202
  tokens = parent.nodes;
@@ -15219,12 +15242,14 @@ var parse$2 = function(input) {
15219
15242
  tokens.push({
15220
15243
  type: "unicode-range",
15221
15244
  sourceIndex: pos,
15245
+ sourceEndIndex: next,
15222
15246
  value: token
15223
15247
  });
15224
15248
  } else {
15225
15249
  tokens.push({
15226
15250
  type: "word",
15227
15251
  sourceIndex: pos,
15252
+ sourceEndIndex: next,
15228
15253
  value: token
15229
15254
  });
15230
15255
  }
@@ -15235,6 +15260,7 @@ var parse$2 = function(input) {
15235
15260
 
15236
15261
  for (pos = stack.length - 1; pos; pos -= 1) {
15237
15262
  stack[pos].unclosed = true;
15263
+ stack[pos].sourceEndIndex = value.length;
15238
15264
  }
15239
15265
 
15240
15266
  return stack[0].nodes;
@@ -17251,9 +17277,9 @@ exports.generateCodeFrame = compilerCore.generateCodeFrame;
17251
17277
  exports.isInDestructureAssignment = compilerCore.isInDestructureAssignment;
17252
17278
  exports.isStaticProperty = compilerCore.isStaticProperty;
17253
17279
  exports.walkIdentifiers = compilerCore.walkIdentifiers;
17254
- exports.shouldTransformRef = refTransform.shouldTransform;
17255
- exports.transformRef = refTransform.transform;
17256
- exports.transformRefAST = refTransform.transformAST;
17280
+ exports.shouldTransformRef = reactivityTransform.shouldTransform;
17281
+ exports.transformRef = reactivityTransform.transform;
17282
+ exports.transformRefAST = reactivityTransform.transformAST;
17257
17283
  exports.compileScript = compileScript;
17258
17284
  exports.compileStyle = compileStyle;
17259
17285
  exports.compileStyleAsync = compileStyleAsync;
@@ -15,13 +15,13 @@ import { ParserPlugin } from '@babel/parser';
15
15
  import { RawSourceMap } from 'source-map';
16
16
  import { Result } from 'postcss';
17
17
  import { RootNode } from '@vue/compiler-core';
18
- import { shouldTransform as shouldTransformRef } from '@vue/ref-transform';
18
+ import { shouldTransform as shouldTransformRef } from '@vue/reactivity-transform';
19
19
  import { SourceLocation } from '@vue/compiler-core';
20
- import { transform as transformRef } from '@vue/ref-transform';
21
- import { transformAST as transformRefAST } from '@vue/ref-transform';
20
+ import { transform as transformRef } from '@vue/reactivity-transform';
21
+ import { transformAST as transformRefAST } from '@vue/reactivity-transform';
22
22
  import { walkIdentifiers } from '@vue/compiler-core';
23
23
 
24
- declare interface AssetURLOptions {
24
+ export declare interface AssetURLOptions {
25
25
  /**
26
26
  * If base is provided, instead of transforming relative asset urls into
27
27
  * imports, they will be directly rewritten to absolute urls.
@@ -34,7 +34,7 @@ declare interface AssetURLOptions {
34
34
  tags?: AssetURLTagConfig;
35
35
  }
36
36
 
37
- declare interface AssetURLTagConfig {
37
+ export declare interface AssetURLTagConfig {
38
38
  [name: string]: string[];
39
39
  }
40
40
 
@@ -150,7 +150,7 @@ export declare interface SFCParseOptions {
150
150
  compiler?: TemplateCompiler;
151
151
  }
152
152
 
153
- declare interface SFCParseResult {
153
+ export declare interface SFCParseResult {
154
154
  descriptor: SFCDescriptor;
155
155
  errors: (CompilerError | SyntaxError)[];
156
156
  }
@@ -172,7 +172,7 @@ export declare interface SFCScriptBlock extends SFCBlock {
172
172
 
173
173
  export declare interface SFCScriptCompileOptions {
174
174
  /**
175
- * Scope ID for prefixing injected CSS varialbes.
175
+ * Scope ID for prefixing injected CSS variables.
176
176
  * This must be consistent with the `id` passed to `compileStyle`.
177
177
  */
178
178
  id: string;
@@ -188,20 +188,27 @@ export declare interface SFCScriptCompileOptions {
188
188
  * https://babeljs.io/docs/en/babel-parser#plugins
189
189
  */
190
190
  babelParserPlugins?: ParserPlugin[];
191
+ /**
192
+ * (Experimental) Enable syntax transform for using refs without `.value` and
193
+ * using destructured props with reactivity
194
+ */
195
+ reactivityTransform?: boolean;
191
196
  /**
192
197
  * (Experimental) Enable syntax transform for using refs without `.value`
193
198
  * https://github.com/vuejs/rfcs/discussions/369
199
+ * @deprecated now part of `reactivityTransform`
194
200
  * @default false
195
201
  */
196
202
  refTransform?: boolean;
197
203
  /**
198
204
  * (Experimental) Enable syntax transform for destructuring from defineProps()
199
205
  * https://github.com/vuejs/rfcs/discussions/394
206
+ * @deprecated now part of `reactivityTransform`
200
207
  * @default false
201
208
  */
202
209
  propsDestructureTransform?: boolean;
203
210
  /**
204
- * @deprecated use `refTransform` instead.
211
+ * @deprecated use `reactivityTransform` instead.
205
212
  */
206
213
  refSugar?: boolean;
207
214
  /**
@@ -214,7 +221,7 @@ export declare interface SFCScriptCompileOptions {
214
221
  inlineTemplate?: boolean;
215
222
  /**
216
223
  * Options for template compilation when inlining. Note these are options that
217
- * would normally be pased to `compiler-sfc`'s own `compileTemplate()`, not
224
+ * would normally be passed to `compiler-sfc`'s own `compileTemplate()`, not
218
225
  * options passed to `compiler-dom`.
219
226
  */
220
227
  templateOptions?: Partial<SFCTemplateCompileOptions>;