berry icon indicating copy to clipboard operation
berry copied to clipboard

refactor!: update hooks to accept objects

Open jdanil opened this issue 3 years ago • 1 comments

What's the problem this PR addresses?

Addresses one of the checklist items listed for Yarn 4 in #3591.

How did you fix it?

Updated all hooks and their interfaces to replace positional parameters with an object.

Updated all the hooks in 1815afdc22e53621e402c6e5e463a21222be4ebd. Removed unused attributes in 56703af6f54e71b5cd035c25526289cd0b7d9c84.

Checklist

  • [x] I have read the Contributing Guide.
  • [x] I have set the packages that need to be released for my changes to be effective.
  • [x] I will check that all automated PR checks pass before the PR gets reviewed.

jdanil avatar Jun 05 '22 08:06 jdanil

I believe there is one remaining issue, and that is with reduceHook (in packages/yarnpkg-core/sources/Configuration.ts) which was previously using the first parameter of hooks as an initial value and passing each result into the next invocation of the hook. I haven't found a neat solution to handle this yet.

jdanil avatar Jun 06 '22 11:06 jdanil