Repository: vercel/next.js
Pull request: Turbopack: include availability hash in the ident of evaluated chunks groups

### What?

include availability hash in the ident of evaluated chunks groups just like with normal chunk groups


Closes PACK-5540

Changed files:
filename: turbopack/crates/turbopack-browser/src/chunking_context.rs
patch: @@ -573,13 +573,13 @@ impl ChunkingContext for BrowserChunkingContext {
         let span = tracing::info_span!("chunking", name = ident.to_string().await?.to_string());
         async move {
             let this = self.await?;
-            let modules = chunk_group.entries();
+            let entries = chunk_group.entries();
             let input_availability_info = availability_info;
             let MakeChunkGroupResult {
                 chunks,
                 availability_info,
             } = make_chunk_group(
-                modules,
+                entries,
                 module_graph,
                 ResolvedVc::upcast(self),
                 input_availability_info,
@@ -604,11 +604,12 @@ impl ChunkingContext for BrowserChunkingContext {
                             ident.with_modifier(available_modules.hash().await?.to_string().into());
                     }
                 }
+                let other_assets = Vc::cell(assets.clone());
                 assets.push(
                     self.generate_chunk_list_register_chunk(
                         ident,
                         EvaluatableAssets::empty(),
-                        Vc::cell(assets.clone()),
+                        other_assets,
                         EcmascriptDevChunkListSource::Dynamic,
                     )
                     .to_resolved()
@@ -632,25 +633,23 @@ impl ChunkingContext for BrowserChunkingContext {
         ident: Vc<AssetIdent>,
         chunk_group: ChunkGroup,
         module_graph: Vc<ModuleGraph>,
-        availability_info: AvailabilityInfo,
+        input_availability_info: AvailabilityInfo,
     ) -> Result<Vc<ChunkGroupResult>> {
         let span = {
             let ident = ident.to_string().await?.to_string();
             tracing::info_span!("chunking", chunking_type = "evaluated", ident = ident)
         };
         async move {
             let this = self.await?;
-
             let entries = chunk_group.entries();
-
             let MakeChunkGroupResult {
                 chunks,
                 availability_info,
             } = make_chunk_group(
                 entries,
                 module_graph,
                 ResolvedVc::upcast(self),
-                availability_info,
+                input_availability_info,
             )
             .await?;
 
@@ -673,6 +672,17 @@ impl ChunkingContext for BrowserChunkingContext {
             );
 
             if this.enable_hot_module_replacement {
+                let mut ident = ident;
+                match input_availability_info {
+                    AvailabilityInfo::Root => {}
+                    AvailabilityInfo::Untracked => {
+                        ident = ident.with_modifier(rcstr!("untracked"));
+                    }
+                    AvailabilityInfo::Complete { available_modules } => {
+                        ident =
+                            ident.with_modifier(available_modules.hash().await?.to_string().into());
+                    }
+                }
                 assets.push(
                     self.generate_chunk_list_register_chunk(
                         ident,