Skip to content

docs(module): document the rest of module.parser.javascript - #8394

Merged
alexander-akait merged 1 commit into
mainfrom
docs/schema-coverage
Sep 13, 2026
Merged

alexander-akait merged 1 commit into
mainfrom
docs/schema-coverage

Conversation

@alexander-akait

Copy link
Copy Markdown
Member

Summary

Result of auditing schemas/WebpackOptions.json against the configuration pages: I walked all 253 definitions, resolving $ref chains into 974 option paths, and checked each against every form the docs use — dotted headings, bare-name headings, table cells, config-example keys, type signatures and prose lists.

Coverage is good. All 38 top-level options are documented, and almost everything that looked missing turned out to be documented in a form a naive check misses: resolveLoader.* by reference ("identical to the resolve property set above"), externalsPresets.* in a table of bare names, snapshot.* and dotenv.* as subsections, splitChunks.max*Size in the split-chunks plugin page, stats.colors.* in a type signature, output.html.csp.nonce in a bullet list, lazyCompilation.backend in a TS block, importMeta.dirname in the prose listing the known keys.

The problem it did turn up is in module.mdx. Module Contexts introduces a config block with "Here are the available options with their defaults", and 11 of its 12 options are deprecated — each moved to module.parser.javascript under the same name — with only strictExportPresence carrying a warning. Meanwhile the replacements were themselves undocumented: 26 of the 49 JavascriptParserOptions had no heading.

So this PR:

  • rewrites Module Contexts to show the options under module.parser.javascript, with a warning mapping each deprecated module.* spelling to where it moved;
  • adds typescript, deferImport and sourceImport, each defaulting from the matching experiments option;
  • adds a table for the syntax toggles (amd, browserify, commonjs, harmony, import, node, requireContext, requireEnsure, requireInclude, requireJs, system).

The table states each default separately rather than implying a common one, because they differ and the asymmetry was documented nowhere: most are on unless set to false, but requireJs and system are off until set to true, and requireInclude warns that it is deprecated unless set explicitly. That is read from AMDPlugin, CommonJsPlugin, SystemPlugin, RequireJsStuffPlugin, RequireIncludePlugin and defaults.js, not inferred.

Heading-level coverage of JavascriptParserOptions goes from 23/49 to 48/49; the holdout is the deprecated strictExportPresence, which the deprecation note covers rather than giving it a section of its own.

What kind of change does this PR introduce?

docs

Did you add tests for your changes?

No — documentation only. Verified with prettier, eslint, markdownlint and npm run jest (25 suites / 99 tests / 23 snapshots); every anchor introduced 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. One related finding belongs in webpack itself rather than here: module.exprContextCritical is the only one of the twelve siblings whose schema description carries no Deprecated: marker, although module.parser.javascript.exprContextCritical exists and the other eleven are marked. I am opening that separately.

Use of AI

Claude Code was used to write the audit that produced this, and the documentation itself. The defaults and the toggle semantics were read out of webpack's plugin sources and defaults.js rather than assumed, and each candidate gap was hand-verified against the page before being treated as one — most were false positives.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Cb4AP4BntRzji5vSqhzYWT


Generated by Claude Code

An audit of schemas/WebpackOptions.json against the configuration pages found
26 of the 49 JavascriptParserOptions had no documentation, and that the
Module Contexts section taught the deprecated spelling of twelve of them.

Module Contexts now shows the options where they actually live, under
module.parser.javascript, and says that setting them on module directly is
deprecated and where each moved.

Adds typescript, deferImport and sourceImport, which default from the
matching experiments, and a table for the syntax toggles. The table states
each default rather than implying one: requireJs and system are off until
set to true, and requireInclude warns that it is deprecated unless set
explicitly - read from AMDPlugin, CommonJsPlugin, SystemPlugin,
RequireJsStuffPlugin, RequireIncludePlugin and defaults.js.
@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 11:36am UTC

Request Review

@alexander-akait
alexander-akait merged commit 8b6d420 into main Sep 13, 2026
12 checks passed
@alexander-akait
alexander-akait deleted the docs/schema-coverage branch September 13, 2026 12:01

This branch was successfully deployed

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