Skip to content

Commit

Permalink
Ensure Asset public ids are assigned deterministically
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcompiles committed May 8, 2024
1 parent 1b53f91 commit 245611b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/core/src/BundleGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ export default class BundleGraph {
: null;
invariant(assetGraphRootNode != null && assetGraphRootNode.type === 'root');

for (let [nodeId, node] of assetGraph.nodes.entries()) {
assetGraph.dfsFast(nodeId => {
let node = assetGraph.getNode(nodeId);

if (node != null && node.type === 'asset') {
let {id: assetId} = node.value;
// Generate a new, short public id for this asset to use.
Expand All @@ -190,7 +192,7 @@ export default class BundleGraph {
} else if (node != null && node.type === 'asset_group') {
assetGroupIds.set(nodeId, assetGraph.getNodeIdsConnectedFrom(nodeId));
}
}
});

let walkVisited = new Set();
function walk(nodeId) {
Expand Down

0 comments on commit 245611b

Please sign in to comment.