Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jeffrey-easyesi/webpack
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: jeffrey-easyesi/webpack
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix-findGraphRoots
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Feb 12, 2026

  1. Fix findGraphRoots order sensitivity

    Chunk names may be different between multiple webpack runs on the same
    source code. This can potentially happen even when using `chunkIds:
    "deterministic"`. The cause is a bug in `findGraphRoots` that makes it
    return different results for the same graph with different orderings.
    
    ```js
    > const g1 = {"A":["C","B"], "B":["C"], "C":["A"]}
    > const g2 = {"A":["B","C"], "B":["C"], "C":["A"]}
    > require("webpack/lib/util/findGraphRoots")(Object.keys(g1), m => g1[m])
    [ 'C' ]
    > require("webpack/lib/util/findGraphRoots")(Object.keys(g2), m => g2[m])
    [ 'C', 'A' ]
    ```
    
    With `g1`, `findGraphRoots`'s reverse-order DFS goes A->B->C->A and puts
    all 3 nodes in a {A,B,C} cycle. C has the most inward edges (2) and is
    returned.
    
    But with `g2`, it goes A->C->A first, finding an {A,C} cycle. By the
    time it finds the A->B->C path, C is already marked "done", so B is
    never added to the cycle! A and C both have just one inward edge within
    the {A,C} subgraph, and both are returned.
    
    This commit fixes the bug by making markers a property of a cycle, not
    of a single node, so we can tell if a cycle is in progress. (Every node
    is now considered part of a cycle, even if it's just a cycle of 1.)
    jeffrey-easyesi committed Feb 12, 2026
    Configuration menu
    Copy the full SHA
    6ce2c44 View commit details
    Browse the repository at this point in the history
Loading