rollup 4.21.3 → 4.22.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/dist/bin/rollup CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
3
  @license
4
- Rollup.js v4.21.3
5
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
4
+ Rollup.js v4.22.0
5
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
6
6
 
7
7
  https://github.com/rollup/rollup
8
8
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,13 +1,13 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
8
8
  Released under the MIT License.
9
9
  */
10
- import { normalize, getImportPath, ExportDefaultDeclaration as ExportDefaultDeclaration$1, CallExpression as CallExpression$1, EMPTY_ARRAY, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, Program as Program$1, BLANK, logIllegalImportReassignment, logRedeclarationError, CatchClause as CatchClause$1, logDuplicateArgumentNameError, logModuleLevelDirective, ReturnStatement as ReturnStatement$1, VariableDeclarator as VariableDeclarator$1, Property as Property$1, logConstVariableReassignError, ExpressionStatement as ExpressionStatement$1, ArrowFunctionExpression as ArrowFunctionExpression$1, logMissingExport, EMPTY_SET, logCannotCallNamespace, logEval, StaticBlock as StaticBlock$1, BlockStatement as BlockStatement$1, getRollupError, logParseError, logModuleParseError, error, LOGLEVEL_INFO, logFirstSideEffect, locate, logInvalidAnnotation, Identifier as Identifier$1, logThisIsUndefined, getAstBuffer, convertAnnotations, FIXED_STRINGS, convertNode as convertNode$1, EMPTY_OBJECT, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logSyntheticNamedExportsNeedNamespaceExport, logMissingEntryExport, logInvalidFormatForTopLevelAwait, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, logCircularReexport, TemplateLiteral as TemplateLiteral$1, Literal as Literal$1, logMissingNodeBuiltins, logReservedNamespace, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logAddonNotGenerated, logIncompatibleExportOptionValue, logMixedExport, logFailedValidation, isPathFragment, logCyclicCrossChunkReexport, getAliasName, logUnexpectedNamedImport, isAbsolute as isAbsolute$1, relative as relative$1, logUnexpectedNamespaceReexport, logEmptyChunk, logMissingGlobalName, logOptimizeChunkStatus, logSourcemapBroken, logConflictingSourcemapSources, logChunkInvalid, logInvalidOption, URL_OUTPUT_FORMAT, URL_OUTPUT_DIR, URL_OUTPUT_SOURCEMAPFILE, URL_OUTPUT_AMD_ID, logCannotAssignModuleToChunk, logAnonymousPluginCache, logDuplicatePluginName, LOGLEVEL_ERROR, logLevelPriority, LOGLEVEL_DEBUG, logUnknownOption, printQuotedStringList, logInvalidSetAssetSourceCall, logPluginError, logNoTransformMapOrAstWithoutCode, relativeId, logBadLoader, logExternalModulesCannotBeTransformedToModules, logInternalIdCannotBeExternal, isRelative, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logExternalSyntheticExports, logUnresolvedEntry, logUnresolvedImplicitDependant, logExternalModulesCannotBeIncludedInManualChunks, logEntryCannotBeExternal, logImplicitDependantCannotBeExternal, logNoAssetSourceSet, logFileReferenceIdNotFoundForFilename, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logInvalidRollupPhaseForChunkEmission, logFileNameConflict, logAssetNotFinalisedForFileName, logChunkNotGeneratedForFileName, logInvalidLogPosition, logInputHookInOutputPlugin, logInvalidFunctionPluginHook, logInvalidAddonPluginHook, logImplicitDependantIsNotIncluded, logCircularDependency, augmentLogMessage, URL_TREESHAKE_MODULESIDEEFFECTS, URL_TREESHAKE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_PRESERVEENTRYSIGNATURES, URL_OUTPUT_AMD_BASEPATH, logInvalidExportOptionValue, warnDeprecation, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, isValidUrl, addTrailingSlashIfMissed, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, logAlreadyClosed, logMissingFileOrDirOption, logCannotEmitFromOptionsHook, URL_WATCH } from './parseAst.js';
10
+ import { normalize, getImportPath, ExportDefaultDeclaration as ExportDefaultDeclaration$1, CallExpression as CallExpression$1, EMPTY_ARRAY, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, Program as Program$1, BLANK, logIllegalImportReassignment, logRedeclarationError, CatchClause as CatchClause$1, logDuplicateArgumentNameError, logModuleLevelDirective, ReturnStatement as ReturnStatement$1, VariableDeclarator as VariableDeclarator$1, Property as Property$1, logConstVariableReassignError, ExpressionStatement as ExpressionStatement$1, ArrowFunctionExpression as ArrowFunctionExpression$1, logMissingExport, EMPTY_SET, logCannotCallNamespace, logEval, StaticBlock as StaticBlock$1, BlockStatement as BlockStatement$1, getRollupError, logParseError, logModuleParseError, error, LOGLEVEL_INFO, logFirstSideEffect, locate, logInvalidAnnotation, Identifier as Identifier$1, logThisIsUndefined, getAstBuffer, convertAnnotations, FIXED_STRINGS, convertNode as convertNode$1, EMPTY_OBJECT, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logSyntheticNamedExportsNeedNamespaceExport, logMissingEntryExport, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, logCircularReexport, logInvalidFormatForTopLevelAwait, TemplateLiteral as TemplateLiteral$1, Literal as Literal$1, logMissingNodeBuiltins, logReservedNamespace, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logAddonNotGenerated, logIncompatibleExportOptionValue, logMixedExport, logFailedValidation, isPathFragment, logCyclicCrossChunkReexport, getAliasName, logUnexpectedNamedImport, isAbsolute as isAbsolute$1, relative as relative$1, logUnexpectedNamespaceReexport, logEmptyChunk, logMissingGlobalName, logOptimizeChunkStatus, logSourcemapBroken, logConflictingSourcemapSources, logChunkInvalid, logInvalidOption, URL_OUTPUT_FORMAT, URL_OUTPUT_DIR, URL_OUTPUT_SOURCEMAPFILE, URL_OUTPUT_AMD_ID, logCannotAssignModuleToChunk, logAnonymousPluginCache, logDuplicatePluginName, logUnknownOption, printQuotedStringList, LOGLEVEL_ERROR, logLevelPriority, LOGLEVEL_DEBUG, logInvalidSetAssetSourceCall, logPluginError, logNoTransformMapOrAstWithoutCode, relativeId, logBadLoader, logExternalModulesCannotBeTransformedToModules, logInternalIdCannotBeExternal, isRelative, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logExternalSyntheticExports, logUnresolvedEntry, logUnresolvedImplicitDependant, logExternalModulesCannotBeIncludedInManualChunks, logEntryCannotBeExternal, logImplicitDependantCannotBeExternal, logNoAssetSourceSet, logFileReferenceIdNotFoundForFilename, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logInvalidRollupPhaseForChunkEmission, logFileNameConflict, logAssetNotFinalisedForFileName, logChunkNotGeneratedForFileName, logInvalidLogPosition, logInputHookInOutputPlugin, logInvalidFunctionPluginHook, logInvalidAddonPluginHook, logImplicitDependantIsNotIncluded, logCircularDependency, augmentLogMessage, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, logInvalidExportOptionValue, warnDeprecation, URL_OUTPUT_INTEROP, isValidUrl, addTrailingSlashIfMissed, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_PRESERVEENTRYSIGNATURES, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, logAlreadyClosed, logMissingFileOrDirOption, logCannotEmitFromOptionsHook, URL_WATCH } from './parseAst.js';
11
11
  import { relative, dirname, basename, extname, resolve as resolve$1 } from 'node:path';
12
12
  import require$$0, { win32, posix, isAbsolute, resolve } from 'path';
13
13
  import { parseAsync, xxhashBase64Url, xxhashBase36, xxhashBase16 } from '../../native.js';
@@ -16,7 +16,7 @@ import { performance } from 'node:perf_hooks';
16
16
  import { lstat, realpath, readdir, readFile, mkdir, writeFile } from 'node:fs/promises';
17
17
  import * as tty from 'tty';
18
18
 
19
- var version = "4.21.3";
19
+ var version = "4.22.0";
20
20
 
21
21
  const comma = ','.charCodeAt(0);
22
22
  const semicolon = ';'.charCodeAt(0);
@@ -4459,36 +4459,6 @@ const builtins = 'arguments Infinity NaN undefined null true false eval uneval i
4459
4459
  const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' '));
4460
4460
  forbiddenIdentifiers.add('');
4461
4461
 
4462
- function createInclusionContext() {
4463
- return {
4464
- brokenFlow: false,
4465
- hasBreak: false,
4466
- hasContinue: false,
4467
- includedCallArguments: new Set(),
4468
- includedLabels: new Set()
4469
- };
4470
- }
4471
- function createHasEffectsContext() {
4472
- return {
4473
- accessed: new PathTracker(),
4474
- assigned: new PathTracker(),
4475
- brokenFlow: false,
4476
- called: new DiscriminatedPathTracker(),
4477
- hasBreak: false,
4478
- hasContinue: false,
4479
- ignore: {
4480
- breaks: false,
4481
- continues: false,
4482
- labels: new Set(),
4483
- returnYield: false,
4484
- this: false
4485
- },
4486
- includedLabels: new Set(),
4487
- instantiated: new DiscriminatedPathTracker(),
4488
- replacedVariableInits: new Map()
4489
- };
4490
- }
4491
-
4492
4462
  function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) {
4493
4463
  return Object.create(inheritedDescriptions, memberDescriptions);
4494
4464
  }
@@ -4770,6 +4740,36 @@ const childNodeKeys = {
4770
4740
  YieldExpression: ['argument']
4771
4741
  };
4772
4742
 
4743
+ function createInclusionContext() {
4744
+ return {
4745
+ brokenFlow: false,
4746
+ hasBreak: false,
4747
+ hasContinue: false,
4748
+ includedCallArguments: new Set(),
4749
+ includedLabels: new Set()
4750
+ };
4751
+ }
4752
+ function createHasEffectsContext() {
4753
+ return {
4754
+ accessed: new PathTracker(),
4755
+ assigned: new PathTracker(),
4756
+ brokenFlow: false,
4757
+ called: new DiscriminatedPathTracker(),
4758
+ hasBreak: false,
4759
+ hasContinue: false,
4760
+ ignore: {
4761
+ breaks: false,
4762
+ continues: false,
4763
+ labels: new Set(),
4764
+ returnYield: false,
4765
+ this: false
4766
+ },
4767
+ includedLabels: new Set(),
4768
+ instantiated: new DiscriminatedPathTracker(),
4769
+ replacedVariableInits: new Map()
4770
+ };
4771
+ }
4772
+
4773
4773
  const INCLUDE_PARAMETERS = 'variables';
4774
4774
  const IS_SKIPPED_CHAIN = Symbol('IS_SKIPPED_CHAIN');
4775
4775
  class NodeBase extends ExpressionEntity {
@@ -5887,6 +5887,7 @@ const knownGlobals = {
5887
5887
  isView: PF,
5888
5888
  prototype: O
5889
5889
  },
5890
+ AggregateError: PC_WITH_ARRAY,
5890
5891
  Atomics: O,
5891
5892
  BigInt: C,
5892
5893
  BigInt64Array: C,
@@ -5910,6 +5911,7 @@ const knownGlobals = {
5910
5911
  escape: PF,
5911
5912
  eval: O,
5912
5913
  EvalError: PC,
5914
+ FinalizationRegistry: C,
5913
5915
  Float32Array: ARRAY_TYPE,
5914
5916
  Float64Array: ARRAY_TYPE,
5915
5917
  Function: C,
@@ -6060,6 +6062,7 @@ const knownGlobals = {
6060
6062
  URIError: PC,
6061
6063
  valueOf: O,
6062
6064
  WeakMap: PC_WITH_ARRAY,
6065
+ WeakRef: C,
6063
6066
  WeakSet: PC_WITH_ARRAY,
6064
6067
  // Additional globals shared by Node and Browser that are not strictly part of the language
6065
6068
  clearInterval: C,
@@ -7047,9 +7050,10 @@ class Identifier extends NodeBase {
7047
7050
  if (!(this.variable instanceof LocalVariable &&
7048
7051
  this.variable.kind &&
7049
7052
  tdzVariableKinds.has(this.variable.kind) &&
7050
- // we ignore possible TDZs due to circular module dependencies as
7051
- // otherwise we get many false positives
7052
- this.variable.module === this.scope.context.module)) {
7053
+ // We ignore modules that did not receive a treeshaking pass yet as that
7054
+ // causes many false positives due to circular dependencies or disabled
7055
+ // moduleSideEffects.
7056
+ this.variable.module.hasTreeShakingPassStarted)) {
7053
7057
  return (this.isTDZAccess = false);
7054
7058
  }
7055
7059
  let decl_id;
@@ -7062,9 +7066,7 @@ class Identifier extends NodeBase {
7062
7066
  // in the same function or at top level of module
7063
7067
  return (this.isTDZAccess = true);
7064
7068
  }
7065
- // We ignore the case where the module is not yet executed because
7066
- // moduleSideEffects are false.
7067
- if (!this.variable.initReached && this.scope.context.module.isExecuted) {
7069
+ if (!this.variable.initReached) {
7068
7070
  // Either a const/let TDZ violation or
7069
7071
  // var use before declaration was encountered.
7070
7072
  return (this.isTDZAccess = true);
@@ -7100,6 +7102,10 @@ class Identifier extends NodeBase {
7100
7102
  applyDeoptimizations() {
7101
7103
  this.deoptimized = true;
7102
7104
  if (this.variable instanceof LocalVariable) {
7105
+ // When accessing a variable from a module without side effects, this
7106
+ // means we use an export of that module and therefore need to potentially
7107
+ // include it in the bundle.
7108
+ this.variable.module.isExecuted = true;
7103
7109
  this.variable.consolidateInitializers();
7104
7110
  this.scope.context.requestTreeshakingPass();
7105
7111
  }
@@ -13833,6 +13839,7 @@ class Module {
13833
13839
  this.dynamicImporters = [];
13834
13840
  this.dynamicImports = [];
13835
13841
  this.execIndex = Infinity;
13842
+ this.hasTreeShakingPassStarted = false;
13836
13843
  this.implicitlyLoadedAfter = new Set();
13837
13844
  this.implicitlyLoadedBefore = new Set();
13838
13845
  this.importDescriptions = new Map();
@@ -18044,8 +18051,8 @@ async function renderChunks(chunks, bundle, pluginDriver, outputOptions, log) {
18044
18051
  timeStart('transform chunks', 2);
18045
18052
  const getHash = hasherByType[outputOptions.hashCharacters];
18046
18053
  const chunkGraph = getChunkGraph(chunks);
18047
- const { initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log);
18048
- const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle, getHash);
18054
+ const { hashDependenciesByPlaceholder, initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, placeholders, renderedChunksByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log);
18055
+ const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, placeholders, bundle, getHash);
18049
18056
  addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, outputOptions);
18050
18057
  timeEnd('transform chunks', 2);
18051
18058
  }
@@ -18175,12 +18182,14 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
18175
18182
  hashDependenciesByPlaceholder,
18176
18183
  initialHashesByPlaceholder,
18177
18184
  nonHashedChunksWithPlaceholders,
18185
+ placeholders,
18178
18186
  renderedChunksByPlaceholder
18179
18187
  };
18180
18188
  }
18181
- function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle, getHash) {
18189
+ function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, placeholders, bundle, getHash) {
18182
18190
  const hashesByPlaceholder = new Map(initialHashesByPlaceholder);
18183
- for (const [placeholder, { fileName }] of renderedChunksByPlaceholder) {
18191
+ for (const placeholder of placeholders) {
18192
+ const { fileName } = renderedChunksByPlaceholder.get(placeholder);
18184
18193
  let contentToHash = '';
18185
18194
  const hashDependencyPlaceholders = new Set([placeholder]);
18186
18195
  for (const dependencyPlaceholder of hashDependencyPlaceholders) {
@@ -20162,6 +20171,7 @@ class Graph {
20162
20171
  this.needsTreeshakingPass = false;
20163
20172
  for (const module of this.modules) {
20164
20173
  if (module.isExecuted) {
20174
+ module.hasTreeShakingPassStarted = true;
20165
20175
  if (module.info.moduleSideEffects === 'no-treeshake') {
20166
20176
  module.includeAllInBundle();
20167
20177
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/parseAst.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
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 = "4.21.3";
34
+ var version = "4.22.0";
35
35
 
36
36
  function ensureArray$1(items) {
37
37
  if (Array.isArray(items)) {
@@ -5927,36 +5927,6 @@ const builtins = 'arguments Infinity NaN undefined null true false eval uneval i
5927
5927
  const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' '));
5928
5928
  forbiddenIdentifiers.add('');
5929
5929
 
5930
- function createInclusionContext() {
5931
- return {
5932
- brokenFlow: false,
5933
- hasBreak: false,
5934
- hasContinue: false,
5935
- includedCallArguments: new Set(),
5936
- includedLabels: new Set()
5937
- };
5938
- }
5939
- function createHasEffectsContext() {
5940
- return {
5941
- accessed: new PathTracker(),
5942
- assigned: new PathTracker(),
5943
- brokenFlow: false,
5944
- called: new DiscriminatedPathTracker(),
5945
- hasBreak: false,
5946
- hasContinue: false,
5947
- ignore: {
5948
- breaks: false,
5949
- continues: false,
5950
- labels: new Set(),
5951
- returnYield: false,
5952
- this: false
5953
- },
5954
- includedLabels: new Set(),
5955
- instantiated: new DiscriminatedPathTracker(),
5956
- replacedVariableInits: new Map()
5957
- };
5958
- }
5959
-
5960
5930
  function assembleMemberDescriptions(memberDescriptions, inheritedDescriptions = null) {
5961
5931
  return Object.create(inheritedDescriptions, memberDescriptions);
5962
5932
  }
@@ -6238,6 +6208,36 @@ const childNodeKeys = {
6238
6208
  YieldExpression: ['argument']
6239
6209
  };
6240
6210
 
6211
+ function createInclusionContext() {
6212
+ return {
6213
+ brokenFlow: false,
6214
+ hasBreak: false,
6215
+ hasContinue: false,
6216
+ includedCallArguments: new Set(),
6217
+ includedLabels: new Set()
6218
+ };
6219
+ }
6220
+ function createHasEffectsContext() {
6221
+ return {
6222
+ accessed: new PathTracker(),
6223
+ assigned: new PathTracker(),
6224
+ brokenFlow: false,
6225
+ called: new DiscriminatedPathTracker(),
6226
+ hasBreak: false,
6227
+ hasContinue: false,
6228
+ ignore: {
6229
+ breaks: false,
6230
+ continues: false,
6231
+ labels: new Set(),
6232
+ returnYield: false,
6233
+ this: false
6234
+ },
6235
+ includedLabels: new Set(),
6236
+ instantiated: new DiscriminatedPathTracker(),
6237
+ replacedVariableInits: new Map()
6238
+ };
6239
+ }
6240
+
6241
6241
  const INCLUDE_PARAMETERS = 'variables';
6242
6242
  const IS_SKIPPED_CHAIN = Symbol('IS_SKIPPED_CHAIN');
6243
6243
  class NodeBase extends ExpressionEntity {
@@ -7353,6 +7353,7 @@ const knownGlobals = {
7353
7353
  isView: PF,
7354
7354
  prototype: O
7355
7355
  },
7356
+ AggregateError: PC_WITH_ARRAY,
7356
7357
  Atomics: O,
7357
7358
  BigInt: C,
7358
7359
  BigInt64Array: C,
@@ -7376,6 +7377,7 @@ const knownGlobals = {
7376
7377
  escape: PF,
7377
7378
  eval: O,
7378
7379
  EvalError: PC,
7380
+ FinalizationRegistry: C,
7379
7381
  Float32Array: ARRAY_TYPE,
7380
7382
  Float64Array: ARRAY_TYPE,
7381
7383
  Function: C,
@@ -7526,6 +7528,7 @@ const knownGlobals = {
7526
7528
  URIError: PC,
7527
7529
  valueOf: O,
7528
7530
  WeakMap: PC_WITH_ARRAY,
7531
+ WeakRef: C,
7529
7532
  WeakSet: PC_WITH_ARRAY,
7530
7533
  // Additional globals shared by Node and Browser that are not strictly part of the language
7531
7534
  clearInterval: C,
@@ -8513,9 +8516,10 @@ class Identifier extends NodeBase {
8513
8516
  if (!(this.variable instanceof LocalVariable &&
8514
8517
  this.variable.kind &&
8515
8518
  tdzVariableKinds.has(this.variable.kind) &&
8516
- // we ignore possible TDZs due to circular module dependencies as
8517
- // otherwise we get many false positives
8518
- this.variable.module === this.scope.context.module)) {
8519
+ // We ignore modules that did not receive a treeshaking pass yet as that
8520
+ // causes many false positives due to circular dependencies or disabled
8521
+ // moduleSideEffects.
8522
+ this.variable.module.hasTreeShakingPassStarted)) {
8519
8523
  return (this.isTDZAccess = false);
8520
8524
  }
8521
8525
  let decl_id;
@@ -8528,9 +8532,7 @@ class Identifier extends NodeBase {
8528
8532
  // in the same function or at top level of module
8529
8533
  return (this.isTDZAccess = true);
8530
8534
  }
8531
- // We ignore the case where the module is not yet executed because
8532
- // moduleSideEffects are false.
8533
- if (!this.variable.initReached && this.scope.context.module.isExecuted) {
8535
+ if (!this.variable.initReached) {
8534
8536
  // Either a const/let TDZ violation or
8535
8537
  // var use before declaration was encountered.
8536
8538
  return (this.isTDZAccess = true);
@@ -8566,6 +8568,10 @@ class Identifier extends NodeBase {
8566
8568
  applyDeoptimizations() {
8567
8569
  this.deoptimized = true;
8568
8570
  if (this.variable instanceof LocalVariable) {
8571
+ // When accessing a variable from a module without side effects, this
8572
+ // means we use an export of that module and therefore need to potentially
8573
+ // include it in the bundle.
8574
+ this.variable.module.isExecuted = true;
8569
8575
  this.variable.consolidateInitializers();
8570
8576
  this.scope.context.requestTreeshakingPass();
8571
8577
  }
@@ -15280,6 +15286,7 @@ class Module {
15280
15286
  this.dynamicImporters = [];
15281
15287
  this.dynamicImports = [];
15282
15288
  this.execIndex = Infinity;
15289
+ this.hasTreeShakingPassStarted = false;
15283
15290
  this.implicitlyLoadedAfter = new Set();
15284
15291
  this.implicitlyLoadedBefore = new Set();
15285
15292
  this.importDescriptions = new Map();
@@ -19362,8 +19369,8 @@ async function renderChunks(chunks, bundle, pluginDriver, outputOptions, log) {
19362
19369
  timeStart('transform chunks', 2);
19363
19370
  const getHash = hasherByType[outputOptions.hashCharacters];
19364
19371
  const chunkGraph = getChunkGraph(chunks);
19365
- const { initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, renderedChunksByPlaceholder, hashDependenciesByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log);
19366
- const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle, getHash);
19372
+ const { hashDependenciesByPlaceholder, initialHashesByPlaceholder, nonHashedChunksWithPlaceholders, placeholders, renderedChunksByPlaceholder } = await transformChunksAndGenerateContentHashes(renderedChunks, chunkGraph, outputOptions, pluginDriver, getHash, log);
19373
+ const hashesByPlaceholder = generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, placeholders, bundle, getHash);
19367
19374
  addChunksToBundle(renderedChunksByPlaceholder, hashesByPlaceholder, bundle, nonHashedChunksWithPlaceholders, pluginDriver, outputOptions);
19368
19375
  timeEnd('transform chunks', 2);
19369
19376
  }
@@ -19493,12 +19500,14 @@ async function transformChunksAndGenerateContentHashes(renderedChunks, chunkGrap
19493
19500
  hashDependenciesByPlaceholder,
19494
19501
  initialHashesByPlaceholder,
19495
19502
  nonHashedChunksWithPlaceholders,
19503
+ placeholders,
19496
19504
  renderedChunksByPlaceholder
19497
19505
  };
19498
19506
  }
19499
- function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, bundle, getHash) {
19507
+ function generateFinalHashes(renderedChunksByPlaceholder, hashDependenciesByPlaceholder, initialHashesByPlaceholder, placeholders, bundle, getHash) {
19500
19508
  const hashesByPlaceholder = new Map(initialHashesByPlaceholder);
19501
- for (const [placeholder, { fileName }] of renderedChunksByPlaceholder) {
19509
+ for (const placeholder of placeholders) {
19510
+ const { fileName } = renderedChunksByPlaceholder.get(placeholder);
19502
19511
  let contentToHash = '';
19503
19512
  const hashDependencyPlaceholders = new Set([placeholder]);
19504
19513
  for (const dependencyPlaceholder of hashDependencyPlaceholders) {
@@ -20602,6 +20611,7 @@ class Graph {
20602
20611
  this.needsTreeshakingPass = false;
20603
20612
  for (const module of this.modules) {
20604
20613
  if (module.isExecuted) {
20614
+ module.hasTreeShakingPassStarted = true;
20605
20615
  if (module.info.moduleSideEffects === 'no-treeshake') {
20606
20616
  module.includeAllInBundle();
20607
20617
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.21.3
4
- Thu, 12 Sep 2024 07:05:19 GMT - commit 9f5a735524a5c56ba61a8dc6989374917f5aceb1
3
+ Rollup.js v4.22.0
4
+ Thu, 19 Sep 2024 04:55:02 GMT - commit 5e7a3631a28a863ddb97a64189c3b76eec9983ca
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": "4.21.3",
3
+ "version": "4.22.0",
4
4
  "description": "Next-generation ES module bundler",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -107,28 +107,27 @@
107
107
  "homepage": "https://rollupjs.org/",
108
108
  "optionalDependencies": {
109
109
  "fsevents": "~2.3.2",
110
- "@rollup/rollup-darwin-arm64": "4.21.3",
111
- "@rollup/rollup-android-arm64": "4.21.3",
112
- "@rollup/rollup-win32-arm64-msvc": "4.21.3",
113
- "@rollup/rollup-linux-arm64-gnu": "4.21.3",
114
- "@rollup/rollup-linux-arm64-musl": "4.21.3",
115
- "@rollup/rollup-android-arm-eabi": "4.21.3",
116
- "@rollup/rollup-linux-arm-gnueabihf": "4.21.3",
117
- "@rollup/rollup-linux-arm-musleabihf": "4.21.3",
118
- "@rollup/rollup-win32-ia32-msvc": "4.21.3",
119
- "@rollup/rollup-linux-riscv64-gnu": "4.21.3",
120
- "@rollup/rollup-linux-powerpc64le-gnu": "4.21.3",
121
- "@rollup/rollup-linux-s390x-gnu": "4.21.3",
122
- "@rollup/rollup-darwin-x64": "4.21.3",
123
- "@rollup/rollup-win32-x64-msvc": "4.21.3",
124
- "@rollup/rollup-linux-x64-gnu": "4.21.3",
125
- "@rollup/rollup-linux-x64-musl": "4.21.3"
110
+ "@rollup/rollup-darwin-arm64": "4.22.0",
111
+ "@rollup/rollup-android-arm64": "4.22.0",
112
+ "@rollup/rollup-win32-arm64-msvc": "4.22.0",
113
+ "@rollup/rollup-linux-arm64-gnu": "4.22.0",
114
+ "@rollup/rollup-linux-arm64-musl": "4.22.0",
115
+ "@rollup/rollup-android-arm-eabi": "4.22.0",
116
+ "@rollup/rollup-linux-arm-gnueabihf": "4.22.0",
117
+ "@rollup/rollup-linux-arm-musleabihf": "4.22.0",
118
+ "@rollup/rollup-win32-ia32-msvc": "4.22.0",
119
+ "@rollup/rollup-linux-riscv64-gnu": "4.22.0",
120
+ "@rollup/rollup-linux-powerpc64le-gnu": "4.22.0",
121
+ "@rollup/rollup-linux-s390x-gnu": "4.22.0",
122
+ "@rollup/rollup-darwin-x64": "4.22.0",
123
+ "@rollup/rollup-win32-x64-msvc": "4.22.0",
124
+ "@rollup/rollup-linux-x64-gnu": "4.22.0",
125
+ "@rollup/rollup-linux-x64-musl": "4.22.0"
126
126
  },
127
127
  "dependencies": {
128
128
  "@types/estree": "1.0.5"
129
129
  },
130
130
  "devDependenciesComments": {
131
- "@types/node": "Version 18.19.0 breaks chokidar and vite types",
132
131
  "core-js": "We only update manually as every update requires a snapshot update"
133
132
  },
134
133
  "devDependencies": {
@@ -138,9 +137,9 @@
138
137
  "@codemirror/search": "^6.5.6",
139
138
  "@codemirror/state": "^6.4.1",
140
139
  "@codemirror/view": "^6.33.0",
141
- "@eslint/js": "^9.9.1",
140
+ "@eslint/js": "^9.10.0",
142
141
  "@jridgewell/sourcemap-codec": "^1.5.0",
143
- "@mermaid-js/mermaid-cli": "^10.9.1",
142
+ "@mermaid-js/mermaid-cli": "^11.1.1",
144
143
  "@napi-rs/cli": "^2.18.4",
145
144
  "@rollup/plugin-alias": "^5.1.0",
146
145
  "@rollup/plugin-buble": "^1.0.3",
@@ -151,11 +150,11 @@
151
150
  "@rollup/plugin-terser": "^0.4.4",
152
151
  "@rollup/plugin-typescript": "^11.1.6",
153
152
  "@rollup/pluginutils": "^5.1.0",
154
- "@shikijs/vitepress-twoslash": "^1.16.1",
153
+ "@shikijs/vitepress-twoslash": "^1.16.3",
155
154
  "@types/eslint": "^9.6.1",
156
155
  "@types/inquirer": "^9.0.7",
157
156
  "@types/mocha": "^10.0.7",
158
- "@types/node": "~18.18.14",
157
+ "@types/node": "^18.19.50",
159
158
  "@types/semver": "^7.5.8",
160
159
  "@types/yargs-parser": "^21.0.3",
161
160
  "acorn": "^8.12.1",
@@ -164,24 +163,24 @@
164
163
  "builtin-modules": "^4.0.0",
165
164
  "chokidar": "^3.6.0",
166
165
  "colorette": "^2.0.20",
167
- "concurrently": "^8.2.2",
168
- "core-js": "3.36.0",
166
+ "concurrently": "^9.0.0",
167
+ "core-js": "3.38.1",
169
168
  "cross-env": "^7.0.3",
170
169
  "date-time": "^4.0.0",
171
170
  "es5-shim": "^4.6.7",
172
171
  "es6-shim": "^0.35.8",
173
- "eslint": "^9.9.1",
172
+ "eslint": "^9.10.0",
174
173
  "eslint-config-prettier": "^9.1.0",
175
174
  "eslint-plugin-prettier": "^5.2.1",
176
175
  "eslint-plugin-unicorn": "^55.0.0",
177
- "eslint-plugin-vue": "^9.27.0",
176
+ "eslint-plugin-vue": "^9.28.0",
178
177
  "fixturify": "^3.0.0",
179
178
  "flru": "^1.0.2",
180
179
  "fs-extra": "^11.2.0",
181
180
  "github-api": "^3.4.0",
182
181
  "globals": "^15.9.0",
183
182
  "husky": "^9.1.5",
184
- "inquirer": "^10.2.0",
183
+ "inquirer": "^10.2.2",
185
184
  "is-reference": "^3.0.2",
186
185
  "lint-staged": "^15.2.10",
187
186
  "locate-character": "^3.0.0",
@@ -205,13 +204,14 @@
205
204
  "source-map": "^0.7.4",
206
205
  "source-map-support": "^0.5.21",
207
206
  "systemjs": "^6.15.1",
208
- "terser": "^5.31.6",
207
+ "terser": "^5.32.0",
209
208
  "tslib": "^2.7.0",
210
- "typescript": "^5.5.4",
211
- "typescript-eslint": "^8.4.0",
212
- "vite": "^5.4.2",
209
+ "typescript": "^5.6.2",
210
+ "typescript-eslint": "^8.5.0",
211
+ "vite": "^5.4.3",
213
212
  "vitepress": "^1.3.4",
214
- "vue": "^3.4.38",
213
+ "vue": "^3.5.3",
214
+ "vue-tsc": "^2.1.6",
215
215
  "wasm-pack": "^0.13.0",
216
216
  "yargs-parser": "^21.1.1"
217
217
  },
@@ -220,7 +220,8 @@
220
220
  "semver": "^7.6.3",
221
221
  "ws": "^8.18.0"
222
222
  },
223
- "overrides_comments": {
223
+ "comments": {
224
+ "vue-tsc": "This is necessary so that prettier-plugin-organize-imports works correctly in Vue templatges",
224
225
  "ws": "mermaid requires an older 8.13.0 version via puppeteer with vulnerabilities"
225
226
  },
226
227
  "files": [