Skip to content

docs(api): document the remaining parser and module factory hooks - #8399

Merged
alexander-akait merged 1 commit into
mainfrom
docs/parser-and-factory-hooks
Sep 13, 2026
Merged

alexander-akait merged 1 commit into
mainfrom
docs/parser-and-factory-hooks

Conversation

@alexander-akait

Copy link
Copy Markdown
Member

Summary

Extends the hooks-versus-source comparison behind #8397 to the remaining hook pages. NormalModuleFactory was 12/14 and JavascriptParser 46/59; both are now complete, as Compiler (33/33) and Compilation (91/91) already were.

Adds resolveInScheme and prepareModuleType on the factory page, and the thirteen parser hooks with no entry: evaluateNewExpression, evaluateCallExpression, isPure, preStatementByType, blockPreStatementByType, varDeclarationUsing, pattern, assignMemberChain, memberChainOfCallMemberChain, callMemberChainOfCallMemberChain, expressionMemberChain, unhandledExpressionMemberChain and finish. Each entry's type, arguments and @since come from the declaration, and what every HookMap is keyed by was read from its call site rather than assumed — several dispatch through callHooksForInfo/_callHooksForName1 rather than an inline for, so the key is the root of the member chain or the declared name rather than the node.

One candidate was deliberately left out: ContextModuleFactory.hooks.alternatives is a deprecated fake hook that forwards to alternativeRequests and warns you to use that instead, which the page already documents.

What kind of change does this PR introduce?

docs

Did you add tests for your changes?

No — documentation only; prettier, markdownlint, eslint and the jest suite (25 suites / 99 tests) pass, and every cross-link anchor added was checked against the headings it points at.

Does this PR introduce a breaking change?

No.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

n/a — this is the documentation.

Use of AI

Claude Code was used to run the hooks-versus-source comparison, to read each hook's declaration and call site for its signature and map key, and to write the entries.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Cb4AP4BntRzji5vSqhzYWT


Generated by Claude Code

Extending the hooks-versus-source comparison past Compiler and Compilation:
NormalModuleFactory was 12/14 and JavascriptParser 46/59. Adds the two
factory hooks (resolveInScheme, prepareModuleType) and the thirteen parser
hooks that had no entry, so every hook those classes define is documented.
@vercel

vercel Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
webpack-js-org Ready Ready Preview Sep 13, 2026 2:55pm UTC

Request Review

@alexander-akait
alexander-akait merged commit d689f00 into main Sep 13, 2026
12 checks passed
@alexander-akait
alexander-akait deleted the docs/parser-and-factory-hooks branch September 13, 2026 15:11

This branch was successfully deployed

1 active deployment
Preview — 485198d8 Deployed Sep 13, 2026 by vercel[bot]
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.

1 participant