You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2d76874
Browse filesBrowse the repository at this point in the historyBrowse files
feat: align the public exports with the lib/ directory structure (#22261)
* feat: export the asset, json, bun, deno and TypeScript plugins
Four of six per-module-type plugins were on the public API (css, html,
javascript, wasm) and two were not, and the node and electron target
presets were exported while bun and deno were not. Each gets the
namespace its directory already implies.
TypeScriptPlugin goes under experiments, beside schemes and ids, because
experiments.typescript is what gates it.
* feat: expose CssLoadingRuntimeModule under css, deprecate it under web
It is the one member of the web scope whose file is not in lib/web/.
The old path stays and now carries @deprecated.
Making that tag reach types.d.ts needed the generator: a namespace's
exports are emitted as one joined `export { … }`, which has nowhere to
put a comment. The doc now rides the specifier inside the braces, which
is the placement TypeScript reads a deprecation from — it ignores one
written on the export statement itself.
That surfaced a stale JSDoc block in InnerGraph, left behind when
getDependencyUsedByExportsCondition lost its third parameter, which the
checker was attaching to the topLevelSymbolTag export.
* feat: move eleven loose exports under their scope, deprecate the flat names
Cache, PlatformPlugin, WebpackOptionsApply, defineConfig, validateSchema,
ConcatenationScope, OptimizationStages, RuntimeGlobals, RuntimeModule,
AutomaticPrefetchPlugin and PrefetchPlugin each sat at the top level
while their directory already had a scope. Both paths resolve to the
same object; the flat one now carries @deprecated.
Two more generator branches were dropping the tag: a namespace member
that is not a class is emitted as `export const`, and one that is itself
a namespace as its own declaration, and neither prepended the comment.
All three branches now share one rule — a doc is emitted only when it
carries a tag a consumer acts on (@SInCE, @deprecated, @experimental),
since these positions have no line of their own and a description would
render as one very long one. That list is now stated once.
* feat(config): keep defineConfig at the top level undeprecated
Every config file calls it, so a scope would put three names in front of
each one. It is exposed under config as well, and both resolve to the
same function.
* feat(util): export RequestShortener
The root shim told plugin authors to migrate to
compiler.webpack.RequestShortener, which no export answered — the class
is in lib/util/, so util is the scope, and the shim now names it.
* test: cover the scoped exports and their kept aliases
Every getter this pull request adds is a line only a property read
executes, and nothing in configCases reads one, so the patch went in at
0% covered. The test asserts each scope resolves and that each kept flat
name is the same object as its scoped path, which is the contract rather
than the percentage.
Also shortens the changeset: a combined entry may run past 80 characters
slightly, and 183 is not slightly.
Copy file name to clipboardExpand all lines: lib/RequestShortener.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,5 +6,5 @@
6
6
"use strict";
7
7
8
8
// TODO in the next major release: remove
9
-
// Some old plugins use `require("webpack/lib/RequestShortener")`, in the next major release developer should migrate to `compiler.webpack.RequestShortener`
9
+
// Some old plugins use `require("webpack/lib/RequestShortener")`, in the next major release developer should migrate to `compiler.webpack.util.RequestShortener`
0 commit comments