Skip to content

docs(api): document the loader context request accessors and dependency getters - #8400

Merged
alexander-akait merged 1 commit into
mainfrom
docs/loader-context-request-accessors
Sep 13, 2026
Merged

alexander-akait merged 1 commit into
mainfrom
docs/loader-context-request-accessors

Conversation

@alexander-akait

Copy link
Copy Markdown
Member

Summary

Audited the Loader Interface page against webpack's own loader context — lib/loaders/LoaderRunner.js, NormalModule#_createLoaderContext, and declarations/LoaderContext.d.ts. Eight members of the public context had no entry on the page: currentRequest, previousRequest, remainingRequest, resourceFragment, getDependencies, getContextDependencies, getMissingDependencies and getLogger (the last was described in the Logging section but had no heading, so it was not linkable or listed in the sidebar). The request values documented here were read off a real build of the page's own /abc/loader1?xyz!loader2!./resource?rrr example rather than derived. The pitch examples also called their second parameter precedingRequest; webpack passes loaderContext.previousRequest there, so the examples now use that name.

What kind of change does this PR introduce?

docs

Did you add tests for your changes?

n/a — documentation only.

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 PR is the documentation.

Use of AI

AI was used. Claude Code read the loader context sources and the declared LoaderContext type to find undocumented members, verified every request value in this PR by running a probe loader in a real webpack build, and drafted the entries; I reviewed and edited the result before pushing.


Generated by Claude Code

…cy getters

The loader context exposes currentRequest, previousRequest, remainingRequest,
resourceFragment, getDependencies, getContextDependencies,
getMissingDependencies and getLogger, none of which had an entry on the
Loader Interface page. Also rename the pitch method's second parameter in the
examples to previousRequest, which is the name webpack passes it under.
@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 3:19pm UTC

Request Review

@alexander-akait
alexander-akait merged commit 3b1dc1a into main Sep 13, 2026
12 checks passed
@alexander-akait
alexander-akait deleted the docs/loader-context-request-accessors branch September 13, 2026 16:12

This branch was successfully deployed

1 active deployment
Preview — 2070013a 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