Skip to content

Commit a7b7e8a

Browse files
authored
Ensure Asset public ids are assigned deterministically (#9706)
1 parent 1b53f91 commit a7b7e8a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/core/core/src/BundleGraph.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ export default class BundleGraph {
174174
: null;
175175
invariant(assetGraphRootNode != null && assetGraphRootNode.type === 'root');
176176

177-
for (let [nodeId, node] of assetGraph.nodes.entries()) {
177+
assetGraph.dfsFast(nodeId => {
178+
let node = assetGraph.getNode(nodeId);
179+
178180
if (node != null && node.type === 'asset') {
179181
let {id: assetId} = node.value;
180182
// Generate a new, short public id for this asset to use.
@@ -190,7 +192,7 @@ export default class BundleGraph {
190192
} else if (node != null && node.type === 'asset_group') {
191193
assetGroupIds.set(nodeId, assetGraph.getNodeIdsConnectedFrom(nodeId));
192194
}
193-
}
195+
});
194196

195197
let walkVisited = new Set();
196198
function walk(nodeId) {

0 commit comments

Comments
 (0)