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 a786b43
Browse filesBrowse the repository at this point in the historyBrowse files
test(javascript): hold the printer and the parser's trees to the invariants sweep (#22648)
* fix(javascript): print what the printer reads back the same
- Keep the parentheses an `import()`'s arguments and callee need, which
terser drops: `import(a, (b, c))` gained an argument and
`new (import(a))` stopped parsing.
- Print a directive spelled with escapes as spelled. Encoding its text
as a value doubled each backslash at every print, so `"a\\b"` became
another string.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011CuRTB8fAv8PE7di49qDL4
* test(javascript): hold the printer and the parser's trees to the invariants sweep
`compare-js-tools.js --invariants` now asks of the JavaScript printer what
the CSS and HTML sweeps ask of theirs, over every fixture, acorn's corpus
and the installed bundles:
- idempotence under a build's default, a second compress pass, the
printer alone and `beautify`, the output read back print-only;
- respelling: a string's delimiter, a decimal integer as hex and an
identifier escape must not move the output;
- `acorn`: every fixture's tree equals acorn's, positions included.
The tree comparator moves from `test/helpers/compareParserOutput.js` into
the script, which the parser suites now import it from. The printer gains
terser's `minify_sync` as `modules.minifySync`, so the sweep stays
synchronous like the CSS and HTML ones.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011CuRTB8fAv8PE7di49qDL4
* fix(javascript): keep the line break after a comment whose code the minifier drops
A kept comment moved off a dropped `;` or declaration lost the line break
after it, so a license banner printed `*/(function(){` where terser prints
`*/\n(function(){`, and printing the output again added the break back.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011CuRTB8fAv8PE7di49qDL4
* fix(javascript): spell an escaped directive safe for an inline script
- A directive printed as spelled skipped the escaping `inline_script`
gives every other string, so `"x\x20</script>"` could end the script
element it sits in; it now gets the same `<\/script`, `\x3c!--` and
`--\x3e`, each reading as what it replaces.
- The JavaScript sweep asks only for the expectations a narrowed run can
reach: a fixture or preset left out no longer reads as stale.
- Say the parser's relations parse under a build's options, and drop the
`EXPECTED_ANY` the test option objects did not need.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011CuRTB8fAv8PE7di49qDL4
* fix(javascript): print from a SyntaxTree the directives, import() parentheses and dropped comments printEstree prints
The tree printer main gained in #22643 now spells an escaped directive as
written (inline-script safe), parenthesizes an import() under new or around a
sequence, and keeps the comments of an empty statement it drops.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011CuRTB8fAv8PE7di49qDL4
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: docs/architecture.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ This is the canonical repository map. **When you add, rename or remove a top-lev
60
60
-`tooling/` — repo-internal scripts:
61
61
- Codegen run by `yarn fix:special`: runtime/wasm generators, the hash-debug tool, `generate-schemas.js` — which derives each schema from the module declaring its options and reports what no longer derives — `precompile-schemas.js`, which compiles each schema into the standalone validator webpack validates with, and `generate-types.js`, which prints `types.d.ts` from the types the sources under `lib/` declare. Each names its own stale outputs.
62
62
-`check-agents-md-size.js` / `check-class-names.js` (`yarn lint:agents` / `lint:class-names`, both inside `yarn lint`) — the two invariants nothing else enforces: AGENTS.md's character budget, and that no two classes under `lib/` share a name, since a collision makes `generate-types.js` invent one for the published `types.d.ts`.
63
-
-`compare-css-tools.js` / `compare-html-tools.js` / `compare-js-tools.js` (`yarn benchmark:css-tools` / `:html-tools` / `:js-tools`) and the invariants gate every PR runs (`yarn test:invariants`) — how to read the tables, the pinned corpora and the five relations: [tooling/COMPARE_TOOLS.md](../tooling/COMPARE_TOOLS.md). Read it before claiming anything about webpack's CSS/HTML/JS implementation vs the ecosystem, or when `invariants` is red.
63
+
-`compare-css-tools.js` / `compare-html-tools.js` / `compare-js-tools.js` (`yarn benchmark:css-tools` / `:html-tools` / `:js-tools`) and the invariants gate every PR runs (`yarn test:invariants`) — how to read the tables, the pinned corpora and the invariant relations: [tooling/COMPARE_TOOLS.md](../tooling/COMPARE_TOOLS.md). Read it before claiming anything about webpack's CSS/HTML/JS implementation vs the ecosystem, or when `invariants` is red.
64
64
-`type-coverage.js` (`yarn types:cover`) — how much of `lib/` is precisely typed.
65
65
-`find-deep-webpack-imports.js` (`yarn find-deep-imports`) — which `webpack/lib/…` paths published packages import directly; `--check` (offline, run by the `Deep Imports` job) reads `tooling/deep-webpack-imports.json`. How it collects, and its `removed` map: [tooling/DEEP_IMPORTS.md](../tooling/DEEP_IMPORTS.md).
66
66
-`measure-color-agreement.js` (`yarn measure:color-agreement`) — asks a real browser for its own color conversions (not pixels) and prints how far webpack's sit from them; it is the source of the rounding margins in `lib/css/syntax-parser.js` and the list of spaces an engine reads through another transfer. Re-run it (seconds; `PUPPETEER_EXECUTABLE_PATH` picks the binary) rather than adjusting either by hand.
0 commit comments