Skip to content

docs: document resolver hooks and their pipeline workflow#541

Merged
alexander-akait merged 5 commits intomainfrom
claude/document-hook-workflow-fixes-gbkwo
Apr 21, 2026
Merged

docs: document resolver hooks and their pipeline workflow#541
alexander-akait merged 5 commits intomainfrom
claude/document-hook-workflow-fixes-gbkwo

Conversation

@alexander-akait
Copy link
Copy Markdown
Member

Summary

  • Adds a new Hooks subsection to the README, covering the four lifecycle hooks on resolver.hooks (resolveStep, noResolve, resolve, result) and every pipeline hook in the order the default pipeline visits them.
  • Explains ensureHook / getHook semantics, the AsyncSeriesBailHook callback contract (callback() / callback(err) / callback(null, request)), and the before- / after- stage modifiers used inside ResolverFactory.
  • Adds three short, runnable examples: tracing every step via the lifecycle hooks, short-circuiting at the file hook, and a cross-link to the existing MyLibSrcPlugin doResolve walkthrough.
  • Updates the final "Tips for writing your own plugin" bullet to point readers at the new section instead of restating a partial hook list.

The hook list and ordering were derived from lib/ResolverFactory.js (the //// pipeline //// section) and the KnownHooks typedef in lib/Resolver.js.

Test plan

  • Skim the new Hooks section in the rendered README to check table alignment and anchors.
  • Verify the three code snippets compile against the public API (resolver.hooks.resolveStep.tap, resolver.getHook("file").tapAsync, callback(null, request) short-circuit shape).
  • Confirm the cross-link from the Custom Plugin tips to #hooks resolves.

Adds a new Hooks section to the README that enumerates the lifecycle
hooks on resolver.hooks, every pipeline hook in execution order, the
before-/after- stage modifiers, and short examples showing tracing,
short-circuiting, and doResolve-based rewrites.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 20, 2026

⚠️ No Changeset found

Latest commit: 78ea2d8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 20, 2026

CLA Not Signed

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.46%. Comparing base (a5d029b) to head (78ea2d8).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #541   +/-   ##
=======================================
  Coverage   96.46%   96.46%           
=======================================
  Files          50       50           
  Lines        2687     2687           
  Branches      824      824           
=======================================
  Hits         2592     2592           
  Misses         80       80           
  Partials       15       15           
Flag Coverage Δ
integration 96.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 20, 2026

Merging this PR will not alter performance

✅ 67 untouched benchmarks


Comparing claude/document-hook-workflow-fixes-gbkwo (78ea2d8) with main (c1437c3)

Open in CodSpeed

claude and others added 4 commits April 20, 2026 15:56
Follow-up to the Hooks section: walks through the hook chain for a
relative path, bare module, internal import, alias hit, exports-field
match, and a failed resolve, so readers can see which hooks run for
which kind of request without having to trace ResolverFactory.js.
For each of the 29 built-in plugins, adds a one-line goal plus the
hook it taps and where it forwards — so readers of the Built-in
Plugins table can see how each plugin plugs into the hook pipeline.
@alexander-akait alexander-akait merged commit d1ee0fb into main Apr 21, 2026
33 of 34 checks passed
@alexander-akait alexander-akait deleted the claude/document-hook-workflow-fixes-gbkwo branch April 21, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants