Skip to content

Commit

Permalink
Turbopack: deterministic server action order
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Mar 7, 2025
1 parent 24c480e commit f939e0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/next-api/src/module_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl ServerActionsGraph {
return Ok(Vc::cell(Default::default()));
}

let mut result = FxHashMap::default();
let mut result = FxIndexMap::default();
graph.traverse_from_entry(entry, |node| {
if let Some(node_data) = data.get(&node.module) {
result.insert(node.module, *node_data);
Expand Down
3 changes: 1 addition & 2 deletions crates/next-api/src/server_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use next_core::{
},
util::NextRuntime,
};
use rustc_hash::FxHashMap;
use swc_core::{
atoms::Atom,
common::comments::Comments,
Expand Down Expand Up @@ -406,7 +405,7 @@ struct OptionActionMap(Option<ResolvedVc<ActionMap>>);
type LayerAndActions = (ActionLayer, ResolvedVc<ActionMap>);
/// A mapping of every module module containing Server Actions, mapping to its layer and actions.
#[turbo_tasks::value(transparent)]
pub struct AllModuleActions(FxHashMap<ResolvedVc<Box<dyn Module>>, LayerAndActions>);
pub struct AllModuleActions(FxIndexMap<ResolvedVc<Box<dyn Module>>, LayerAndActions>);

#[turbo_tasks::function]
pub async fn map_server_actions(graph: Vc<SingleModuleGraph>) -> Result<Vc<AllModuleActions>> {
Expand Down

0 comments on commit f939e0e

Please sign in to comment.