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/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
@@ -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
@@ -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
@@ -26,7 +26,7 @@ function _interopNamespaceDefault(e) {
26
26
  return n;
27
27
  }
28
28
 
29
- var version$1 = "2.61.0";
29
+ var version$1 = "2.61.1";
30
30
 
31
31
  function ensureArray$1(items) {
32
32
  if (Array.isArray(items)) {
@@ -6565,62 +6565,61 @@ function toBase64(num) {
6565
6565
  return outStr;
6566
6566
  }
6567
6567
 
6568
- const RESERVED_NAMES = {
6569
- __proto__: null,
6570
- await: true,
6571
- break: true,
6572
- case: true,
6573
- catch: true,
6574
- class: true,
6575
- const: true,
6576
- continue: true,
6577
- debugger: true,
6578
- default: true,
6579
- delete: true,
6580
- do: true,
6581
- else: true,
6582
- enum: true,
6583
- eval: true,
6584
- export: true,
6585
- extends: true,
6586
- false: true,
6587
- finally: true,
6588
- for: true,
6589
- function: true,
6590
- if: true,
6591
- implements: true,
6592
- import: true,
6593
- in: true,
6594
- instanceof: true,
6595
- interface: true,
6596
- let: true,
6597
- new: true,
6598
- null: true,
6599
- package: true,
6600
- private: true,
6601
- protected: true,
6602
- public: true,
6603
- return: true,
6604
- static: true,
6605
- super: true,
6606
- switch: true,
6607
- this: true,
6608
- throw: true,
6609
- true: true,
6610
- try: true,
6611
- typeof: true,
6612
- undefined: true,
6613
- var: true,
6614
- void: true,
6615
- while: true,
6616
- with: true,
6617
- yield: true
6618
- };
6568
+ const RESERVED_NAMES = new Set([
6569
+ 'await',
6570
+ 'break',
6571
+ 'case',
6572
+ 'catch',
6573
+ 'class',
6574
+ 'const',
6575
+ 'continue',
6576
+ 'debugger',
6577
+ 'default',
6578
+ 'delete',
6579
+ 'do',
6580
+ 'else',
6581
+ 'enum',
6582
+ 'eval',
6583
+ 'export',
6584
+ 'extends',
6585
+ 'false',
6586
+ 'finally',
6587
+ 'for',
6588
+ 'function',
6589
+ 'if',
6590
+ 'implements',
6591
+ 'import',
6592
+ 'in',
6593
+ 'instanceof',
6594
+ 'interface',
6595
+ 'let',
6596
+ 'new',
6597
+ 'null',
6598
+ 'package',
6599
+ 'private',
6600
+ 'protected',
6601
+ 'public',
6602
+ 'return',
6603
+ 'static',
6604
+ 'super',
6605
+ 'switch',
6606
+ 'this',
6607
+ 'throw',
6608
+ 'true',
6609
+ 'try',
6610
+ 'typeof',
6611
+ 'undefined',
6612
+ 'var',
6613
+ 'void',
6614
+ 'while',
6615
+ 'with',
6616
+ 'yield'
6617
+ ]);
6619
6618
 
6620
6619
  function getSafeName(baseName, usedNames) {
6621
6620
  let safeName = baseName;
6622
6621
  let count = 1;
6623
- while (usedNames.has(safeName) || RESERVED_NAMES[safeName]) {
6622
+ while (usedNames.has(safeName) || RESERVED_NAMES.has(safeName)) {
6624
6623
  safeName = `${baseName}$${toBase64(count++)}`;
6625
6624
  }
6626
6625
  usedNames.add(safeName);
@@ -12325,10 +12324,10 @@ class Module {
12325
12324
  hasModuleSideEffects,
12326
12325
  id,
12327
12326
  get implicitlyLoadedAfterOneOf() {
12328
- return Array.from(module.implicitlyLoadedAfter, getId);
12327
+ return Array.from(module.implicitlyLoadedAfter, getId).sort();
12329
12328
  },
12330
12329
  get implicitlyLoadedBefore() {
12331
- return Array.from(module.implicitlyLoadedBefore, getId);
12330
+ return Array.from(module.implicitlyLoadedBefore, getId).sort();
12332
12331
  },
12333
12332
  get importedIds() {
12334
12333
  return Array.from(module.sources, source => { var _a; return (_a = module.resolvedIds[source]) === null || _a === void 0 ? void 0 : _a.id; }).filter(Boolean);
@@ -14137,7 +14136,7 @@ function assignExportsToMangledNames(exports, exportsByName, exportNamesByVariab
14137
14136
  nameIndex += 9 * 64 ** (exportName.length - 1);
14138
14137
  exportName = toBase64(nameIndex);
14139
14138
  }
14140
- } while (RESERVED_NAMES[exportName] || exportsByName[exportName]);
14139
+ } while (RESERVED_NAMES.has(exportName) || exportsByName[exportName]);
14141
14140
  }
14142
14141
  exportsByName[exportName] = variable;
14143
14142
  exportNamesByVariable.set(variable, [exportName]);
@@ -15872,7 +15871,7 @@ function getGenerateCodeSnippets({ compact, generatedCode: { arrowFunctions, con
15872
15871
  ];
15873
15872
  const isValidPropName = reservedNamesAsProps
15874
15873
  ? (name) => validPropName.test(name)
15875
- : (name) => !RESERVED_NAMES[name] && validPropName.test(name);
15874
+ : (name) => !RESERVED_NAMES.has(name) && validPropName.test(name);
15876
15875
  return {
15877
15876
  _,
15878
15877
  cnst,
@@ -22008,6 +22007,7 @@ class ModuleLoader {
22008
22007
  this.indexedEntryModules = [];
22009
22008
  this.latestLoadModulesPromise = Promise.resolve();
22010
22009
  this.moduleLoadPromises = new Map();
22010
+ this.modulesWithLoadedDependencies = new Set();
22011
22011
  this.nextEntryModuleIndex = 0;
22012
22012
  this.readQueue = new Queue();
22013
22013
  this.resolveId = async (source, importer, customOptions, isEntry, skip = null) => {
@@ -22186,7 +22186,8 @@ class ModuleLoader {
22186
22186
  this.graph.watchFiles[id] = true;
22187
22187
  const loadPromise = this.addModuleSource(id, importer, module).then(() => [
22188
22188
  this.getResolveStaticDependencyPromises(module),
22189
- this.getResolveDynamicImportPromises(module)
22189
+ this.getResolveDynamicImportPromises(module),
22190
+ loadAndResolveDependenciesPromise
22190
22191
  ]);
22191
22192
  const loadAndResolveDependenciesPromise = loadPromise
22192
22193
  .then(([resolveStaticDependencyPromises, resolveDynamicImportPromises]) => Promise.all([...resolveStaticDependencyPromises, ...resolveDynamicImportPromises]))
@@ -22194,23 +22195,25 @@ class ModuleLoader {
22194
22195
  loadAndResolveDependenciesPromise.catch(() => {
22195
22196
  /* avoid unhandled promise rejections */
22196
22197
  });
22197
- if (isPreload) {
22198
- this.moduleLoadPromises.set(module, loadPromise);
22199
- await loadPromise;
22200
- }
22201
- else {
22202
- await this.fetchModuleDependencies(module, ...(await loadPromise));
22203
- // To handle errors when resolving dependencies or in moduleParsed
22204
- await loadAndResolveDependenciesPromise;
22198
+ this.moduleLoadPromises.set(module, loadPromise);
22199
+ const resolveDependencyPromises = await loadPromise;
22200
+ if (!isPreload) {
22201
+ await this.fetchModuleDependencies(module, ...resolveDependencyPromises);
22205
22202
  }
22206
22203
  return module;
22207
22204
  }
22208
- async fetchModuleDependencies(module, resolveStaticDependencyPromises, resolveDynamicDependencyPromises) {
22205
+ async fetchModuleDependencies(module, resolveStaticDependencyPromises, resolveDynamicDependencyPromises, loadAndResolveDependenciesPromise) {
22206
+ if (this.modulesWithLoadedDependencies.has(module)) {
22207
+ return;
22208
+ }
22209
+ this.modulesWithLoadedDependencies.add(module);
22209
22210
  await Promise.all([
22210
22211
  this.fetchStaticDependencies(module, resolveStaticDependencyPromises),
22211
22212
  this.fetchDynamicDependencies(module, resolveDynamicDependencyPromises)
22212
22213
  ]);
22213
22214
  module.linkImports();
22215
+ // To handle errors when resolving dependencies or in moduleParsed
22216
+ await loadAndResolveDependenciesPromise;
22214
22217
  }
22215
22218
  fetchResolvedDependency(source, importer, resolvedId) {
22216
22219
  if (resolvedId.external) {
@@ -22299,8 +22302,7 @@ class ModuleLoader {
22299
22302
  async handleExistingModule(module, isEntry, isPreload) {
22300
22303
  const loadPromise = this.moduleLoadPromises.get(module);
22301
22304
  if (isPreload) {
22302
- await loadPromise;
22303
- return;
22305
+ return loadPromise;
22304
22306
  }
22305
22307
  if (isEntry) {
22306
22308
  module.info.isEntry = true;
@@ -22310,11 +22312,7 @@ class ModuleLoader {
22310
22312
  }
22311
22313
  module.implicitlyLoadedAfter.clear();
22312
22314
  }
22313
- if (loadPromise) {
22314
- this.moduleLoadPromises.delete(module);
22315
- await this.fetchModuleDependencies(module, ...(await loadPromise));
22316
- }
22317
- return;
22315
+ return this.fetchModuleDependencies(module, ...(await loadPromise));
22318
22316
  }
22319
22317
  handleResolveId(resolvedId, source, importer) {
22320
22318
  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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "2.61.0",
3
+ "version": "2.61.1",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",