vue 2.7.0-alpha.6 → 2.7.0-alpha.7

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.
Files changed (54) hide show
  1. package/dist/compiler-sfc.js +14 -0
  2. package/dist/vue.common.dev.js +16 -9
  3. package/dist/vue.common.prod.js +3 -3
  4. package/dist/vue.esm.browser.js +16 -9
  5. package/dist/vue.esm.browser.min.js +3 -3
  6. package/dist/vue.esm.js +16 -9
  7. package/dist/vue.js +16 -9
  8. package/dist/vue.min.js +3 -3
  9. package/dist/vue.runtime.common.dev.js +9 -3
  10. package/dist/vue.runtime.common.prod.js +3 -3
  11. package/dist/vue.runtime.esm.js +9 -3
  12. package/dist/vue.runtime.js +9 -3
  13. package/dist/vue.runtime.min.js +3 -3
  14. package/dist/vue.runtime.mjs +9 -3
  15. package/package.json +24 -21
  16. package/packages/compiler-sfc/api-extractor.json +64 -0
  17. package/packages/compiler-sfc/dist/compiler-sfc.d.ts +259 -0
  18. package/packages/compiler-sfc/dist/compiler-sfc.js +17610 -2
  19. package/packages/compiler-sfc/node_modules/.bin/lessc +17 -0
  20. package/packages/compiler-sfc/node_modules/.bin/sass +2 -2
  21. package/packages/compiler-sfc/node_modules/.bin/stylus +17 -0
  22. package/packages/compiler-sfc/package.json +17 -12
  23. package/packages/compiler-sfc/src/babelUtils.ts +423 -0
  24. package/packages/compiler-sfc/src/compileScript.ts +1948 -0
  25. package/packages/compiler-sfc/src/compileStyle.ts +143 -0
  26. package/packages/compiler-sfc/src/compileTemplate.ts +197 -0
  27. package/packages/compiler-sfc/src/index.ts +15 -0
  28. package/packages/compiler-sfc/src/parse.ts +117 -0
  29. package/packages/compiler-sfc/src/{parser.ts → parseComponent.ts} +86 -17
  30. package/packages/compiler-sfc/src/stripWith.ts +60 -0
  31. package/packages/compiler-sfc/src/stylePlugins/scoped.ts +207 -0
  32. package/packages/compiler-sfc/src/stylePlugins/trim.ts +18 -0
  33. package/packages/compiler-sfc/src/stylePreprocessors.ts +135 -0
  34. package/packages/compiler-sfc/src/templateCompilerModules/assetUrl.ts +80 -0
  35. package/packages/compiler-sfc/src/templateCompilerModules/srcset.ts +76 -0
  36. package/packages/compiler-sfc/src/templateCompilerModules/utils.ts +64 -0
  37. package/packages/compiler-sfc/src/types.ts +95 -0
  38. package/packages/compiler-sfc/src/warn.ts +16 -0
  39. package/packages/compiler-sfc/test/__snapshots__/compileScript.spec.ts.snap +1393 -0
  40. package/packages/compiler-sfc/test/compileScript.spec.ts +1708 -0
  41. package/packages/compiler-sfc/test/compileStyle.spec.ts +203 -0
  42. package/packages/compiler-sfc/test/compileTemplate.spec.ts +229 -0
  43. package/packages/compiler-sfc/test/parseComponent.spec.ts +266 -0
  44. package/packages/compiler-sfc/test/stripWith.spec.ts +55 -0
  45. package/packages/compiler-sfc/test/stylePluginScoped.spec.ts +137 -0
  46. package/packages/compiler-sfc/test/tsconfig.json +7 -0
  47. package/src/compiler/codegen/index.ts +0 -1
  48. package/src/compiler/helpers.ts +2 -2
  49. package/src/compiler/parser/html-parser.ts +17 -3
  50. package/src/compiler/parser/index.ts +7 -5
  51. package/src/platforms/web/entry-compiler.ts +1 -1
  52. package/src/types/compiler.ts +5 -27
  53. package/src/v3/apiSetup.ts +6 -1
  54. package/src/platforms/web/entry-compiler-sfc.ts +0 -1
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var compilerSfc = require('@vue/compiler-sfc');
6
+
7
+
8
+
9
+ Object.keys(compilerSfc).forEach(function (k) {
10
+ if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
11
+ enumerable: true,
12
+ get: function () { return compilerSfc[k]; }
13
+ });
14
+ });
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vue.js v2.7.0-alpha.6
2
+ * Vue.js v2.7.0-alpha.7
3
3
  * (c) 2014-2022 Evan You
4
4
  * Released under the MIT License.
5
5
  */
@@ -1492,6 +1492,9 @@ function initSetup(vm) {
1492
1492
  if (!isReserved(key)) {
1493
1493
  proxySetupProperty(vm, setupResult, key);
1494
1494
  }
1495
+ else {
1496
+ warn$2("Avoid using variables that start with _ or $ in setup().");
1497
+ }
1495
1498
  }
1496
1499
  }
1497
1500
  else if (setupResult !== undefined) {
@@ -1517,7 +1520,10 @@ function createSetupContext(vm) {
1517
1520
  get slots() {
1518
1521
  return initSlotsProxy(vm);
1519
1522
  },
1520
- emit: bind$1(vm.$emit, vm)
1523
+ emit: bind$1(vm.$emit, vm),
1524
+ expose: function () {
1525
+ // TODO
1526
+ }
1521
1527
  };
1522
1528
  }
1523
1529
  function initAttrsProxy(vm) {
@@ -5797,7 +5803,7 @@ Object.defineProperty(Vue.prototype, '$ssrContext', {
5797
5803
  Object.defineProperty(Vue, 'FunctionalRenderContext', {
5798
5804
  value: FunctionalRenderContext
5799
5805
  });
5800
- Vue.version = '2.7.0-alpha.6';
5806
+ Vue.version = '2.7.0-alpha.7';
5801
5807
 
5802
5808
  // these are reserved for web because they are directly compiled away
5803
5809
  // during template compilation
@@ -9208,7 +9214,7 @@ function parseHTML(html, options) {
9208
9214
  if (comment.test(html)) {
9209
9215
  var commentEnd = html.indexOf('-->');
9210
9216
  if (commentEnd >= 0) {
9211
- if (options.shouldKeepComment) {
9217
+ if (options.shouldKeepComment && options.comment) {
9212
9218
  options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
9213
9219
  }
9214
9220
  advance(commentEnd + 3);
@@ -9618,10 +9624,12 @@ function parse(template, options) {
9618
9624
  attrs.forEach(function (attr) {
9619
9625
  if (invalidAttributeRE.test(attr.name)) {
9620
9626
  warn("Invalid dynamic argument expression: attribute names cannot contain " +
9621
- "spaces, quotes, <, >, / or =.", {
9622
- start: attr.start + attr.name.indexOf("["),
9623
- end: attr.start + attr.name.length
9624
- });
9627
+ "spaces, quotes, <, >, / or =.", options.outputSourceRange
9628
+ ? {
9629
+ start: attr.start + attr.name.indexOf("["),
9630
+ end: attr.start + attr.name.length
9631
+ }
9632
+ : undefined);
9625
9633
  }
9626
9634
  });
9627
9635
  }
@@ -10638,7 +10646,6 @@ var CodegenState = /** @class */ (function () {
10638
10646
  function CodegenState(options) {
10639
10647
  this.options = options;
10640
10648
  this.warn = options.warn || baseWarn;
10641
- //@ts-expect-error `this.transforms ` is a different type than `options.modules.transformCode`
10642
10649
  this.transforms = pluckModuleFunction(options.modules, 'transformCode');
10643
10650
  this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
10644
10651
  this.directives = extend(extend({}, baseDirectives), options.directives);