.tap() `before` parameter do not respects existing befores
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.9k
- Forks
- 390
- Avg merge
- 40m
- Merged PRs (30d)
- 3
Description
Hello. I have three plugins:
Adepends onBBdepends onCC
They tap some hook with same stage in the following order:
A, B, C
Then inside https://github.com/webpack/tapable/blob/9d647f86ddb2930c6e24950a1edd2778453e92a1/lib/Hook.js#L136 they got position incorrectly as:
B, A, C
It happens because current logic looks like:
- Adding
A, no taps, just add - Adding
B,Bhasbefore, soif (before.size > 0)allows to skipAand be inserted in the start oftaps(e.g. order now isB, A) - Adding
Cto the top, since it has nobeforerules
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/Hook.js around line 136, where tap ordering and the before parameter are processed. Reproduce the A/B/C dependency sequence described in the issue, then verify that adding taps with the same stage preserves the expected A, B, C order and add or update coverage for that case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100