-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] New hashing algorithm that "fixes (nearly) everything" #4543
Conversation
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via npm install rollup/rollup#new-hashing or load it into the REPL: |
Codecov Report
@@ Coverage Diff @@
## release-3.0.0 #4543 +/- ##
=================================================
+ Coverage 98.88% 98.90% +0.01%
=================================================
Files 208 210 +2
Lines 7282 7377 +95
Branches 2081 2101 +20
=================================================
+ Hits 7201 7296 +95
Misses 26 26
Partials 55 55
Continue to review full report at Codecov.
|
e2f6395
to
3f40aa7
Compare
@yyx990803, @patak-dev, @antfu, @marvinhagemeister while it will take some time before I release this with Rollup 3 as I want to get some other PRs ready, this may be quite relevant for you, and supporting this will likely be a breaking change for you as well. |
@lukastaegert this is huge! It will allow some heavy simplifications in Vite core, we may be able to remove most of our custom asset path handling in favor of a solution that plays well with other plugins in the rollup ecosystem. It is also quite timely. We were about to release Vite v3, in around 10 days. But we may need to evaluate delaying it to already include the breaking to rollup v3. We may probably release v3, and then do another major in a few months. Thanks for the heads up, and a pre-release version will be quite helpful. Do you have some ETA in mind for releasing Rollup 3 stable? |
This is awesome!! Thank you so much for tackling this problem 💯 |
Thank you! @patak-dev Rollup 3 will definitely not be ready in 10 days, but a solid pre-release should be no problem. I hope we can pull off v3 in a month or two at most, I will try not to put too much else in it, but there are some other smaller breaking changes that have been held back for some time that I want to tackle. |
Thanks for the info @lukastaegert, after some discussions with the team and ecosystem, we are thinking of keeping our current plans and releasing Vite v3 using Rollup v2 in around ~10 days. Once Rollup v3 is stable, and plugins in the rollup ecosystem have been updated to support it, we can release Vite v4. So no rush from our side. Thanks again for all your work on improving rollup. |
I see one edge case that needs extended info and testing when we use html as input it could get processed by parse5 and i am not sure if parse5 handels this correct parse5 gets used in many SSR stuff and other places its the defacto most often used HTMLParser at present in the NodeJS Ecosystem as far as i am aware we could use hashes and also file names via references to build up html Does Parse5 handle that correct?the placeholders make use of the fact that JavaScript supports unicode characters. I used four random characters from the reserved plane, currently the relevant code to test is in: https://github.com/inikulin/parse5/blob/master/packages/parse5/lib/tokenizer/preprocessor.ts when this emits the unicode chars untouched rollup is fine and can release that. NoteI guess this can only happen when you create some plugins that do some how use this placeholder hash like hot swap maybe |
Currently, placeholders are only used inside JavaScript files while the asset handling logic has not changed. Therefore I do not see why you would use a placeholder in an HTML file, considering you would need to replace the placeholder yourself. That being said, if you would support us by testing this, it definitely does not hurt, maybe there will be a reason to extend the logic to asset files eventually. |
@lukastaegert your maybe correct but i only saw that rollup uses unicode chars an i remember that there are a lot of problems thats why i tought it would be clever to document that if it later becomes relevant i will also now work on a test inside parse5 with that chars and when it works it will not hurt and we are sure that there are no upcoming magic errors that we can not track. It would be clever to support HTML compatible tokens because there could be plugins that depend on that. I for my self often code loaders with rollup and do not even reach the generate bundle point in that cases. |
also i guess we should add @jakearchibald here and invite him to test that as he is deep into hashing and has already tests for some cases i guess he creates the input for web.dev |
I already added comments to the issues he created over time 😜 |
* 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] 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] 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>
* 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] 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] 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
* 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] 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] 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
* 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] 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] 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
This PR has been released as part of rollup@3.0.0-7. Note that this is a pre-release, so to test it, you need to install Rollup via |
This PR has been released as part of rollup@3.0.0-8. Note that this is a pre-release, so to test it, you need to install Rollup via |
* 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] 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] 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
This PR has been released as part of rollup@3.0.0. You can test it via |
Thank you for this wonderful write up and the work that went into this PR! 🎉
If anybody else was curious about the previous graph to compare against, now that this PR has been merged, I dug it out of Wayback Machine here. |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
This is the one feature I always wanted to have ready before releasing Rollup v3, which ultimately made me delay that release far too much.
The previous hashing algorithm
This is how the previous chunk hashing algorithm worked:
renderChunk
plugin hookThis approach has several problems:
renderChunk
is completely ignored.Possible solution: Sorted rendering
One way to solve this would be to first render all chunks that do not have any dependencies, then iteratively render all chunks that only have rendered chunks as dependencies until all chunks are rendered.
While this would work in some cases, this approach has several drawbacks:
renderChunk
hook might introduce additional dependencies.Implemented solution: Hash placeholders
Therefore I decided upon a different solution that works like this:
renderChunk
hook.In order to avoid accidentally replacing non-placeholders, the placeholders make use of the fact that JavaScript supports unicode characters. I used four random characters from the reserved plane, currently
\uf7f9\ue4d3
for the start of the placeholder and\ue3cc\uf1fe
for the end of the placeholder.This approach also allows us, to give full access to the chunk graph in
renderChunk
, though the names are preliminary at this point. But as Rollup does not make assumptions about the output ofrenderChunk
, you can freely inject chunk names in that hook now.All in all, this changes the plugin hook graph in the following way:
Chunk information available to hooks and options
Some hooks now receive additional information. To go into details, let's first define some types:
A
PrerenderedChunk
contains very basic chunk information before any rendering takes place and before the chunk name has been generated. After this update, this reduced set of chunk information is only passed to theentryFileNames
andchunkFileNames
options. Note that for obvious reasons, we no longer have the rendered module information available. Instead, this type now gets a list of includedmoduleIds
so that one can at least know what is roughly contained in the chunk.A
RenderedChunk
contains the full rendering information of the chunk. File names in imports and rendered modules will contain placeholders instead of file hashes, though. This information is available in therenderChunk
hook, theaugmentChunkHash
hook, and in thebanner
/footer
/intro
/outro
hooks and options.Also, the signature of
renderChunk
is extended to receive a fourth parametermeta: { chunks: { [fileName: string]: RenderedChunk } }
that gives access to the entire chunk graph.Note also that when adding or removing imports or exports in
renderChunk
, plugins should now take care to update theRenderedChunk
object they receive to reflect the updated information. This will provide correct information to subsequent plugins and to the final bundle as Rollup will also replace hashes inimports
,importedBindings
anddynamicImports
(besidesimplicitlyLoadedBefore
andfileName
).Additional new features
intro
,outro
,banner
,footer
are functions, they are now called per chunk. While they do not get access to the rendered modules in the chunk, they get a list of all included module ids.[name]-[hash:12].js
will create 12 character hashesBreaking changes
entryFileNames
andchunkFileNames
no longer get access to amodules
object with the content of rendered modules. Instead, the get a list of includedmoduleIds
.and referenced
importsin the
renderChunk` hook will get file names with placeholders instead of hashes. These file names can be safely used in the return value of the hook, though, as any hash placeholders will be replaced with the actual hashes in the end.Also, some deprecated features have been removed, and the Node compatibility target has been raised, but I will create separate PRs for those to make them explicit.