New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v3.0 Release branch] #4549
[v3.0 Release branch] #4549
Conversation
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via npm install rollup/rollup#release-3.0.0 or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## master #4549 +/- ##
==========================================
+ Coverage 98.87% 99.06% +0.18%
==========================================
Files 211 214 +3
Lines 7384 7554 +170
Branches 2107 2096 -11
==========================================
+ Hits 7301 7483 +182
+ Misses 27 23 -4
+ Partials 56 48 -8
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
ca1bd42
to
490b49b
Compare
Feedback about specific changes should go to the pull requests listed above. |
48ce34d
to
11ee71f
Compare
b54ae56
to
7bdd7c5
Compare
Just released a new beta. This changes some defaults and finally makes changing file names in preserveModules a lot saner. |
13b0ef8
to
46910f4
Compare
32dfb1e
to
4c3b1a4
Compare
c322542
to
28e8a5d
Compare
71c12c3
to
3926096
Compare
With the latest pre-release 3.0.0-5, Rollup 3 is now feature complete. In the next week(s), we will start taking a look at the plugin eco system. cc @patak-dev @antfu |
1020537
to
a59e5e1
Compare
6ce8096
to
2477228
Compare
* [v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543) * Initial new hashing idea * Simplify external import path generation 197 broken tests left * Use correct file names in chunk info 197 broken tests left * Implement first draft for hashing algorithm 189 broken tests left * Remove active deprecations this.emitAsset this.emitChunk this.getAssetFileName this.getChunkFileName import.meta.ROLLUP_ASSET_URL_ import.meta.ROLLUP_CHUNK_URL_ * Reduce render parameters * Always scan all chunks for hashes * Fix asset emission and remaining tests * Reintroduce augmentChunkHash and get OutputChunk by converting RenderedChunk * Provide chunk graph in renderChunk * Handle hash collisions * Remove deprecated hacky asset emission * Allow to configure hash sizes per file * Update documentation * Extend tests * Minor improvements * Improve documentation about hashing * Replace hash in sourcemap file * Provide ChunkInfo in banner/footer/intro/outro * Extract hashing logic * Clean up hashing logic * Add ExternalChunk wrapper * Store inputBase on Chunk * Store snippets on Chunk * Align chunk interfaces * Reduce this. property access * Move dynamicImportFunction warning to options normalization * Restructure rendering logic * Do not run on Node 10 * Update documentation * Try to fix Windows tests * Improve coverage * Remove graph background colors 3.0.0-0 * [v3.0] Change default for output.generatedCode.reservedNamesAsProps (#4568) * [v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543) * Initial new hashing idea * Simplify external import path generation 197 broken tests left * Use correct file names in chunk info 197 broken tests left * Implement first draft for hashing algorithm 189 broken tests left * Remove active deprecations this.emitAsset this.emitChunk this.getAssetFileName this.getChunkFileName import.meta.ROLLUP_ASSET_URL_ import.meta.ROLLUP_CHUNK_URL_ * Reduce render parameters * Always scan all chunks for hashes * Fix asset emission and remaining tests * Reintroduce augmentChunkHash and get OutputChunk by converting RenderedChunk * Provide chunk graph in renderChunk * Handle hash collisions * Remove deprecated hacky asset emission * Allow to configure hash sizes per file * Update documentation * Extend tests * Minor improvements * Improve documentation about hashing * Replace hash in sourcemap file * Provide ChunkInfo in banner/footer/intro/outro * Extract hashing logic * Clean up hashing logic * Add ExternalChunk wrapper * Store inputBase on Chunk * Store snippets on Chunk * Align chunk interfaces * Reduce this. property access * Move dynamicImportFunction warning to options normalization * Restructure rendering logic * Do not run on Node 10 * Update documentation * Try to fix Windows tests * Improve coverage * Remove graph background colors 3.0.0-0 * Rework warnings and errors * Refine some error messages * Reduce number of different props of errors * All errors are declared in error.ts * Use name RollupError for errors that do not have a cause * Extend documentation
* [v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543) * Initial new hashing idea * Simplify external import path generation 197 broken tests left * Use correct file names in chunk info 197 broken tests left * Implement first draft for hashing algorithm 189 broken tests left * Remove active deprecations this.emitAsset this.emitChunk this.getAssetFileName this.getChunkFileName import.meta.ROLLUP_ASSET_URL_ import.meta.ROLLUP_CHUNK_URL_ * Reduce render parameters * Always scan all chunks for hashes * Fix asset emission and remaining tests * Reintroduce augmentChunkHash and get OutputChunk by converting RenderedChunk * Provide chunk graph in renderChunk * Handle hash collisions * Remove deprecated hacky asset emission * Allow to configure hash sizes per file * Update documentation * Extend tests * Minor improvements * Improve documentation about hashing * Replace hash in sourcemap file * Provide ChunkInfo in banner/footer/intro/outro * Extract hashing logic * Clean up hashing logic * Add ExternalChunk wrapper * Store inputBase on Chunk * Store snippets on Chunk * Align chunk interfaces * Reduce this. property access * Move dynamicImportFunction warning to options normalization * Restructure rendering logic * Do not run on Node 10 * Update documentation * Try to fix Windows tests * Improve coverage * Remove graph background colors 3.0.0-0 * Set up browser build * Generate commithash inline * Remove execa * Chmod executable from rollup config * Adjust pkg.files * Copy types into build * Work on release script * Continue work on release script * Continue work on release script * Finish release script * Push correct REPL artefacts * Add comments to released PRs and issues * fixup! [v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543) * Add Rollup-in-browser example
* [v3.0] Use named export for loadConfigFile * Only expose files in dist with their full names * Move browser sources to src subfolder 3.0.0-3 Fix release script
* [v3.0] Deprecate Node 12 (#4548) * [v3.0] Remove actively deprecated features, show warnings for other deprecated features (#4552) * Remove all active deprecations * Make all inactive deprecations active * Try to make test more stable * Update CLI help screen * [v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543) * Initial new hashing idea * Simplify external import path generation 197 broken tests left * Use correct file names in chunk info 197 broken tests left * Implement first draft for hashing algorithm 189 broken tests left * Remove active deprecations this.emitAsset this.emitChunk this.getAssetFileName this.getChunkFileName import.meta.ROLLUP_ASSET_URL_ import.meta.ROLLUP_CHUNK_URL_ * Reduce render parameters * Always scan all chunks for hashes * Fix asset emission and remaining tests * Reintroduce augmentChunkHash and get OutputChunk by converting RenderedChunk * Provide chunk graph in renderChunk * Handle hash collisions * Remove deprecated hacky asset emission * Allow to configure hash sizes per file * Update documentation * Extend tests * Minor improvements * Improve documentation about hashing * Replace hash in sourcemap file * Provide ChunkInfo in banner/footer/intro/outro * Extract hashing logic * Clean up hashing logic * Add ExternalChunk wrapper * Store inputBase on Chunk * Store snippets on Chunk * Align chunk interfaces * Reduce this. property access * Move dynamicImportFunction warning to options normalization * Restructure rendering logic * Do not run on Node 10 * Update documentation * Try to fix Windows tests * Improve coverage * Remove graph background colors 3.0.0-0 * [v3.0] Run output plugins last (#3846) * fix: run output plugins last * Add test Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com> * [v3.0] Convert build scripts to ESM, update dependencies (#4558) * Convert scripts to ESM, update dependencies * Fix lint issue 3.0.0-1 * [v3.0] Better esm config file support (#4574) * More precise native ESM support check * Use import to load .js config file if package type is module * Update and add tests handling type module * Remove Node version check and simplify logic * Update documentation * Document how to replace __dirname and import JSON Co-authored-by: Linus Miller <linus.miller@bitmill.io> * [v3.0] Rework file name patterns when preserving modules (#4565) * Put preserveModules path into Chunk name * Use regular entryFileNames logic * Clarify documentation for `preserveModules` * Improve coverage * Improve wording in docs * [v3.0] Show deprecation warning for maxParallelFileReads (#4575) * [v3.0] Restructure timings (#4566) * [v3.0] Change default for makeAbsoluteExternalsRelative (#4567) * [v3.0] Change default for output.generatedCode.reservedNamesAsProps (#4568) * [v3.0] Change default for preserveEntrySignatures to exports-only (#4576) * Port doc changes from #4572 and #4583 to 3.0 (#4592) * [v3.0] Refine errors and warnings (#4579) * [v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543) * Initial new hashing idea * Simplify external import path generation 197 broken tests left * Use correct file names in chunk info 197 broken tests left * Implement first draft for hashing algorithm 189 broken tests left * Remove active deprecations this.emitAsset this.emitChunk this.getAssetFileName this.getChunkFileName import.meta.ROLLUP_ASSET_URL_ import.meta.ROLLUP_CHUNK_URL_ * Reduce render parameters * Always scan all chunks for hashes * Fix asset emission and remaining tests * Reintroduce augmentChunkHash and get OutputChunk by converting RenderedChunk * Provide chunk graph in renderChunk * Handle hash collisions * Remove deprecated hacky asset emission * Allow to configure hash sizes per file * Update documentation * Extend tests * Minor improvements * Improve documentation about hashing * Replace hash in sourcemap file * Provide ChunkInfo in banner/footer/intro/outro * Extract hashing logic * Clean up hashing logic * Add ExternalChunk wrapper * Store inputBase on Chunk * Store snippets on Chunk * Align chunk interfaces * Reduce this. property access * Move dynamicImportFunction warning to options normalization * Restructure rendering logic * Do not run on Node 10 * Update documentation * Try to fix Windows tests * Improve coverage * Remove graph background colors 3.0.0-0 * [v3.0] Change default for output.generatedCode.reservedNamesAsProps (#4568) * [v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543) * Initial new hashing idea * Simplify external import path generation 197 broken tests left * Use correct file names in chunk info 197 broken tests left * Implement first draft for hashing algorithm 189 broken tests left * Remove active deprecations this.emitAsset this.emitChunk this.getAssetFileName this.getChunkFileName import.meta.ROLLUP_ASSET_URL_ import.meta.ROLLUP_CHUNK_URL_ * Reduce render parameters * Always scan all chunks for hashes * Fix asset emission and remaining tests * Reintroduce augmentChunkHash and get OutputChunk by converting RenderedChunk * Provide chunk graph in renderChunk * Handle hash collisions * Remove deprecated hacky asset emission * Allow to configure hash sizes per file * Update documentation * Extend tests * Minor improvements * Improve documentation about hashing * Replace hash in sourcemap file * Provide ChunkInfo in banner/footer/intro/outro * Extract hashing logic * Clean up hashing logic * Add ExternalChunk wrapper * Store inputBase on Chunk * Store snippets on Chunk * Align chunk interfaces * Reduce this. property access * Move dynamicImportFunction warning to options normalization * Restructure rendering logic * Do not run on Node 10 * Update documentation * Try to fix Windows tests * Improve coverage * Remove graph background colors 3.0.0-0 * Rework warnings and errors * Refine some error messages * Reduce number of different props of errors * All errors are declared in error.ts * Use name RollupError for errors that do not have a cause * Extend documentation * [v3.0] Browser build (#4593) * [v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543) * Initial new hashing idea * Simplify external import path generation 197 broken tests left * Use correct file names in chunk info 197 broken tests left * Implement first draft for hashing algorithm 189 broken tests left * Remove active deprecations this.emitAsset this.emitChunk this.getAssetFileName this.getChunkFileName import.meta.ROLLUP_ASSET_URL_ import.meta.ROLLUP_CHUNK_URL_ * Reduce render parameters * Always scan all chunks for hashes * Fix asset emission and remaining tests * Reintroduce augmentChunkHash and get OutputChunk by converting RenderedChunk * Provide chunk graph in renderChunk * Handle hash collisions * Remove deprecated hacky asset emission * Allow to configure hash sizes per file * Update documentation * Extend tests * Minor improvements * Improve documentation about hashing * Replace hash in sourcemap file * Provide ChunkInfo in banner/footer/intro/outro * Extract hashing logic * Clean up hashing logic * Add ExternalChunk wrapper * Store inputBase on Chunk * Store snippets on Chunk * Align chunk interfaces * Reduce this. property access * Move dynamicImportFunction warning to options normalization * Restructure rendering logic * Do not run on Node 10 * Update documentation * Try to fix Windows tests * Improve coverage * Remove graph background colors 3.0.0-0 * Set up browser build * Generate commithash inline * Remove execa * Chmod executable from rollup config * Adjust pkg.files * Copy types into build * Work on release script * Continue work on release script * Continue work on release script * Finish release script * Push correct REPL artefacts * Add comments to released PRs and issues * fixup! [v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543) * Add Rollup-in-browser example * [v3.0] Use named export for loadConfigFile (#4581) * [v3.0] Use named export for loadConfigFile * Only expose files in dist with their full names * Move browser sources to src subfolder * 3.0.0-3 * Fix release script * [v3.0] Use "node:" prefix for imports of node builtins (#4596) * Support inline sourcemaps * Emit sourcemaps as assets and add comments before generateBundle Co-authored-by: Alec Larson <1925840+aleclarson@users.noreply.github.com> Co-authored-by: Linus Miller <linus.miller@bitmill.io> Co-authored-by: Bertrand Guay-Paquet <berniegp@gmail.com> 3.0.0-4
* Use a custom watch emitter implementation * Add documentation * Improve coverage
* Dummy commit * Change default for output.interop to "default", deprecate boolean and add "compat" * Add esModule: 'if-default-prop' and make it the default value * Statically resolve Symbol.toStringTag
* Support ES modules in bundles config files * Always try to load config files directly if possible * Fix build * Fix test * Debug test
3.0.0-5 Improve issue comment RegExp
* Use ASCII characters for hash placeholders * Back to 8 character hashes with base-64 encoding 3.0.0-6 Improve issue comment RegExp
a59e5e1
to
52d9ca2
Compare
BREAKING CHANGES: Typed array sources will no longer be deduplicated 3.0.0-7
* Support dynamic imports in cjs output and make default * Add documentation * Also use import for unresolvable dynamic imports * Extend CLI docs
* Add acorn support for import assertions and extend AST * Ignore pre-existing assertions on input files * Naive support for JSON assertions in output * Inject arbitrary import assertions * Allows to disable import assertions altogether via `false` * Support shorthand syntax for type assertions * Keep assertions on fully dynamic imports * Add documentation * Add assertions to types * Keep original assertions * Make option a boolean * Some extractions * Allow plugins to add and change assertions * Allow to pass assertions in this.resolve * Warn for inconsistent import assertions * Add new documentation * Improve coverage
0ae9bb5
to
3accf61
Compare
3accf61
to
d9237e8
Compare
Update packages before building Rollup for correct bundled version
dd3f2d6
to
f4faf31
Compare
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
preserveModules
option generatenode_modules
folder #3684assert { type: 'json' }
results in "Error: Unexpected token" #4530TRANSPILED_ESM_CONFIG
provides insufficient information #4616Description
This is the collection of everything that is included so far in the 3.0 release branch. Snapshots of this branch will be released as pre-release versions under the
beta
tag, i.e. to try it out, install Rollup viaBreaking Changes
General Changes
@rollup/browser
([v3.0] Browser build #4593)node:
prefix for imports of builtin modules ([v3.0] Use node: prefix for builtin imports #4596)this.emitAsset()
: usethis.emitFile()
this.emitChunk()
: usethis.emitFile()
this.getAssetFileName()
: usethis.getFileName()
this.getChunkFileName()
: usethis.getFileName()
this.isExternal()
: usethis.resolve()
this.resolveId()
: usethis.resolve()
resolveAssetUrl
plugin hook has been removed: useresolveFileUrl
assetReferenceId
orchunkReferenceId
parameters toresolveFileUrl
treeshake.pureExternalModules
option has been removed: usetreeshake.moduleSideEffects: 'no-external'
true
orfalse
foroutput.interop
. As a replacement fortrue
, you can use "compat"isAsset
flag in the bundletype: "asset"
fieldinlineDynamicImports
as part of the input options: useoutput. inlineDynamicImports
manualChunks
as part of the input options: useoutput. manualChunks
maxParallelFileReads
: use `maxParallelFileOpsoutput.preferConst
: useoutput.generatedCode.constBindings
output.dynamicImportFunction
: use therenderDynamicImport
plugin hookoutput.namespaceToStringTag
: useoutput.generatedCode.symbols
preserveModules
as part of the input options: useoutput. preserveModules
this.moduleIds
in plugins: usethis.getModuleIds()
this.getModuleInfo(...).hasModuleSideEffects
in plugins: usethis.getModuleInfo(...).moduleSideEffects
--configPlugin
or the--bundleConfigAsCjs
options are used. The configuration is bundled to an ES module unless the--bundleConfigAsCjs
option is used. In all other cases, configuration is now loaded using Node's native mechanisms ([v3.0] Better esm config file support #4574 and [v3.0] Always try to load config files via Node if possible #4621)rollup/dist/*
can only be required using their file extension ([v3.0] Use named export for loadConfigFile #4581)loadConfigFile
helper now has a named export of the same name instead of a default export ([v3.0] Use named export for loadConfigFile #4581)string
([v3.0] Improve asset emission performance #4644)import(…)
in commonjs output unlessoutput.dynamicImportInCjs
is set to false ([v3.0] Keep dynamic imports in CommonJS output #4647)Changes to Rollup Options
output.banner/footer/intro/outro
are now called per-chunk, they should be careful to avoid performance-heavy operations ([v3.0] New hashing algorithm that "fixes (nearly) everything" #4543)entryFileNames/chunkFileNames
functions now longer have access to the rendered module information viamodules
, only to a list of includedmoduleIds
([v3.0] New hashing algorithm that "fixes (nearly) everything" #4543)[name]
placeholder (as well as thechunkInfo.name
property when using a function) now includes the relative path of the chunk as well as optionally the file extension if the extension is not one of.js
,.jsx
,.mjs
,.cjs
,.ts
,.tsx
,.mts
, or.cts
([v3.0] Rework file name patterns when preserving modules #4565)[ext]
,[extName]
and[assetExtName]
placeholders are no longer supported when preserving modules ([v3.0] Rework file name patterns when preserving modules #4565)perf
option no longer collects timings for the asynchronous part of plugin hooks as the readings were wildly inaccurate and very misleading, and timings are adapted to the new hashing algorithm ([v3.0] Restructure perf timings #4566)makeAbsoluteExternalsRelative
to "ifRelativeSource" so that absolute external imports will no longer become relative imports in the output, while relative external imports will still be renormalized ([v3.0] Change default for makeAbsoluteExternalsRelative #4567)output.generatedCode.reservedNamesAsProps
to no longer quote properties likedefault
by default ([v3.0] Change default for output.generatedCode.reservedNamesAsProps #4568)preserveEntrySignatures
to "exports-only" so that by default, empty facades for entry chunks are no longer created ([v3.0] Change default for preserveEntrySignatures to exports-only #4576)output.interop
to "default" to better align with NodeJS interop ([v3.0] Improve interop defaults #4611)output.esModule
to "if-default-prop", which only adds __esModule when the default export would be a property ([v3.0] Improve interop defaults #4611)output.systemNullSetters
totrue
, which requires at least SystemJS 6.3.3 ([v3.0] Change default for systemNullSetters #4649)Plugin API Changes
renderChunk
should make sure to updateChunkInfo.imports/importedBindings/exports
accordingly ([v3.0] New hashing algorithm that "fixes (nearly) everything" #4543)renderChunk
now contains names with hash placeholders instead of final names, which will be replaced when used in the returned code orChunkInfo.imports/importedBindings/exports
([v3.0] New hashing algorithm that "fixes (nearly) everything" #4543 and [v3.0] Use ASCII characters for hash placeholders #4631)Features
output.banner/footer/intro/outro
are now called per-chunk with some chunk information ([v3.0] New hashing algorithm that "fixes (nearly) everything" #4543)renderChunk
([v3.0] New hashing algorithm that "fixes (nearly) everything" #4543)entryFileNames
logic is used and the path is included in the[name]
property. This finally gives full control over file names when preserving modules ([v3.0] Rework file name patterns when preserving modules #4565)output.entryFileNames
now also supports the[hash]
placeholder when preserving modules ([v3.0] Rework file name patterns when preserving modules #4565)perf
option will now collect (synchronous) timings for all plugin hooks, not just a small selection ([v3.0] Restructure perf timings #4566)name: RollupError
now to make clearer that those are custom error types ([v3.0] Refine errors and warnings #4579)generateBundle
and sourcemap files are available as regular assets ([v3.0] Better sourcemap emission #4605)__esModule
marker to the bundle if there is a default export that is rendered as a property ([v3.0] Improve interop defaults #4611)foo[Symbol.toStringTag]
to "Module" if foo is a namespace ([v3.0] Improve interop defaults #4611)--bundleConfigAsCjs
which will force the configuration to be bundled to CommonJS ([v3.0] Always try to load config files via Node if possible #4621)output.externalImportAssertions
option allows to turn off emission of import assertions ([v3.0] Basic support for import assertions #4646)output.dynamicImportInCjs
to control if dynamic imports are emitted asimport(…)
or wrappedrequire(…)
when generating commonjs output ([v3.0] Keep dynamic imports in CommonJS output #4647)Bug Fixes
renderChunk
, e.g. minification, into account ([v3.0] New hashing algorithm that "fixes (nearly) everything" #4543)Pull Requests