docs(api): document the remaining parser and module factory hooks - #8399
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the hooks-versus-source comparison behind #8397 to the remaining hook pages.
NormalModuleFactorywas 12/14 andJavascriptParser46/59; both are now complete, asCompiler(33/33) andCompilation(91/91) already were.Adds
resolveInSchemeandprepareModuleTypeon the factory page, and the thirteen parser hooks with no entry:evaluateNewExpression,evaluateCallExpression,isPure,preStatementByType,blockPreStatementByType,varDeclarationUsing,pattern,assignMemberChain,memberChainOfCallMemberChain,callMemberChainOfCallMemberChain,expressionMemberChain,unhandledExpressionMemberChainandfinish. Each entry's type, arguments and@sincecome from the declaration, and what everyHookMapis keyed by was read from its call site rather than assumed — several dispatch throughcallHooksForInfo/_callHooksForName1rather than an inlinefor, 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.alternativesis a deprecated fake hook that forwards toalternativeRequestsand 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