vite 2.7.6 → 2.7.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.

Potentially problematic release.


This version of vite might be problematic. Click here for more details.

package/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [2.7.7](https://github.com/vitejs/vite/compare/v2.7.6...v2.7.7) (2021-12-26)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **ssr:** nested destucture ([#6249](https://github.com/vitejs/vite/issues/6249)) ([485e298](https://github.com/vitejs/vite/commit/485e298e72599679e97f0ed1f4315ac5da55da2c))
7
+ * **ssr:** transform class props ([#6261](https://github.com/vitejs/vite/issues/6261)) ([2e3fe59](https://github.com/vitejs/vite/commit/2e3fe5932c962d447a4faa4b0ce996ead70c7d34))
8
+
9
+
10
+
1
11
  ## [2.7.6](https://github.com/vitejs/vite/compare/v2.7.5...v2.7.6) (2021-12-22)
2
12
 
3
13
 
@@ -20397,7 +20397,7 @@ async function compileCSS(id, code, config, urlReplacer, atImportResolvers, serv
20397
20397
  replacer: urlReplacer
20398
20398
  }));
20399
20399
  if (isModule) {
20400
- postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-5fb6fc32.js'); }).then(function (n) { return n.index; })).default({
20400
+ postcssPlugins.unshift((await Promise.resolve().then(function () { return require('./dep-591fce67.js'); }).then(function (n) { return n.index; })).default({
20401
20401
  ...modulesOptions,
20402
20402
  getJSON(cssFileName, _modules, outputFileName) {
20403
20403
  modules = _modules;
@@ -21402,7 +21402,7 @@ const assetAttrsConfig = {
21402
21402
  const isAsyncScriptMap = new WeakMap();
21403
21403
  async function traverseHtml(html, filePath, visitor) {
21404
21404
  // lazy load compiler
21405
- const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-e88755c3.js'); }).then(function (n) { return n.compilerDom_cjs; });
21405
+ const { parse, transform } = await Promise.resolve().then(function () { return require('./dep-f41a1db3.js'); }).then(function (n) { return n.compilerDom_cjs; });
21406
21406
  // @vue/compiler-core doesn't like lowercase doctypes
21407
21407
  html = html.replace(/<!doctype\s/i, '<!DOCTYPE ');
21408
21408
  try {
@@ -49581,7 +49581,7 @@ function readFileIfExists(value) {
49581
49581
  * https://github.com/webpack/webpack-dev-server/blob/master/LICENSE
49582
49582
  */
49583
49583
  async function createCertificate() {
49584
- const { generate } = await Promise.resolve().then(function () { return require('./dep-47e8be55.js'); }).then(function (n) { return n.index; });
49584
+ const { generate } = await Promise.resolve().then(function () { return require('./dep-67730f16.js'); }).then(function (n) { return n.index; });
49585
49585
  const pems = generate(null, {
49586
49586
  algorithm: 'sha256',
49587
49587
  days: 30,
@@ -56723,6 +56723,7 @@ async function ssrTransform(code, inMap, url) {
56723
56723
  // 3. convert references to import bindings & import.meta references
56724
56724
  walk(ast, {
56725
56725
  onIdentifier(id, parent, parentStack) {
56726
+ const grandparent = parentStack[parentStack.length - 2];
56726
56727
  const binding = idToImportMap.get(id.name);
56727
56728
  if (!binding) {
56728
56729
  return;
@@ -56736,8 +56737,9 @@ async function ssrTransform(code, inMap, url) {
56736
56737
  s.appendLeft(id.end, `: ${binding}`);
56737
56738
  }
56738
56739
  }
56739
- else if (parent.type === 'ClassDeclaration' &&
56740
- id === parent.superClass) {
56740
+ else if ((parent.type === 'PropertyDefinition' &&
56741
+ (grandparent === null || grandparent === void 0 ? void 0 : grandparent.type) === 'ClassBody') ||
56742
+ (parent.type === 'ClassDeclaration' && id === parent.superClass)) {
56741
56743
  if (!declaredConst.has(id.name)) {
56742
56744
  declaredConst.add(id.name);
56743
56745
  // locate the top-most node containing the class declaration
@@ -56860,27 +56862,36 @@ function walk(root, { onIdentifier, onImportMeta, onDynamicImport }) {
56860
56862
  else if (node.type === 'VariableDeclarator') {
56861
56863
  const parentFunction = findParentFunction(parentStack);
56862
56864
  if (parentFunction) {
56863
- if (node.id.type === 'ObjectPattern') {
56864
- node.id.properties.forEach((property) => {
56865
- if (property.type === 'RestElement') {
56866
- setScope(parentFunction, property.argument.name);
56867
- }
56868
- else if (property.value.type === 'AssignmentPattern') {
56869
- setScope(parentFunction, property.value.left.name);
56870
- }
56871
- else {
56872
- setScope(parentFunction, property.value.name);
56873
- }
56874
- });
56875
- }
56876
- else if (node.id.type === 'ArrayPattern') {
56877
- node.id.elements.filter(Boolean).forEach((element) => {
56878
- setScope(parentFunction, element.name);
56879
- });
56880
- }
56881
- else {
56882
- setScope(parentFunction, node.id.name);
56883
- }
56865
+ const handlePattern = (p) => {
56866
+ if (p.type === 'Identifier') {
56867
+ setScope(parentFunction, p.name);
56868
+ }
56869
+ else if (p.type === 'RestElement') {
56870
+ handlePattern(p.argument);
56871
+ }
56872
+ else if (p.type === 'ObjectPattern') {
56873
+ p.properties.forEach((property) => {
56874
+ if (property.type === 'RestElement') {
56875
+ setScope(parentFunction, property.argument.name);
56876
+ }
56877
+ else
56878
+ handlePattern(property.value);
56879
+ });
56880
+ }
56881
+ else if (p.type === 'ArrayPattern') {
56882
+ p.elements.forEach((element) => {
56883
+ if (element)
56884
+ handlePattern(element);
56885
+ });
56886
+ }
56887
+ else if (p.type === 'AssignmentPattern') {
56888
+ handlePattern(p.left);
56889
+ }
56890
+ else {
56891
+ setScope(parentFunction, p.name);
56892
+ }
56893
+ };
56894
+ handlePattern(node.id);
56884
56895
  }
56885
56896
  }
56886
56897
  },
@@ -82913,4 +82924,4 @@ exports.send = send$1;
82913
82924
  exports.sortUserPlugins = sortUserPlugins;
82914
82925
  exports.source = source;
82915
82926
  exports.transformWithEsbuild = transformWithEsbuild;
82916
- //# sourceMappingURL=dep-fcec4469.js.map
82927
+ //# sourceMappingURL=dep-4a9cff06.js.map