From d4bda8697a3f32fdfaa5f7683cc7945b7e42b572 Mon Sep 17 00:00:00 2001 From: pshu Date: Fri, 15 May 2026 15:10:54 +0800 Subject: [PATCH 1/4] fix(hmr): hash only emitted bytes in code generation result Align `CodeGenerationResult::set_hash` with webpack's `CodeGenerationResults.getHash`, which feeds `source.updateHash(hash)` and never mixes source-map metadata into the digest. In rspack, `Source::hash` for `SourceMapSource` folds in `source_map` (which carries the `sourcesContent` snapshot of the loader-input file). For multi-block source files such as Vue SFCs that means changing one block shifts the codegen hash of every sibling sub-module even when their emitted bytes are identical. The HMR plugin compares those hashes to decide which modules go into a hot-update chunk, so it ships byte-identical modules and downstream HMR flows that key off "this module changed" (e.g. vue-loader's self-accept on the SFC main wrapper) misfire. Switch to `source.buffer()` so the digest only reflects the actually emitted bytes plus `chunk_init_fragments` and `runtime_requirements`, matching webpack semantics. --- .../src/artifacts/code_generation_results.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/rspack_core/src/artifacts/code_generation_results.rs b/crates/rspack_core/src/artifacts/code_generation_results.rs index bb203ece5cc3..a9105db05924 100644 --- a/crates/rspack_core/src/artifacts/code_generation_results.rs +++ b/crates/rspack_core/src/artifacts/code_generation_results.rs @@ -167,7 +167,16 @@ impl CodeGenerationResult { let mut hasher = RspackHash::with_salt(hash_function, hash_salt); for (source_type, source) in self.inner.as_ref() { source_type.hash(&mut hasher); - source.hash(&mut hasher); + // Hash only the emitted bytes, matching webpack's + // `CodeGenerationResults.getHash` which feeds `source.updateHash(hash)` + // and never mixes source-map metadata into the digest. + // `Source::hash` for `SourceMapSource` also folds in `source_map` + // (including the `sourcesContent` snapshot of the loader-input file). + // For multi-block sources like Vue SFCs that means changing one block + // shifts the codegen hash of every sibling sub-module even when their + // emitted bytes are identical, which causes HMR to ship unchanged + // modules in hot-update chunks and breaks downstream HMR flows. + source.buffer().hash(&mut hasher); } self.chunk_init_fragments.hash(&mut hasher); self.runtime_requirements.hash(&mut hasher); From 024f7109326fd853969746cdc97a1e2c48786230 Mon Sep 17 00:00:00 2001 From: pshu Date: Mon, 18 May 2026 10:55:19 +0800 Subject: [PATCH 2/4] test: refresh stats snapshots for hmr codegen hash change Code generation hashes shift with the previous commit because we now ignore source-map metadata in the digest. Update stats snapshots to reflect the new hashes; no behavioral change in the test expectations. --- tests/rspack-test/statsAPICases/basic.js | 6 +++--- tests/rspack-test/statsAPICases/ids.js | 2 +- tests/rspack-test/statsAPICases/with-query.js | 4 ++-- .../all-stats/__snapshots__/stats.txt | 2 +- .../__snapshots__/stats.txt | 2 +- .../__snapshots__/stats.txt | 4 ++-- .../immutable/__snapshots__/stats.txt | 4 ++-- .../issue-7577/__snapshots__/stats.txt | 20 +++++++++---------- .../preset-detailed/__snapshots__/stats.txt | 2 +- .../preset-verbose/__snapshots__/stats.txt | 2 +- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/rspack-test/statsAPICases/basic.js b/tests/rspack-test/statsAPICases/basic.js index 8227b2420a4f..3d2190da8f26 100644 --- a/tests/rspack-test/statsAPICases/basic.js +++ b/tests/rspack-test/statsAPICases/basic.js @@ -69,7 +69,7 @@ module.exports = { main.js, ], filteredModules: undefined, - hash: cb00f6f863f5faec, + hash: 87331788814991c4, id: 889, idHints: Array [], initial: true, @@ -199,7 +199,7 @@ module.exports = { errorsCount: 0, filteredAssets: undefined, filteredModules: undefined, - hash: ec79eb103428f92c, + hash: 86f1efd6f115703d, modules: Array [ Object { assets: Array [], @@ -319,7 +319,7 @@ module.exports = { entry ./fixtures/a cjs self exports reference self [195] ./fixtures/a.js - Rspack compiled successfully (ec79eb103428f92c) + Rspack compiled successfully (86f1efd6f115703d) `); } }; diff --git a/tests/rspack-test/statsAPICases/ids.js b/tests/rspack-test/statsAPICases/ids.js index 43b54ef7975f..bd72e5f1b55d 100644 --- a/tests/rspack-test/statsAPICases/ids.js +++ b/tests/rspack-test/statsAPICases/ids.js @@ -58,7 +58,7 @@ module.exports = { files: Array [ main.js, ], - hash: cb00f6f863f5faec, + hash: 87331788814991c4, id: 889, idHints: Array [], initial: true, diff --git a/tests/rspack-test/statsAPICases/with-query.js b/tests/rspack-test/statsAPICases/with-query.js index 7ef1e22bd285..0c95462e031a 100644 --- a/tests/rspack-test/statsAPICases/with-query.js +++ b/tests/rspack-test/statsAPICases/with-query.js @@ -63,7 +63,7 @@ module.exports = { main.js, ], filteredModules: undefined, - hash: c27ad289237261c4, + hash: a7324adc2821f9df, id: 889, idHints: Array [], initial: true, @@ -432,7 +432,7 @@ module.exports = { errorsCount: 0, filteredAssets: undefined, filteredModules: undefined, - hash: e525b5e2aca9a71e, + hash: aa849df444227f6c, modules: Array [ Object { assets: Array [], diff --git a/tests/rspack-test/statsOutputCases/all-stats/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/all-stats/__snapshots__/stats.txt index 387f253fddcc..0396b12fba2b 100644 --- a/tests/rspack-test/statsOutputCases/all-stats/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/all-stats/__snapshots__/stats.txt @@ -23,4 +23,4 @@ webpack/runtime/make_namespace_object xx bytes {main} [code generated] [no exports] [used exports unknown] -1970-04-20 12: Rspack x.x.x compiled successfully in X s (7d8dc8543f75d258) \ No newline at end of file +1970-04-20 12: Rspack x.x.x compiled successfully in X s (d8f710680efa6f11) \ No newline at end of file diff --git a/tests/rspack-test/statsOutputCases/auxiliary-files-test/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/auxiliary-files-test/__snapshots__/stats.txt index 04f3cca2a74b..52d6b1ff810d 100644 --- a/tests/rspack-test/statsOutputCases/auxiliary-files-test/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/auxiliary-files-test/__snapshots__/stats.txt @@ -54,4 +54,4 @@ runtime modules xx KiB [no exports] [used exports unknown] -Rspack compiled successfully (7762259ba9d01658) \ No newline at end of file +Rspack compiled successfully (7dfb79034cf081f9) \ No newline at end of file diff --git a/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/__snapshots__/stats.txt index 37400564ce1d..9507076c0775 100644 --- a/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/__snapshots__/stats.txt @@ -1,9 +1,9 @@ -asset app.e1d3fd6ad57c1842-1.js xx bytes [emitted] [immutable] (name: app) +asset app.18bf0ffd54393b63-1.js xx bytes [emitted] [immutable] (name: app) orphan modules xx bytes [orphan] 3 modules ./entry-1.js xx bytes [built] [code generated] Rspack x.x.x compiled successfully in X s -asset app.fa8ca3aace1a91e0-2.js xx bytes [emitted] [immutable] (name: app) +asset app.b4e6f89fc99a9bc0-2.js xx bytes [emitted] [immutable] (name: app) orphan modules xx bytes [orphan] 3 modules ./entry-2.js xx bytes [built] [code generated] Rspack x.x.x compiled successfully in X s \ No newline at end of file diff --git a/tests/rspack-test/statsOutputCases/immutable/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/immutable/__snapshots__/stats.txt index 7b9e078352d0..e12b95ac0a40 100644 --- a/tests/rspack-test/statsOutputCases/immutable/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/immutable/__snapshots__/stats.txt @@ -1,2 +1,2 @@ -asset 99bbf509c54b9cc6.js xx KiB [emitted] [immutable] (name: main) -asset 7b129503d319bd23.js xx bytes [emitted] [immutable] \ No newline at end of file +asset f977ac2f640d47ef.js xx KiB [emitted] [immutable] (name: main) +asset aa3f9fc6f4746fb7.js xx bytes [emitted] [immutable] \ No newline at end of file diff --git a/tests/rspack-test/statsOutputCases/issue-7577/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/issue-7577/__snapshots__/stats.txt index b12eb85c3201..d1fc40dc3386 100644 --- a/tests/rspack-test/statsOutputCases/issue-7577/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/issue-7577/__snapshots__/stats.txt @@ -1,16 +1,16 @@ asset a-runtime~main-8fb196856cbdc52a.js xx KiB [emitted] [immutable] (name: runtime~main) asset a-main-c9ca2f06db018feb.js xx bytes [emitted] [immutable] (name: main) -asset a-all-a_js-9ab62d76d5b1b4fb.js xx bytes [emitted] [immutable] (id hint: all) -Entrypoint main xx KiB = a-runtime~main-8fb196856cbdc52a.js xx KiB a-all-a_js-9ab62d76d5b1b4fb.js xx bytes a-main-c9ca2f06db018feb.js xx bytes +asset a-all-a_js-64f0e7c6d299fd0d.js xx bytes [emitted] [immutable] (id hint: all) +Entrypoint main xx KiB = a-runtime~main-8fb196856cbdc52a.js xx KiB a-all-a_js-64f0e7c6d299fd0d.js xx bytes a-main-c9ca2f06db018feb.js xx bytes runtime modules xx KiB 3 modules ./a.js xx bytes [built] [code generated] Rspack x.x.x compiled successfully in X s asset b-runtime~main-5ee5a9d8cad7385e.js xx KiB [emitted] [immutable] (name: runtime~main) asset b-main-8680a888f1bf9eb6.js xx bytes [emitted] [immutable] (name: main) -asset b-all-b_js-9176ed8ced1de96c.js xx bytes [emitted] [immutable] (id hint: all) -asset b-vendors-node_modules_vendor_js-e936af1c5d692780.js xx bytes [emitted] [immutable] (id hint: vendors) -Entrypoint main xx KiB = b-runtime~main-5ee5a9d8cad7385e.js xx KiB b-vendors-node_modules_vendor_js-e936af1c5d692780.js xx bytes b-all-b_js-9176ed8ced1de96c.js xx bytes b-main-8680a888f1bf9eb6.js xx bytes +asset b-all-b_js-28d8dcce6509b275.js xx bytes [emitted] [immutable] (id hint: all) +asset b-vendors-node_modules_vendor_js-4905b28e9e3a55f3.js xx bytes [emitted] [immutable] (id hint: vendors) +Entrypoint main xx KiB = b-runtime~main-5ee5a9d8cad7385e.js xx KiB b-vendors-node_modules_vendor_js-4905b28e9e3a55f3.js xx bytes b-all-b_js-28d8dcce6509b275.js xx bytes b-main-8680a888f1bf9eb6.js xx bytes runtime modules xx KiB 5 modules cacheable modules xx bytes ./b.js xx bytes [built] [code generated] @@ -18,12 +18,12 @@ cacheable modules xx bytes Rspack x.x.x compiled successfully in X s assets by chunk xx bytes (id hint: all) - asset c-all-b_js-0f2306cb10798728.js xx bytes [emitted] [immutable] (id hint: all) - asset c-all-c_js-305d7d7dfb13d2f8.js xx bytes [emitted] [immutable] (id hint: all) -asset c-runtime~main-a87e28008385c9d2.js xx KiB [emitted] [immutable] (name: runtime~main) + asset c-all-b_js-49fd3db149c092b2.js xx bytes [emitted] [immutable] (id hint: all) + asset c-all-c_js-11a75bd424d9b308.js xx bytes [emitted] [immutable] (id hint: all) +asset c-runtime~main-a8cd0e271a2c9362.js xx KiB [emitted] [immutable] (name: runtime~main) asset c-main-cb74163fc8cc359b.js xx bytes [emitted] [immutable] (name: main) -asset c-vendors-node_modules_vendor_js-e936af1c5d692780.js xx bytes [emitted] [immutable] (id hint: vendors) -Entrypoint main xx KiB = c-runtime~main-a87e28008385c9d2.js xx KiB c-all-c_js-305d7d7dfb13d2f8.js xx bytes c-main-cb74163fc8cc359b.js xx bytes +asset c-vendors-node_modules_vendor_js-4905b28e9e3a55f3.js xx bytes [emitted] [immutable] (id hint: vendors) +Entrypoint main xx KiB = c-runtime~main-a8cd0e271a2c9362.js xx KiB c-all-c_js-11a75bd424d9b308.js xx bytes c-main-cb74163fc8cc359b.js xx bytes runtime modules xx KiB 13 modules cacheable modules xx bytes ./c.js xx bytes [built] [code generated] diff --git a/tests/rspack-test/statsOutputCases/preset-detailed/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/preset-detailed/__snapshots__/stats.txt index 8a8f3596156b..829458c9e515 100644 --- a/tests/rspack-test/statsOutputCases/preset-detailed/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/preset-detailed/__snapshots__/stats.txt @@ -54,4 +54,4 @@ WARNING in ./index.js 3:1-17 · ─────── ╰──── -1970-04-20 12: Rspack x.x.x compiled with 2 warnings in X s (f917d9aef4f31935) \ No newline at end of file +1970-04-20 12: Rspack x.x.x compiled with 2 warnings in X s (83adcac74ec6e0e0) \ No newline at end of file diff --git a/tests/rspack-test/statsOutputCases/preset-verbose/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/preset-verbose/__snapshots__/stats.txt index b4ede1071e1c..b29dfb36248b 100644 --- a/tests/rspack-test/statsOutputCases/preset-verbose/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/preset-verbose/__snapshots__/stats.txt @@ -134,4 +134,4 @@ WARNING in ./index.js 3:1-17 · ─────── ╰──── -1970-04-20 12: Rspack x.x.x compiled with 2 warnings in X s (f917d9aef4f31935) \ No newline at end of file +1970-04-20 12: Rspack x.x.x compiled with 2 warnings in X s (83adcac74ec6e0e0) \ No newline at end of file From 3651d9fa50b7ad6fe370ba7a89ceff0976bf4738 Mon Sep 17 00:00:00 2001 From: pshu Date: Mon, 18 May 2026 11:29:10 +0800 Subject: [PATCH 3/4] ci: rerun From 2fe2afe1717a307db3605d88055737b633fca8bc Mon Sep 17 00:00:00 2001 From: pshu Date: Mon, 18 May 2026 12:04:49 +0800 Subject: [PATCH 4/4] fix(hmr): use buffer-only hash only for SourceMapSource Follow-up on the previous commit: keep `Source::hash` (which routes through `CachedSource`'s memoised u64) for non-SourceMapSource entries, and switch to `source.buffer()` only when the contained source is a `SourceMapSource`. That preserves the upstream codegen hashes for every source type that already hashed only the emitted bytes (RawStringSource, OriginalSource, etc.), and removes the CodSpeed regressions in `persistent_cache_restore` and `create_chunk_ids` that the prior unconditional-buffer hash caused. Also restore `chunk_init_fragments` to the digest; it was removed in the previous commit while exploring causes, but is unrelated to the SFC HMR bug and was already in the digest on main. Add unit tests covering the three relevant cases (RawStringSource, SourceMapSource, CachedSource) so future refactors of the helper cannot silently regress the Vue 2 multi-block SFC behavior. Net diff vs main: the helper itself and its tests. Stats snapshots revert to their upstream values because non-SourceMapSource entries keep the same hash output as before. --- .../src/artifacts/code_generation_results.rs | 119 ++++++++++++++++-- tests/rspack-test/statsAPICases/basic.js | 6 +- tests/rspack-test/statsAPICases/ids.js | 2 +- tests/rspack-test/statsAPICases/with-query.js | 4 +- .../all-stats/__snapshots__/stats.txt | 2 +- .../__snapshots__/stats.txt | 2 +- .../__snapshots__/stats.txt | 4 +- .../immutable/__snapshots__/stats.txt | 4 +- .../issue-7577/__snapshots__/stats.txt | 20 +-- .../preset-detailed/__snapshots__/stats.txt | 2 +- .../preset-verbose/__snapshots__/stats.txt | 2 +- 11 files changed, 132 insertions(+), 35 deletions(-) diff --git a/crates/rspack_core/src/artifacts/code_generation_results.rs b/crates/rspack_core/src/artifacts/code_generation_results.rs index a9105db05924..675578e42cc8 100644 --- a/crates/rspack_core/src/artifacts/code_generation_results.rs +++ b/crates/rspack_core/src/artifacts/code_generation_results.rs @@ -8,7 +8,7 @@ use std::{ use anymap::CloneAny; use rspack_collections::IdentifierMap; use rspack_hash::{HashDigest, HashFunction, HashSalt, RspackHash, RspackHashDigest}; -use rspack_sources::BoxSource; +use rspack_sources::{BoxSource, CachedSource, SourceMapSource}; use rspack_util::atom::Atom; use rustc_hash::{FxHashMap as HashMap, FxHashSet}; use serde::Serialize; @@ -167,22 +167,47 @@ impl CodeGenerationResult { let mut hasher = RspackHash::with_salt(hash_function, hash_salt); for (source_type, source) in self.inner.as_ref() { source_type.hash(&mut hasher); - // Hash only the emitted bytes, matching webpack's - // `CodeGenerationResults.getHash` which feeds `source.updateHash(hash)` - // and never mixes source-map metadata into the digest. - // `Source::hash` for `SourceMapSource` also folds in `source_map` - // (including the `sourcesContent` snapshot of the loader-input file). - // For multi-block sources like Vue SFCs that means changing one block - // shifts the codegen hash of every sibling sub-module even when their - // emitted bytes are identical, which causes HMR to ship unchanged - // modules in hot-update chunks and breaks downstream HMR flows. - source.buffer().hash(&mut hasher); + hash_source_content(source, &mut hasher); } self.chunk_init_fragments.hash(&mut hasher); self.runtime_requirements.hash(&mut hasher); self.hash = Some(hasher.digest(hash_digest)); } +} + +/// Hash the *emitted bytes* of a code generation source, matching webpack's +/// `CodeGenerationResults.getHash` semantics. +/// +/// `Source::hash` for `SourceMapSource` folds in the wrapped `source_map` +/// (including its `sourcesContent` snapshot of the loader-input file). For +/// multi-block sources like Vue SFCs that means changing one block shifts the +/// codegen hash of every sibling sub-module even when their emitted bytes are +/// identical, which causes HMR to ship unchanged modules in hot-update chunks +/// (https://github.com/web-infra-dev/rspack/issues/11635). +/// +/// Other source types (`RawStringSource`, `OriginalSource`, etc.) already +/// hash only the buffer in their own `Hash` impl, so we delegate to +/// `Source::hash` to keep `CachedSource`'s memoised digest on the hot path. +fn hash_source_content(source: &BoxSource, hasher: &mut H) { + // `source.as_any()` would resolve through the `Box: AsAny` + // blanket impl and hand back the Box wrapper. Deref to `&dyn Source` first + // so the underlying concrete type's `as_any` is dispatched via the vtable. + let inner: &dyn rspack_sources::Source = source.as_ref(); + let any = inner.as_any(); + if let Some(cached) = any.downcast_ref::() { + let cached_inner: &dyn rspack_sources::Source = cached.inner().as_ref(); + if cached_inner.as_any().is::() { + source.buffer().hash(hasher); + return; + } + } else if any.is::() { + source.buffer().hash(hasher); + return; + } + source.hash(hasher); +} +impl CodeGenerationResult { /// Concatenated modules already encode the generated module bodies into /// `ConcatenatedModule::get_runtime_hash`, so we can reuse that digest here /// and only mix in codegen-specific metadata instead of hashing the large @@ -424,3 +449,75 @@ pub struct CodeGenerationJob { pub runtimes: Vec, pub scope: Option, } + +#[cfg(test)] +mod tests { + use std::hash::Hasher; + + use rspack_sources::{ + BoxSource, CachedSource, RawStringSource, SourceExt, SourceMap, SourceMapSource, + WithoutOriginalOptions, + }; + use rustc_hash::FxHasher; + + use super::hash_source_content; + + fn raw(value: &str) -> BoxSource { + RawStringSource::from(value.to_string()).boxed() + } + + fn source_map_source(value: &str, sources_content: &str) -> BoxSource { + let map = SourceMap::from_json(&format!( + r#"{{"version":3,"sources":["child.vue"],"sourcesContent":[{}],"names":[],"mappings":""}}"#, + serde_json::Value::String(sources_content.to_string()), + )) + .unwrap(); + SourceMapSource::new(WithoutOriginalOptions { + value: value.to_string(), + name: "child.vue".to_string(), + source_map: map, + }) + .boxed() + } + + fn hash(source: &BoxSource) -> u64 { + let mut hasher = FxHasher::default(); + hash_source_content(source, &mut hasher); + hasher.finish() + } + + #[test] + fn raw_source_is_routed_through_source_hash() { + // For non-SourceMapSource we delegate to `Source::hash` (which already + // hashes only the buffer + a tag), preserving `CachedSource`'s memoised + // digest fast path. + let a = raw("hello"); + let b = raw("hello"); + let c = raw("world"); + assert_eq!(hash(&a), hash(&b)); + assert_ne!(hash(&a), hash(&c)); + } + + #[test] + fn source_map_source_hash_only_depends_on_emitted_bytes() { + let baseline = source_map_source("hello", ""); + let baseline_hash = hash(&baseline); + // Same emitted bytes, *different* sources_content (mimicking the Vue SFC + // case where the template block changes but the script-setup output does + // not). Hash must be stable. + let same_bytes_other_map = source_map_source("hello", ""); + assert_eq!(hash(&same_bytes_other_map), baseline_hash); + let different_bytes = source_map_source("world", ""); + assert_ne!(hash(&different_bytes), baseline_hash); + } + + #[test] + fn cached_source_wrapping_source_map_source_takes_buffer_path() { + let baseline = + CachedSource::new(source_map_source("hello", "")).boxed(); + let baseline_hash = hash(&baseline); + let same_bytes = + CachedSource::new(source_map_source("hello", "")).boxed(); + assert_eq!(hash(&same_bytes), baseline_hash); + } +} diff --git a/tests/rspack-test/statsAPICases/basic.js b/tests/rspack-test/statsAPICases/basic.js index 3d2190da8f26..8227b2420a4f 100644 --- a/tests/rspack-test/statsAPICases/basic.js +++ b/tests/rspack-test/statsAPICases/basic.js @@ -69,7 +69,7 @@ module.exports = { main.js, ], filteredModules: undefined, - hash: 87331788814991c4, + hash: cb00f6f863f5faec, id: 889, idHints: Array [], initial: true, @@ -199,7 +199,7 @@ module.exports = { errorsCount: 0, filteredAssets: undefined, filteredModules: undefined, - hash: 86f1efd6f115703d, + hash: ec79eb103428f92c, modules: Array [ Object { assets: Array [], @@ -319,7 +319,7 @@ module.exports = { entry ./fixtures/a cjs self exports reference self [195] ./fixtures/a.js - Rspack compiled successfully (86f1efd6f115703d) + Rspack compiled successfully (ec79eb103428f92c) `); } }; diff --git a/tests/rspack-test/statsAPICases/ids.js b/tests/rspack-test/statsAPICases/ids.js index bd72e5f1b55d..43b54ef7975f 100644 --- a/tests/rspack-test/statsAPICases/ids.js +++ b/tests/rspack-test/statsAPICases/ids.js @@ -58,7 +58,7 @@ module.exports = { files: Array [ main.js, ], - hash: 87331788814991c4, + hash: cb00f6f863f5faec, id: 889, idHints: Array [], initial: true, diff --git a/tests/rspack-test/statsAPICases/with-query.js b/tests/rspack-test/statsAPICases/with-query.js index 0c95462e031a..7ef1e22bd285 100644 --- a/tests/rspack-test/statsAPICases/with-query.js +++ b/tests/rspack-test/statsAPICases/with-query.js @@ -63,7 +63,7 @@ module.exports = { main.js, ], filteredModules: undefined, - hash: a7324adc2821f9df, + hash: c27ad289237261c4, id: 889, idHints: Array [], initial: true, @@ -432,7 +432,7 @@ module.exports = { errorsCount: 0, filteredAssets: undefined, filteredModules: undefined, - hash: aa849df444227f6c, + hash: e525b5e2aca9a71e, modules: Array [ Object { assets: Array [], diff --git a/tests/rspack-test/statsOutputCases/all-stats/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/all-stats/__snapshots__/stats.txt index 0396b12fba2b..387f253fddcc 100644 --- a/tests/rspack-test/statsOutputCases/all-stats/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/all-stats/__snapshots__/stats.txt @@ -23,4 +23,4 @@ webpack/runtime/make_namespace_object xx bytes {main} [code generated] [no exports] [used exports unknown] -1970-04-20 12: Rspack x.x.x compiled successfully in X s (d8f710680efa6f11) \ No newline at end of file +1970-04-20 12: Rspack x.x.x compiled successfully in X s (7d8dc8543f75d258) \ No newline at end of file diff --git a/tests/rspack-test/statsOutputCases/auxiliary-files-test/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/auxiliary-files-test/__snapshots__/stats.txt index 52d6b1ff810d..04f3cca2a74b 100644 --- a/tests/rspack-test/statsOutputCases/auxiliary-files-test/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/auxiliary-files-test/__snapshots__/stats.txt @@ -54,4 +54,4 @@ runtime modules xx KiB [no exports] [used exports unknown] -Rspack compiled successfully (7dfb79034cf081f9) \ No newline at end of file +Rspack compiled successfully (7762259ba9d01658) \ No newline at end of file diff --git a/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/__snapshots__/stats.txt index 9507076c0775..37400564ce1d 100644 --- a/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/commons-plugin-issue-4980/__snapshots__/stats.txt @@ -1,9 +1,9 @@ -asset app.18bf0ffd54393b63-1.js xx bytes [emitted] [immutable] (name: app) +asset app.e1d3fd6ad57c1842-1.js xx bytes [emitted] [immutable] (name: app) orphan modules xx bytes [orphan] 3 modules ./entry-1.js xx bytes [built] [code generated] Rspack x.x.x compiled successfully in X s -asset app.b4e6f89fc99a9bc0-2.js xx bytes [emitted] [immutable] (name: app) +asset app.fa8ca3aace1a91e0-2.js xx bytes [emitted] [immutable] (name: app) orphan modules xx bytes [orphan] 3 modules ./entry-2.js xx bytes [built] [code generated] Rspack x.x.x compiled successfully in X s \ No newline at end of file diff --git a/tests/rspack-test/statsOutputCases/immutable/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/immutable/__snapshots__/stats.txt index e12b95ac0a40..7b9e078352d0 100644 --- a/tests/rspack-test/statsOutputCases/immutable/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/immutable/__snapshots__/stats.txt @@ -1,2 +1,2 @@ -asset f977ac2f640d47ef.js xx KiB [emitted] [immutable] (name: main) -asset aa3f9fc6f4746fb7.js xx bytes [emitted] [immutable] \ No newline at end of file +asset 99bbf509c54b9cc6.js xx KiB [emitted] [immutable] (name: main) +asset 7b129503d319bd23.js xx bytes [emitted] [immutable] \ No newline at end of file diff --git a/tests/rspack-test/statsOutputCases/issue-7577/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/issue-7577/__snapshots__/stats.txt index d1fc40dc3386..b12eb85c3201 100644 --- a/tests/rspack-test/statsOutputCases/issue-7577/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/issue-7577/__snapshots__/stats.txt @@ -1,16 +1,16 @@ asset a-runtime~main-8fb196856cbdc52a.js xx KiB [emitted] [immutable] (name: runtime~main) asset a-main-c9ca2f06db018feb.js xx bytes [emitted] [immutable] (name: main) -asset a-all-a_js-64f0e7c6d299fd0d.js xx bytes [emitted] [immutable] (id hint: all) -Entrypoint main xx KiB = a-runtime~main-8fb196856cbdc52a.js xx KiB a-all-a_js-64f0e7c6d299fd0d.js xx bytes a-main-c9ca2f06db018feb.js xx bytes +asset a-all-a_js-9ab62d76d5b1b4fb.js xx bytes [emitted] [immutable] (id hint: all) +Entrypoint main xx KiB = a-runtime~main-8fb196856cbdc52a.js xx KiB a-all-a_js-9ab62d76d5b1b4fb.js xx bytes a-main-c9ca2f06db018feb.js xx bytes runtime modules xx KiB 3 modules ./a.js xx bytes [built] [code generated] Rspack x.x.x compiled successfully in X s asset b-runtime~main-5ee5a9d8cad7385e.js xx KiB [emitted] [immutable] (name: runtime~main) asset b-main-8680a888f1bf9eb6.js xx bytes [emitted] [immutable] (name: main) -asset b-all-b_js-28d8dcce6509b275.js xx bytes [emitted] [immutable] (id hint: all) -asset b-vendors-node_modules_vendor_js-4905b28e9e3a55f3.js xx bytes [emitted] [immutable] (id hint: vendors) -Entrypoint main xx KiB = b-runtime~main-5ee5a9d8cad7385e.js xx KiB b-vendors-node_modules_vendor_js-4905b28e9e3a55f3.js xx bytes b-all-b_js-28d8dcce6509b275.js xx bytes b-main-8680a888f1bf9eb6.js xx bytes +asset b-all-b_js-9176ed8ced1de96c.js xx bytes [emitted] [immutable] (id hint: all) +asset b-vendors-node_modules_vendor_js-e936af1c5d692780.js xx bytes [emitted] [immutable] (id hint: vendors) +Entrypoint main xx KiB = b-runtime~main-5ee5a9d8cad7385e.js xx KiB b-vendors-node_modules_vendor_js-e936af1c5d692780.js xx bytes b-all-b_js-9176ed8ced1de96c.js xx bytes b-main-8680a888f1bf9eb6.js xx bytes runtime modules xx KiB 5 modules cacheable modules xx bytes ./b.js xx bytes [built] [code generated] @@ -18,12 +18,12 @@ cacheable modules xx bytes Rspack x.x.x compiled successfully in X s assets by chunk xx bytes (id hint: all) - asset c-all-b_js-49fd3db149c092b2.js xx bytes [emitted] [immutable] (id hint: all) - asset c-all-c_js-11a75bd424d9b308.js xx bytes [emitted] [immutable] (id hint: all) -asset c-runtime~main-a8cd0e271a2c9362.js xx KiB [emitted] [immutable] (name: runtime~main) + asset c-all-b_js-0f2306cb10798728.js xx bytes [emitted] [immutable] (id hint: all) + asset c-all-c_js-305d7d7dfb13d2f8.js xx bytes [emitted] [immutable] (id hint: all) +asset c-runtime~main-a87e28008385c9d2.js xx KiB [emitted] [immutable] (name: runtime~main) asset c-main-cb74163fc8cc359b.js xx bytes [emitted] [immutable] (name: main) -asset c-vendors-node_modules_vendor_js-4905b28e9e3a55f3.js xx bytes [emitted] [immutable] (id hint: vendors) -Entrypoint main xx KiB = c-runtime~main-a8cd0e271a2c9362.js xx KiB c-all-c_js-11a75bd424d9b308.js xx bytes c-main-cb74163fc8cc359b.js xx bytes +asset c-vendors-node_modules_vendor_js-e936af1c5d692780.js xx bytes [emitted] [immutable] (id hint: vendors) +Entrypoint main xx KiB = c-runtime~main-a87e28008385c9d2.js xx KiB c-all-c_js-305d7d7dfb13d2f8.js xx bytes c-main-cb74163fc8cc359b.js xx bytes runtime modules xx KiB 13 modules cacheable modules xx bytes ./c.js xx bytes [built] [code generated] diff --git a/tests/rspack-test/statsOutputCases/preset-detailed/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/preset-detailed/__snapshots__/stats.txt index 829458c9e515..8a8f3596156b 100644 --- a/tests/rspack-test/statsOutputCases/preset-detailed/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/preset-detailed/__snapshots__/stats.txt @@ -54,4 +54,4 @@ WARNING in ./index.js 3:1-17 · ─────── ╰──── -1970-04-20 12: Rspack x.x.x compiled with 2 warnings in X s (83adcac74ec6e0e0) \ No newline at end of file +1970-04-20 12: Rspack x.x.x compiled with 2 warnings in X s (f917d9aef4f31935) \ No newline at end of file diff --git a/tests/rspack-test/statsOutputCases/preset-verbose/__snapshots__/stats.txt b/tests/rspack-test/statsOutputCases/preset-verbose/__snapshots__/stats.txt index b29dfb36248b..b4ede1071e1c 100644 --- a/tests/rspack-test/statsOutputCases/preset-verbose/__snapshots__/stats.txt +++ b/tests/rspack-test/statsOutputCases/preset-verbose/__snapshots__/stats.txt @@ -134,4 +134,4 @@ WARNING in ./index.js 3:1-17 · ─────── ╰──── -1970-04-20 12: Rspack x.x.x compiled with 2 warnings in X s (83adcac74ec6e0e0) \ No newline at end of file +1970-04-20 12: Rspack x.x.x compiled with 2 warnings in X s (f917d9aef4f31935) \ No newline at end of file