rollup 2.61.0 → 2.61.1

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/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.61.0
4
- Thu, 09 Dec 2021 05:43:43 GMT - commit 49d41f78987a1dd13488df009fe2db1b5d1b6e7c
3
+ Rollup.js v2.61.1
4
+ Sat, 11 Dec 2021 06:17:07 GMT - commit 2e91c85fc95bc722e5a7141d7fa0acde4aab61aa
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.61.0
4
- Thu, 09 Dec 2021 05:43:43 GMT - commit 49d41f78987a1dd13488df009fe2db1b5d1b6e7c
3
+ Rollup.js v2.61.1
4
+ Sat, 11 Dec 2021 06:17:07 GMT - commit 2e91c85fc95bc722e5a7141d7fa0acde4aab61aa
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -13,7 +13,7 @@ import { createHash as createHash$1 } from 'crypto';
13
13
  import fs, { lstatSync, realpathSync, readdirSync } from 'fs';
14
14
  import { EventEmitter } from 'events';
15
15
 
16
- var version$1 = "2.61.0";
16
+ var version$1 = "2.61.1";
17
17
 
18
18
  var charToInteger = {};
19
19
  var chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
@@ -6066,62 +6066,61 @@ function toBase64(num) {
6066
6066
  return outStr;
6067
6067
  }
6068
6068
 
6069
- const RESERVED_NAMES = {
6070
- __proto__: null,
6071
- await: true,
6072
- break: true,
6073
- case: true,
6074
- catch: true,
6075
- class: true,
6076
- const: true,
6077
- continue: true,
6078
- debugger: true,
6079
- default: true,
6080
- delete: true,
6081
- do: true,
6082
- else: true,
6083
- enum: true,
6084
- eval: true,
6085
- export: true,
6086
- extends: true,
6087
- false: true,
6088
- finally: true,
6089
- for: true,
6090
- function: true,
6091
- if: true,
6092
- implements: true,
6093
- import: true,
6094
- in: true,
6095
- instanceof: true,
6096
- interface: true,
6097
- let: true,
6098
- new: true,
6099
- null: true,
6100
- package: true,
6101
- private: true,
6102
- protected: true,
6103
- public: true,
6104
- return: true,
6105
- static: true,
6106
- super: true,
6107
- switch: true,
6108
- this: true,
6109
- throw: true,
6110
- true: true,
6111
- try: true,
6112
- typeof: true,
6113
- undefined: true,
6114
- var: true,
6115
- void: true,
6116
- while: true,
6117
- with: true,
6118
- yield: true
6119
- };
6069
+ const RESERVED_NAMES = new Set([
6070
+ 'await',
6071
+ 'break',
6072
+ 'case',
6073
+ 'catch',
6074
+ 'class',
6075
+ 'const',
6076
+ 'continue',
6077
+ 'debugger',
6078
+ 'default',
6079
+ 'delete',
6080
+ 'do',
6081
+ 'else',
6082
+ 'enum',
6083
+ 'eval',
6084
+ 'export',
6085
+ 'extends',
6086
+ 'false',
6087
+ 'finally',
6088
+ 'for',
6089
+ 'function',
6090
+ 'if',
6091
+ 'implements',
6092
+ 'import',
6093
+ 'in',
6094
+ 'instanceof',
6095
+ 'interface',
6096
+ 'let',
6097
+ 'new',
6098
+ 'null',
6099
+ 'package',
6100
+ 'private',
6101
+ 'protected',
6102
+ 'public',
6103
+ 'return',
6104
+ 'static',
6105
+ 'super',
6106
+ 'switch',
6107
+ 'this',
6108
+ 'throw',
6109
+ 'true',
6110
+ 'try',
6111
+ 'typeof',
6112
+ 'undefined',
6113
+ 'var',
6114
+ 'void',
6115
+ 'while',
6116
+ 'with',
6117
+ 'yield'
6118
+ ]);
6120
6119
 
6121
6120
  function getSafeName(baseName, usedNames) {
6122
6121
  let safeName = baseName;
6123
6122
  let count = 1;
6124
- while (usedNames.has(safeName) || RESERVED_NAMES[safeName]) {
6123
+ while (usedNames.has(safeName) || RESERVED_NAMES.has(safeName)) {
6125
6124
  safeName = `${baseName}$${toBase64(count++)}`;
6126
6125
  }
6127
6126
  usedNames.add(safeName);
@@ -12206,10 +12205,10 @@ class Module {
12206
12205
  hasModuleSideEffects,
12207
12206
  id,
12208
12207
  get implicitlyLoadedAfterOneOf() {
12209
- return Array.from(module.implicitlyLoadedAfter, getId);
12208
+ return Array.from(module.implicitlyLoadedAfter, getId).sort();
12210
12209
  },
12211
12210
  get implicitlyLoadedBefore() {
12212
- return Array.from(module.implicitlyLoadedBefore, getId);
12211
+ return Array.from(module.implicitlyLoadedBefore, getId).sort();
12213
12212
  },
12214
12213
  get importedIds() {
12215
12214
  return Array.from(module.sources, source => { var _a; return (_a = module.resolvedIds[source]) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean);
@@ -14018,7 +14017,7 @@ function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariab
14018
14017
  nameIndex += 9 * 64 ** (exportName.length - 1);
14019
14018
  exportName = toBase64(nameIndex);
14020
14019
  }
14021
- } while (RESERVED_NAMES[exportName] || exportsByName[exportName]);
14020
+ } while (RESERVED_NAMES.has(exportName) || exportsByName[exportName]);
14022
14021
  }
14023
14022
  exportsByName[exportName] = variable;
14024
14023
  exportNamesByVariable.set(variable, [exportName]);
@@ -15753,7 +15752,7 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
15753
15752
  ];
15754
15753
  const isValidPropName = reservedNamesAsProps
15755
15754
  ? (name) => validPropName.test(name)
15756
- : (name) => !RESERVED_NAMES[name] && validPropName.test(name);
15755
+ : (name) => !RESERVED_NAMES.has(name) && validPropName.test(name);
15757
15756
  return {
15758
15757
  _,
15759
15758
  cnst,
@@ -21889,6 +21888,7 @@ class ModuleLoader {
21889
21888
  this.indexedEntryModules = [];
21890
21889
  this.latestLoadModulesPromise = Promise.resolve();
21891
21890
  this.moduleLoadPromises = new Map();
21891
+ this.modulesWithLoadedDependencies = new Set();
21892
21892
  this.nextEntryModuleIndex = 0;
21893
21893
  this.readQueue = new Queue();
21894
21894
  this.resolveId = async (source, importer, customOptions, isEntry, skip = null) => {
@@ -22067,7 +22067,8 @@ class ModuleLoader {
22067
22067
  this.graph.watchFiles[id] = true;
22068
22068
  const loadPromise = this.addModuleSource(id, importer, module).then(() => [
22069
22069
  this.getResolveStaticDependencyPromises(module),
22070
- this.getResolveDynamicImportPromises(module)
22070
+ this.getResolveDynamicImportPromises(module),
22071
+ loadAndResolveDependenciesPromise
22071
22072
  ]);
22072
22073
  const loadAndResolveDependenciesPromise = loadPromise
22073
22074
  .then(([resolveStaticDependencyPromises, resolveDynamicImportPromises]) => Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]))
@@ -22075,23 +22076,25 @@ class ModuleLoader {
22075
22076
  loadAndResolveDependenciesPromise.catch(() => {
22076
22077
  /* avoid unhandled promise rejections */
22077
22078
  });
22078
- if (isPreload) {
22079
- this.moduleLoadPromises.set(module, loadPromise);
22080
- await loadPromise;
22081
- }
22082
- else {
22083
- await this.fetchModuleDependencies(module, ...(await loadPromise));
22084
- // To handle errors when resolving dependencies or in moduleParsed
22085
- await loadAndResolveDependenciesPromise;
22079
+ this.moduleLoadPromises.set(module, loadPromise);
22080
+ const resolveDependencyPromises = await loadPromise;
22081
+ if (!isPreload) {
22082
+ await this.fetchModuleDependencies(module, ...resolveDependencyPromises);
22086
22083
  }
22087
22084
  return module;
22088
22085
  }
22089
- async fetchModuleDependencies(module, resolveStaticDependencyPromises, resolveDynamicDependencyPromises) {
22086
+ async fetchModuleDependencies(module, resolveStaticDependencyPromises, resolveDynamicDependencyPromises, loadAndResolveDependenciesPromise) {
22087
+ if (this.modulesWithLoadedDependencies.has(module)) {
22088
+ return;
22089
+ }
22090
+ this.modulesWithLoadedDependencies.add(module);
22090
22091
  await Promise.all([
22091
22092
  this.fetchStaticDependencies(module, resolveStaticDependencyPromises),
22092
22093
  this.fetchDynamicDependencies(module, resolveDynamicDependencyPromises)
22093
22094
  ]);
22094
22095
  module.linkImports();
22096
+ // To handle errors when resolving dependencies or in moduleParsed
22097
+ await loadAndResolveDependenciesPromise;
22095
22098
  }
22096
22099
  fetchResolvedDependency(source, importer, resolvedId) {
22097
22100
  if (resolvedId.external) {
@@ -22180,8 +22183,7 @@ class ModuleLoader {
22180
22183
  async handleExistingModule(module, isEntry, isPreload) {
22181
22184
  const loadPromise = this.moduleLoadPromises.get(module);
22182
22185
  if (isPreload) {
22183
- await loadPromise;
22184
- return;
22186
+ return loadPromise;
22185
22187
  }
22186
22188
  if (isEntry) {
22187
22189
  module.info.isEntry = true;
@@ -22191,11 +22193,7 @@ class ModuleLoader {
22191
22193
  }
22192
22194
  module.implicitlyLoadedAfter.clear();
22193
22195
  }
22194
- if (loadPromise) {
22195
- this.moduleLoadPromises.delete(module);
22196
- await this.fetchModuleDependencies(module, ...(await loadPromise));
22197
- }
22198
- return;
22196
+ return this.fetchModuleDependencies(module, ...(await loadPromise));
22199
22197
  }
22200
22198
  handleResolveId(resolvedId, source, importer) {
22201
22199
  if (resolvedId === null) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.61.0
4
- Thu, 09 Dec 2021 05:43:43 GMT - commit 49d41f78987a1dd13488df009fe2db1b5d1b6e7c
3
+ Rollup.js v2.61.1
4
+ Sat, 11 Dec 2021 06:17:07 GMT - commit 2e91c85fc95bc722e5a7141d7fa0acde4aab61aa
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v2.61.0
4
- Thu, 09 Dec 2021 05:43:43 GMT - commit 49d41f78987a1dd13488df009fe2db1b5d1b6e7c
3
+ Rollup.js v2.61.1
4
+ Sat, 11 Dec 2021 06:17:07 GMT - commit 2e91c85fc95bc722e5a7141d7fa0acde4aab61aa
5
5
 
6
6
 
7
7
  https://github.com/rollup/rollup