rollup 3.13.0 → 3.15.0

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <a href="https://rollupjs.org/"><img src="https://rollupjs.org/logo.svg" width="150" /></a>
2
+ <a href="https://rollupjs.org/"><img src="https://rollupjs.org/rollup-logo.svg" width="150" /></a>
3
3
  </p>
4
4
 
5
5
  <p align="center">
package/dist/bin/rollup CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  /*
4
4
  @license
5
- Rollup.js v3.13.0
6
- Fri, 03 Feb 2023 12:52:06 GMT - commit 45980b51bc13f52a9583d6c898814040f4ee9128
5
+ Rollup.js v3.15.0
6
+ Fri, 10 Feb 2023 05:20:05 GMT - commit 5d81532f688383a8aeaf6a099da2b0205e8b8609
7
7
 
8
8
  https://github.com/rollup/rollup
9
9
 
package/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.13.0
4
- Fri, 03 Feb 2023 12:52:06 GMT - commit 45980b51bc13f52a9583d6c898814040f4ee9128
3
+ Rollup.js v3.15.0
4
+ Fri, 10 Feb 2023 05:20:05 GMT - commit 5d81532f688383a8aeaf6a099da2b0205e8b8609
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.13.0
4
- Fri, 03 Feb 2023 12:52:06 GMT - commit 45980b51bc13f52a9583d6c898814040f4ee9128
3
+ Rollup.js v3.15.0
4
+ Fri, 10 Feb 2023 05:20:05 GMT - commit 5d81532f688383a8aeaf6a099da2b0205e8b8609
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,7 +16,7 @@ import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/pr
16
16
  import { EventEmitter } from 'node:events';
17
17
  import * as tty from 'tty';
18
18
 
19
- var version$1 = "3.13.0";
19
+ var version$1 = "3.15.0";
20
20
 
21
21
  const comma = ','.charCodeAt(0);
22
22
  const semicolon = ';'.charCodeAt(0);
@@ -5025,7 +5025,8 @@ function createHasEffectsContext() {
5025
5025
  breaks: false,
5026
5026
  continues: false,
5027
5027
  labels: new Set(),
5028
- returnYield: false
5028
+ returnYield: false,
5029
+ this: false
5029
5030
  },
5030
5031
  includedLabels: new Set(),
5031
5032
  instantiated: new DiscriminatedPathTracker(),
@@ -6625,7 +6626,7 @@ class LocalVariable extends Variable {
6625
6626
  case INTERACTION_ACCESSED: {
6626
6627
  if (this.isReassigned)
6627
6628
  return true;
6628
- return (this.init &&
6629
+ return !!(this.init &&
6629
6630
  !context.accessed.trackEntityAtPathAndGetIfTracked(path, this) &&
6630
6631
  this.init.hasEffectsOnInteractionAtPath(path, interaction, context));
6631
6632
  }
@@ -6636,14 +6637,14 @@ class LocalVariable extends Variable {
6636
6637
  return false;
6637
6638
  if (this.isReassigned)
6638
6639
  return true;
6639
- return (this.init &&
6640
+ return !!(this.init &&
6640
6641
  !context.assigned.trackEntityAtPathAndGetIfTracked(path, this) &&
6641
6642
  this.init.hasEffectsOnInteractionAtPath(path, interaction, context));
6642
6643
  }
6643
6644
  case INTERACTION_CALLED: {
6644
6645
  if (this.isReassigned)
6645
6646
  return true;
6646
- return (this.init &&
6647
+ return !!(this.init &&
6647
6648
  !(interaction.withNew ? context.instantiated : context.called).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) &&
6648
6649
  this.init.hasEffectsOnInteractionAtPath(path, interaction, context));
6649
6650
  }
@@ -8487,7 +8488,8 @@ class ArrowFunctionExpression extends FunctionBase {
8487
8488
  breaks: false,
8488
8489
  continues: false,
8489
8490
  labels: new Set(),
8490
- returnYield: true
8491
+ returnYield: true,
8492
+ this: false
8491
8493
  };
8492
8494
  if (this.body.hasEffects(context))
8493
8495
  return true;
@@ -8757,11 +8759,14 @@ class ThisVariable extends LocalVariable {
8757
8759
  }
8758
8760
  }
8759
8761
  hasEffectsOnInteractionAtPath(path, interaction, context) {
8760
- return (this.getInit(context).hasEffectsOnInteractionAtPath(path, interaction, context) ||
8761
- super.hasEffectsOnInteractionAtPath(path, interaction, context));
8762
- }
8763
- getInit(context) {
8764
- return context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION;
8762
+ const replacedVariableInit = context.replacedVariableInits.get(this);
8763
+ if (replacedVariableInit) {
8764
+ return (replacedVariableInit.hasEffectsOnInteractionAtPath(path, interaction, context) ||
8765
+ // If the surrounding function is included, all mutations of "this" must
8766
+ // be counted as side effects, which is what this second line does.
8767
+ (!context.ignore.this && super.hasEffectsOnInteractionAtPath(path, interaction, context)));
8768
+ }
8769
+ return UNKNOWN_EXPRESSION.hasEffectsOnInteractionAtPath(path, interaction, context);
8765
8770
  }
8766
8771
  }
8767
8772
 
@@ -8793,6 +8798,10 @@ class FunctionNode extends FunctionBase {
8793
8798
  }
8794
8799
  createScope(parentScope) {
8795
8800
  this.scope = new FunctionScope(parentScope, this.context);
8801
+ this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE);
8802
+ // This makes sure that all deoptimizations of "this" are applied to the
8803
+ // constructed entity.
8804
+ this.scope.thisVariable.addEntityToBeDeoptimized(this.constructedEntity);
8796
8805
  }
8797
8806
  deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) {
8798
8807
  super.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);
@@ -8810,15 +8819,14 @@ class FunctionNode extends FunctionBase {
8810
8819
  return true;
8811
8820
  if (interaction.type === INTERACTION_CALLED) {
8812
8821
  const thisInit = context.replacedVariableInits.get(this.scope.thisVariable);
8813
- context.replacedVariableInits.set(this.scope.thisVariable, interaction.withNew
8814
- ? new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE)
8815
- : UNKNOWN_EXPRESSION);
8822
+ context.replacedVariableInits.set(this.scope.thisVariable, interaction.withNew ? this.constructedEntity : UNKNOWN_EXPRESSION);
8816
8823
  const { brokenFlow, ignore, replacedVariableInits } = context;
8817
8824
  context.ignore = {
8818
8825
  breaks: false,
8819
8826
  continues: false,
8820
8827
  labels: new Set(),
8821
- returnYield: true
8828
+ returnYield: true,
8829
+ this: interaction.withNew
8822
8830
  };
8823
8831
  if (this.body.hasEffects(context))
8824
8832
  return true;
@@ -16048,7 +16056,7 @@ function* concatLazy(iterables) {
16048
16056
  }
16049
16057
  }
16050
16058
 
16051
- function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize) {
16059
+ function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, deepChunkOptimization) {
16052
16060
  const chunkDefinitions = [];
16053
16061
  const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys());
16054
16062
  const manualChunkModulesByAlias = Object.create(null);
@@ -16063,7 +16071,7 @@ function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize) {
16063
16071
  const assignedEntriesByModule = new Map();
16064
16072
  for (const entry of allEntries) {
16065
16073
  if (!modulesInManualChunks.has(entry)) {
16066
- assignEntryToStaticDependencies(entry, dependentEntriesByModule, assignedEntriesByModule, modulesInManualChunks, staticEntries, dynamicallyDependentEntriesByDynamicEntry);
16074
+ assignEntryToStaticDependencies(entry, dependentEntriesByModule, assignedEntriesByModule, modulesInManualChunks, staticEntries, dynamicallyDependentEntriesByDynamicEntry, deepChunkOptimization);
16067
16075
  }
16068
16076
  }
16069
16077
  chunkDefinitions.push(...createChunks(allEntries, assignedEntriesByModule, minChunkSize));
@@ -16131,13 +16139,13 @@ function getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule,
16131
16139
  }
16132
16140
  return dynamicallyDependentEntriesByDynamicEntry;
16133
16141
  }
16134
- function assignEntryToStaticDependencies(entry, dependentEntriesByModule, assignedEntriesByModule, modulesInManualChunks, staticEntries, dynamicallyDependentEntriesByDynamicEntry) {
16142
+ function assignEntryToStaticDependencies(entry, dependentEntriesByModule, assignedEntriesByModule, modulesInManualChunks, staticEntries, dynamicallyDependentEntriesByDynamicEntry, deepChunkOptimization) {
16135
16143
  const dynamicallyDependentEntries = dynamicallyDependentEntriesByDynamicEntry.get(entry);
16136
16144
  const modulesToHandle = new Set([entry]);
16137
16145
  for (const module of modulesToHandle) {
16138
16146
  const assignedEntries = getOrCreate(assignedEntriesByModule, module, getNewSet);
16139
16147
  if (dynamicallyDependentEntries &&
16140
- isModuleAlreadyLoaded(dynamicallyDependentEntries, dependentEntriesByModule.get(module), staticEntries, dynamicallyDependentEntriesByDynamicEntry)) {
16148
+ isModuleAlreadyLoaded(dynamicallyDependentEntries, dependentEntriesByModule.get(module), staticEntries, dynamicallyDependentEntriesByDynamicEntry, deepChunkOptimization)) {
16141
16149
  continue;
16142
16150
  }
16143
16151
  else {
@@ -16155,8 +16163,9 @@ const MAX_ENTRIES_TO_CHECK_FOR_SHARED_DEPENDENCIES = 3;
16155
16163
  // - first, create chunks without looking for modules already in memory
16156
16164
  // - all modules that are in the same chunk after this will behave the same
16157
16165
  // -> Do not iterate by module but by equivalence group and merge chunks
16158
- function isModuleAlreadyLoaded(dynamicallyDependentEntries, containedIn, staticEntries, dynamicallyDependentEntriesByDynamicEntry) {
16159
- if (dynamicallyDependentEntries.size > MAX_ENTRIES_TO_CHECK_FOR_SHARED_DEPENDENCIES) {
16166
+ function isModuleAlreadyLoaded(dynamicallyDependentEntries, containedIn, staticEntries, dynamicallyDependentEntriesByDynamicEntry, deepChunkOptimization) {
16167
+ if (!deepChunkOptimization &&
16168
+ dynamicallyDependentEntries.size > MAX_ENTRIES_TO_CHECK_FOR_SHARED_DEPENDENCIES) {
16160
16169
  return false;
16161
16170
  }
16162
16171
  const entriesToCheck = new Set(dynamicallyDependentEntries);
@@ -16166,7 +16175,8 @@ function isModuleAlreadyLoaded(dynamicallyDependentEntries, containedIn, staticE
16166
16175
  return false;
16167
16176
  }
16168
16177
  const dynamicallyDependentEntries = dynamicallyDependentEntriesByDynamicEntry.get(entry);
16169
- if (dynamicallyDependentEntries.size > MAX_ENTRIES_TO_CHECK_FOR_SHARED_DEPENDENCIES) {
16178
+ if (!deepChunkOptimization &&
16179
+ dynamicallyDependentEntries.size > MAX_ENTRIES_TO_CHECK_FOR_SHARED_DEPENDENCIES) {
16170
16180
  return false;
16171
16181
  }
16172
16182
  for (const dependentEntry of dynamicallyDependentEntries) {
@@ -16993,7 +17003,7 @@ class Bundle {
16993
17003
  this.pluginDriver.finaliseAssets();
16994
17004
  }
16995
17005
  async generateChunks(bundle, getHashPlaceholder) {
16996
- const { experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules } = this.outputOptions;
17006
+ const { experimentalDeepDynamicChunkOptimization, experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules } = this.outputOptions;
16997
17007
  const manualChunkAliasByEntry = typeof manualChunks === 'object'
16998
17008
  ? await this.addManualChunks(manualChunks)
16999
17009
  : this.assignManualChunks(manualChunks);
@@ -17007,7 +17017,7 @@ class Bundle {
17007
17017
  ? [{ alias: null, modules: includedModules }]
17008
17018
  : preserveModules
17009
17019
  ? includedModules.map(module => ({ alias: null, modules: [module] }))
17010
- : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize)) {
17020
+ : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize, experimentalDeepDynamicChunkOptimization)) {
17011
17021
  sortByExecutionOrder(modules);
17012
17022
  const chunk = new Chunk(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias, getHashPlaceholder, bundle, inputBase, snippets);
17013
17023
  chunks.push(chunk);
@@ -24798,6 +24808,7 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
24798
24808
  dynamicImportInCjs: config.dynamicImportInCjs ?? true,
24799
24809
  entryFileNames: getEntryFileNames(config, unsetOptions),
24800
24810
  esModule: config.esModule ?? 'if-default-prop',
24811
+ experimentalDeepDynamicChunkOptimization: config.experimentalDeepDynamicChunkOptimization || false,
24801
24812
  experimentalMinChunkSize: config.experimentalMinChunkSize || 0,
24802
24813
  exports: getExports(config, unsetOptions),
24803
24814
  extend: config.extend || false,
@@ -25489,6 +25500,7 @@ async function mergeOutputOptions(config, overrides, warn) {
25489
25500
  dynamicImportInCjs: getOption('dynamicImportInCjs'),
25490
25501
  entryFileNames: getOption('entryFileNames'),
25491
25502
  esModule: getOption('esModule'),
25503
+ experimentalDeepDynamicChunkOptimization: getOption('experimentalDeepDynamicChunkOptimization'),
25492
25504
  experimentalMinChunkSize: getOption('experimentalMinChunkSize'),
25493
25505
  exports: getOption('exports'),
25494
25506
  extend: getOption('extend'),
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.13.0
4
- Fri, 03 Feb 2023 12:52:06 GMT - commit 45980b51bc13f52a9583d6c898814040f4ee9128
3
+ Rollup.js v3.15.0
4
+ Fri, 10 Feb 2023 05:20:05 GMT - commit 5d81532f688383a8aeaf6a099da2b0205e8b8609
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.13.0
4
- Fri, 03 Feb 2023 12:52:06 GMT - commit 45980b51bc13f52a9583d6c898814040f4ee9128
3
+ Rollup.js v3.15.0
4
+ Fri, 10 Feb 2023 05:20:05 GMT - commit 5d81532f688383a8aeaf6a099da2b0205e8b8609
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.d.ts CHANGED
@@ -647,6 +647,7 @@ export interface OutputOptions {
647
647
  dynamicImportInCjs?: boolean;
648
648
  entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
649
649
  esModule?: boolean | 'if-default-prop';
650
+ experimentalDeepDynamicChunkOptimization?: boolean;
650
651
  experimentalMinChunkSize?: number;
651
652
  exports?: 'default' | 'named' | 'none' | 'auto';
652
653
  extend?: boolean;
@@ -700,6 +701,7 @@ export interface NormalizedOutputOptions {
700
701
  dynamicImportInCjs: boolean;
701
702
  entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
702
703
  esModule: boolean | 'if-default-prop';
704
+ experimentalDeepDynamicChunkOptimization: boolean;
703
705
  experimentalMinChunkSize: number;
704
706
  exports: 'default' | 'named' | 'none' | 'auto';
705
707
  extend: boolean;
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.13.0
4
- Fri, 03 Feb 2023 12:52:06 GMT - commit 45980b51bc13f52a9583d6c898814040f4ee9128
3
+ Rollup.js v3.15.0
4
+ Fri, 10 Feb 2023 05:20:05 GMT - commit 5d81532f688383a8aeaf6a099da2b0205e8b8609
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.13.0
4
- Fri, 03 Feb 2023 12:52:06 GMT - commit 45980b51bc13f52a9583d6c898814040f4ee9128
3
+ Rollup.js v3.15.0
4
+ Fri, 10 Feb 2023 05:20:05 GMT - commit 5d81532f688383a8aeaf6a099da2b0205e8b8609
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.13.0
4
- Fri, 03 Feb 2023 12:52:06 GMT - commit 45980b51bc13f52a9583d6c898814040f4ee9128
3
+ Rollup.js v3.15.0
4
+ Fri, 10 Feb 2023 05:20:05 GMT - commit 5d81532f688383a8aeaf6a099da2b0205e8b8609
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.13.0
4
- Fri, 03 Feb 2023 12:52:06 GMT - commit 45980b51bc13f52a9583d6c898814040f4ee9128
3
+ Rollup.js v3.15.0
4
+ Fri, 10 Feb 2023 05:20:05 GMT - commit 5d81532f688383a8aeaf6a099da2b0205e8b8609
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -31,7 +31,7 @@ function _interopNamespaceDefault(e) {
31
31
 
32
32
  const tty__namespace = /*#__PURE__*/_interopNamespaceDefault(tty);
33
33
 
34
- var version$1 = "3.13.0";
34
+ var version$1 = "3.15.0";
35
35
 
36
36
  function ensureArray$1(items) {
37
37
  if (Array.isArray(items)) {
@@ -1081,6 +1081,7 @@ async function mergeOutputOptions(config, overrides, warn) {
1081
1081
  dynamicImportInCjs: getOption('dynamicImportInCjs'),
1082
1082
  entryFileNames: getOption('entryFileNames'),
1083
1083
  esModule: getOption('esModule'),
1084
+ experimentalDeepDynamicChunkOptimization: getOption('experimentalDeepDynamicChunkOptimization'),
1084
1085
  experimentalMinChunkSize: getOption('experimentalMinChunkSize'),
1085
1086
  exports: getOption('exports'),
1086
1087
  extend: getOption('extend'),
@@ -5543,7 +5544,8 @@ function createHasEffectsContext() {
5543
5544
  breaks: false,
5544
5545
  continues: false,
5545
5546
  labels: new Set(),
5546
- returnYield: false
5547
+ returnYield: false,
5548
+ this: false
5547
5549
  },
5548
5550
  includedLabels: new Set(),
5549
5551
  instantiated: new DiscriminatedPathTracker(),
@@ -7143,7 +7145,7 @@ class LocalVariable extends Variable {
7143
7145
  case INTERACTION_ACCESSED: {
7144
7146
  if (this.isReassigned)
7145
7147
  return true;
7146
- return (this.init &&
7148
+ return !!(this.init &&
7147
7149
  !context.accessed.trackEntityAtPathAndGetIfTracked(path, this) &&
7148
7150
  this.init.hasEffectsOnInteractionAtPath(path, interaction, context));
7149
7151
  }
@@ -7154,14 +7156,14 @@ class LocalVariable extends Variable {
7154
7156
  return false;
7155
7157
  if (this.isReassigned)
7156
7158
  return true;
7157
- return (this.init &&
7159
+ return !!(this.init &&
7158
7160
  !context.assigned.trackEntityAtPathAndGetIfTracked(path, this) &&
7159
7161
  this.init.hasEffectsOnInteractionAtPath(path, interaction, context));
7160
7162
  }
7161
7163
  case INTERACTION_CALLED: {
7162
7164
  if (this.isReassigned)
7163
7165
  return true;
7164
- return (this.init &&
7166
+ return !!(this.init &&
7165
7167
  !(interaction.withNew ? context.instantiated : context.called).trackEntityAtPathAndGetIfTracked(path, interaction.args, this) &&
7166
7168
  this.init.hasEffectsOnInteractionAtPath(path, interaction, context));
7167
7169
  }
@@ -9005,7 +9007,8 @@ class ArrowFunctionExpression extends FunctionBase {
9005
9007
  breaks: false,
9006
9008
  continues: false,
9007
9009
  labels: new Set(),
9008
- returnYield: true
9010
+ returnYield: true,
9011
+ this: false
9009
9012
  };
9010
9013
  if (this.body.hasEffects(context))
9011
9014
  return true;
@@ -9275,11 +9278,14 @@ class ThisVariable extends LocalVariable {
9275
9278
  }
9276
9279
  }
9277
9280
  hasEffectsOnInteractionAtPath(path, interaction, context) {
9278
- return (this.getInit(context).hasEffectsOnInteractionAtPath(path, interaction, context) ||
9279
- super.hasEffectsOnInteractionAtPath(path, interaction, context));
9280
- }
9281
- getInit(context) {
9282
- return context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION;
9281
+ const replacedVariableInit = context.replacedVariableInits.get(this);
9282
+ if (replacedVariableInit) {
9283
+ return (replacedVariableInit.hasEffectsOnInteractionAtPath(path, interaction, context) ||
9284
+ // If the surrounding function is included, all mutations of "this" must
9285
+ // be counted as side effects, which is what this second line does.
9286
+ (!context.ignore.this && super.hasEffectsOnInteractionAtPath(path, interaction, context)));
9287
+ }
9288
+ return UNKNOWN_EXPRESSION.hasEffectsOnInteractionAtPath(path, interaction, context);
9283
9289
  }
9284
9290
  }
9285
9291
 
@@ -9311,6 +9317,10 @@ class FunctionNode extends FunctionBase {
9311
9317
  }
9312
9318
  createScope(parentScope) {
9313
9319
  this.scope = new FunctionScope(parentScope, this.context);
9320
+ this.constructedEntity = new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE);
9321
+ // This makes sure that all deoptimizations of "this" are applied to the
9322
+ // constructed entity.
9323
+ this.scope.thisVariable.addEntityToBeDeoptimized(this.constructedEntity);
9314
9324
  }
9315
9325
  deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker) {
9316
9326
  super.deoptimizeThisOnInteractionAtPath(interaction, path, recursionTracker);
@@ -9328,15 +9338,14 @@ class FunctionNode extends FunctionBase {
9328
9338
  return true;
9329
9339
  if (interaction.type === INTERACTION_CALLED) {
9330
9340
  const thisInit = context.replacedVariableInits.get(this.scope.thisVariable);
9331
- context.replacedVariableInits.set(this.scope.thisVariable, interaction.withNew
9332
- ? new ObjectEntity(Object.create(null), OBJECT_PROTOTYPE)
9333
- : UNKNOWN_EXPRESSION);
9341
+ context.replacedVariableInits.set(this.scope.thisVariable, interaction.withNew ? this.constructedEntity : UNKNOWN_EXPRESSION);
9334
9342
  const { brokenFlow, ignore, replacedVariableInits } = context;
9335
9343
  context.ignore = {
9336
9344
  breaks: false,
9337
9345
  continues: false,
9338
9346
  labels: new Set(),
9339
- returnYield: true
9347
+ returnYield: true,
9348
+ this: interaction.withNew
9340
9349
  };
9341
9350
  if (this.body.hasEffects(context))
9342
9351
  return true;
@@ -16566,7 +16575,7 @@ function* concatLazy(iterables) {
16566
16575
  }
16567
16576
  }
16568
16577
 
16569
- function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize) {
16578
+ function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, deepChunkOptimization) {
16570
16579
  const chunkDefinitions = [];
16571
16580
  const modulesInManualChunks = new Set(manualChunkAliasByEntry.keys());
16572
16581
  const manualChunkModulesByAlias = Object.create(null);
@@ -16581,7 +16590,7 @@ function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize) {
16581
16590
  const assignedEntriesByModule = new Map();
16582
16591
  for (const entry of allEntries) {
16583
16592
  if (!modulesInManualChunks.has(entry)) {
16584
- assignEntryToStaticDependencies(entry, dependentEntriesByModule, assignedEntriesByModule, modulesInManualChunks, staticEntries, dynamicallyDependentEntriesByDynamicEntry);
16593
+ assignEntryToStaticDependencies(entry, dependentEntriesByModule, assignedEntriesByModule, modulesInManualChunks, staticEntries, dynamicallyDependentEntriesByDynamicEntry, deepChunkOptimization);
16585
16594
  }
16586
16595
  }
16587
16596
  chunkDefinitions.push(...createChunks(allEntries, assignedEntriesByModule, minChunkSize));
@@ -16649,13 +16658,13 @@ function getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule,
16649
16658
  }
16650
16659
  return dynamicallyDependentEntriesByDynamicEntry;
16651
16660
  }
16652
- function assignEntryToStaticDependencies(entry, dependentEntriesByModule, assignedEntriesByModule, modulesInManualChunks, staticEntries, dynamicallyDependentEntriesByDynamicEntry) {
16661
+ function assignEntryToStaticDependencies(entry, dependentEntriesByModule, assignedEntriesByModule, modulesInManualChunks, staticEntries, dynamicallyDependentEntriesByDynamicEntry, deepChunkOptimization) {
16653
16662
  const dynamicallyDependentEntries = dynamicallyDependentEntriesByDynamicEntry.get(entry);
16654
16663
  const modulesToHandle = new Set([entry]);
16655
16664
  for (const module of modulesToHandle) {
16656
16665
  const assignedEntries = getOrCreate(assignedEntriesByModule, module, getNewSet);
16657
16666
  if (dynamicallyDependentEntries &&
16658
- isModuleAlreadyLoaded(dynamicallyDependentEntries, dependentEntriesByModule.get(module), staticEntries, dynamicallyDependentEntriesByDynamicEntry)) {
16667
+ isModuleAlreadyLoaded(dynamicallyDependentEntries, dependentEntriesByModule.get(module), staticEntries, dynamicallyDependentEntriesByDynamicEntry, deepChunkOptimization)) {
16659
16668
  continue;
16660
16669
  }
16661
16670
  else {
@@ -16673,8 +16682,9 @@ const MAX_ENTRIES_TO_CHECK_FOR_SHARED_DEPENDENCIES = 3;
16673
16682
  // - first, create chunks without looking for modules already in memory
16674
16683
  // - all modules that are in the same chunk after this will behave the same
16675
16684
  // -> Do not iterate by module but by equivalence group and merge chunks
16676
- function isModuleAlreadyLoaded(dynamicallyDependentEntries, containedIn, staticEntries, dynamicallyDependentEntriesByDynamicEntry) {
16677
- if (dynamicallyDependentEntries.size > MAX_ENTRIES_TO_CHECK_FOR_SHARED_DEPENDENCIES) {
16685
+ function isModuleAlreadyLoaded(dynamicallyDependentEntries, containedIn, staticEntries, dynamicallyDependentEntriesByDynamicEntry, deepChunkOptimization) {
16686
+ if (!deepChunkOptimization &&
16687
+ dynamicallyDependentEntries.size > MAX_ENTRIES_TO_CHECK_FOR_SHARED_DEPENDENCIES) {
16678
16688
  return false;
16679
16689
  }
16680
16690
  const entriesToCheck = new Set(dynamicallyDependentEntries);
@@ -16684,7 +16694,8 @@ function isModuleAlreadyLoaded(dynamicallyDependentEntries, containedIn, staticE
16684
16694
  return false;
16685
16695
  }
16686
16696
  const dynamicallyDependentEntries = dynamicallyDependentEntriesByDynamicEntry.get(entry);
16687
- if (dynamicallyDependentEntries.size > MAX_ENTRIES_TO_CHECK_FOR_SHARED_DEPENDENCIES) {
16697
+ if (!deepChunkOptimization &&
16698
+ dynamicallyDependentEntries.size > MAX_ENTRIES_TO_CHECK_FOR_SHARED_DEPENDENCIES) {
16688
16699
  return false;
16689
16700
  }
16690
16701
  for (const dependentEntry of dynamicallyDependentEntries) {
@@ -17511,7 +17522,7 @@ class Bundle {
17511
17522
  this.pluginDriver.finaliseAssets();
17512
17523
  }
17513
17524
  async generateChunks(bundle, getHashPlaceholder) {
17514
- const { experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules } = this.outputOptions;
17525
+ const { experimentalDeepDynamicChunkOptimization, experimentalMinChunkSize, inlineDynamicImports, manualChunks, preserveModules } = this.outputOptions;
17515
17526
  const manualChunkAliasByEntry = typeof manualChunks === 'object'
17516
17527
  ? await this.addManualChunks(manualChunks)
17517
17528
  : this.assignManualChunks(manualChunks);
@@ -17525,7 +17536,7 @@ class Bundle {
17525
17536
  ? [{ alias: null, modules: includedModules }]
17526
17537
  : preserveModules
17527
17538
  ? includedModules.map(module => ({ alias: null, modules: [module] }))
17528
- : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize)) {
17539
+ : getChunkAssignments(this.graph.entryModules, manualChunkAliasByEntry, experimentalMinChunkSize, experimentalDeepDynamicChunkOptimization)) {
17529
17540
  sortByExecutionOrder(modules);
17530
17541
  const chunk = new Chunk(modules, this.inputOptions, this.outputOptions, this.unsetOptions, this.pluginDriver, this.graph.modulesById, chunkByModule, externalChunkByModule, this.facadeChunkByModule, this.includedNamespaces, alias, getHashPlaceholder, bundle, inputBase, snippets);
17531
17542
  chunks.push(chunk);
@@ -25220,6 +25231,7 @@ async function normalizeOutputOptions(config, inputOptions, unsetInputOptions) {
25220
25231
  dynamicImportInCjs: config.dynamicImportInCjs ?? true,
25221
25232
  entryFileNames: getEntryFileNames(config, unsetOptions),
25222
25233
  esModule: config.esModule ?? 'if-default-prop',
25234
+ experimentalDeepDynamicChunkOptimization: config.experimentalDeepDynamicChunkOptimization || false,
25223
25235
  experimentalMinChunkSize: config.experimentalMinChunkSize || 0,
25224
25236
  exports: getExports(config, unsetOptions),
25225
25237
  extend: config.extend || false,
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.13.0
4
- Fri, 03 Feb 2023 12:52:06 GMT - commit 45980b51bc13f52a9583d6c898814040f4ee9128
3
+ Rollup.js v3.15.0
4
+ Fri, 10 Feb 2023 05:20:05 GMT - commit 5d81532f688383a8aeaf6a099da2b0205e8b8609
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v3.13.0
4
- Fri, 03 Feb 2023 12:52:06 GMT - commit 45980b51bc13f52a9583d6c898814040f4ee9128
3
+ Rollup.js v3.15.0
4
+ Fri, 10 Feb 2023 05:20:05 GMT - commit 5d81532f688383a8aeaf6a099da2b0205e8b8609
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rollup",
3
- "version": "3.13.0",
3
+ "version": "3.15.0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -29,6 +29,7 @@
29
29
  "prepare": "husky install && node scripts/check-release.js || npm run build",
30
30
  "prepublishOnly": "node scripts/check-release.js",
31
31
  "release": "node scripts/release.js",
32
+ "release:docs": "git fetch --update-head-ok origin master:master && git branch --force documentation-published master && git push origin documentation-published",
32
33
  "test": "npm run build && npm run test:all",
33
34
  "test:update-snapshots": "node scripts/update-snapshots.js",
34
35
  "test:cjs": "npm run build:cjs && npm run test:only",