From 2420cf8aa9d41485cff57b80d3955640fa7d4d96 Mon Sep 17 00:00:00 2001 From: Lukas Taegert-Atkinson Date: Tue, 5 Jul 2022 06:23:49 +0200 Subject: [PATCH] [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 --- .../_expected/amd/entry-main-5940aabc-amd.js | 4 ++++ .../_expected/cjs/entry-main-9cf3a232-cjs.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-5940aabc-amd.js b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-5940aabc-amd.js index bed6a1ef6b4..b863b98285e 100644 --- a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-5940aabc-amd.js +++ b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-5940aabc-amd.js @@ -1,6 +1,10 @@ define(['require'], (function (require) { 'use strict'; console.log('main'); +<<<<<<<< HEAD:test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-5940aabc-amd.js new Promise(function (resolve, reject) { require(['./chunk-deb-87ce45a9-amd'], resolve, reject); }).then(console.log); +======== + new Promise(function (resolve, reject) { require(['./chunk-deb-faae56f2-amd'], resolve, reject); }).then(console.log); +>>>>>>>> 3030e2f11 ([v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543)):test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/amd/entry-main-aaf15a0c-amd.js })); diff --git a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-9cf3a232-cjs.js b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-9cf3a232-cjs.js index e28e6fa0c72..ec32df29945 100644 --- a/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-9cf3a232-cjs.js +++ b/test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-9cf3a232-cjs.js @@ -1,4 +1,8 @@ 'use strict'; console.log('main'); +<<<<<<<< HEAD:test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-9cf3a232-cjs.js Promise.resolve().then(function () { return require('./chunk-deb-69905607-cjs.js'); }).then(console.log); +======== +Promise.resolve().then(function () { return require('./chunk-deb-2221fa83-cjs.js'); }).then(console.log); +>>>>>>>> 3030e2f11 ([v3.0] New hashing algorithm that "fixes (nearly) everything" (#4543)):test/chunking-form/samples/emit-file/filenames-function-patterns/_expected/cjs/entry-main-69b6552e-cjs.js