GeezerVison is showing github.com — test(html): cover the tag shapes a {% template writes by alexander-akait · Pull Request #22183 · webpack/webpack
Conversation
alexander-akait
commented
Sep 18, 2026
•
edited by coderabbitai
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Since #22166 a tag holding template syntax is rebuilt rather than echoed, but the suite drove one spelling of one block. It now drives the tight and the whitespace-control spellings Jinja, Nunjucks, Liquid and Twig admit, a {% for %} over a list, two blocks in one tag, and an attribute inside a block being minified rather than copied. A block written against the element name is covered as the pitfall it is: a tag name runs to the first ASCII whitespace, so <span{% names an element nothing closes. Refs #22013.
What kind of change does this PR introduce?
test
Did you add tests for your changes?
Yes — that is the whole change: test/unitCases/HtmlSyntax.unittest.js and three lines in the test/configCases/html/minimize-attributes fixture, so a real build covers them under both ConfigTestCases and ConfigCacheTestCases.
Does this PR introduce a breaking change?
No — no lib/ code changes, and the only snapshot movement is the three added fixture lines.
If relevant, what needs to be documented once your changes are merged or what have you already documented?
n/a
Use of AI
AI was used, under review: it derived every expected string by running the minifier rather than writing it from memory, drafted the cases, and ran the HTML unit suite and the html config cases under both suites.
🤖 Generated with Claude Code
https://claude.ai/code/session_018tNx7sU4SbnKFhFeofDVr5
Generated by Claude Code
Summary by CodeRabbit
- Tests
- Added coverage for minimizing conditional HTML attributes, including
checked, generated data attributes, and required attributes with whitespace-controlled template syntax.
- Added tests confirming preservation of Jinja-, Nunjucks-, Liquid-, and Twig-style template blocks during HTML minification.
- Expanded validation for attribute minimization around template blocks and for distinguishing blocks adjacent to tag names from space-separated blocks.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The suite drove one spelling of one block. It drives the tight and the
whitespace-control ones too now, a `{% for %}` over a list, two blocks in
one tag, and what the block wraps being minified rather than echoed.
A block written against the element name is covered as the pitfall it is:
a tag name runs to the first whitespace, so `<span{%` names an element
nothing closes.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Sep 18, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
 
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID: b603088d-a487-4459-977d-167e194dd7d7
📥 Commits
Reviewing files that changed from the base of the PR and between 2543f96 and b095dc3.
⛔ Files ignored due to path filters (2)
test/configCases/html/minimize-attributes/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
test/configCases/html/minimize-attributes/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
📒 Files selected for processing (2)
test/configCases/html/minimize-attributes/page.html
test/unitCases/HtmlSyntax.unittest.js
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
📝 Walkthrough
Walkthrough
The change adds HTML minimization fixtures and unit tests for conditional attributes, template block preservation, surrounding attribute minification, and delimiter placement next to element names.
Changes
HTML template coverage
| Layer / File(s) |
Summary |
Conditional attribute fixtures test/configCases/html/minimize-attributes/page.html |
Adds minimization cases for conditional checked, loop-generated data-x, and whitespace-trimmed conditional attributes. |
Template block syntax tests test/unitCases/HtmlSyntax.unittest.js |
Adds tests for template block preservation, minification of surrounding attributes, and tight versus spaced delimiter placement. |
Priority: ⬇️ Low
Change: Other
Merge Risk: ⚪ Minimal · up to ea499
The added coverage does not introduce an identified merge risk.
🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 inconclusive)
| Check name |
Status |
Explanation |
Resolution |
| Title check |
❓ Inconclusive |
The title uses the required Conventional Commit form, test(html): subject, and accurately describes the added HTML template syntax tests. The branch prefix is not provided, so the type match cannot … |
Provide the branch name or branch prefix. Confirm that the branch prefix is test; otherwise update the title type to match the branch prefix. |
✅ Passed checks (3 passed)
| Check name |
Status |
Explanation |
| Description Check |
✅ Passed |
Check skipped - CodeRabbit’s high-level summary is enabled. |
| Linked Issues check |
✅ Passed |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
✅ Passed |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
Explanation
The title uses the required Conventional Commit form, test(html): subject, and accurately describes the added HTML template syntax tests. The branch prefix is not provided, so the type match cannot be verified.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
This PR is packaged and the instant preview is available (1d75746).
Install it locally:
npm i -D webpack@https://pkg.pr.new/webpack@1d75746
yarn add -D webpack@https://pkg.pr.new/webpack@1d75746
pnpm add -D webpack@https://pkg.pr.new/webpack@1d75746
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
codecov
Bot
commented
Sep 18, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.92%. Comparing base (2543f96) to head (ea499ed).
⚠️ Report is 6 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #22183 +/- ##
==========================================
- Coverage 94.93% 94.92% -0.01%
==========================================
Files 733 733
Lines 104099 104099
Branches 32089 32089
==========================================
- Hits 98822 98821 -1
- Misses 5277 5278 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.
🚀 New features to boost your workflow:
- ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Generated code size
Comparing base (2543f96) to head (ea499ed). Merging this pull request will not change the code webpack generates.
| What moved |
Tests |
Assets |
Gzip |
Raw |
Test edit |
| Changed, test untouched |
0 |
0 |
— |
— |
— |
| Changed, test edited |
0 |
0 |
— |
— |
— |
| New |
0 |
0 |
— |
— |
— |
| Deleted |
0 |
0 |
— |
— |
— |
| Unchanged |
— |
7727 |
— |
— |
— |
Read Changed, test untouched first: the test is byte-identical on both sides, so webpack generated the difference. Changed, test edited moved partly because the test did — Test edit is how many bytes the test gained, and a bundle that grew by less is not a regression. New and Deleted are whole files, not deltas, so adding tests cannot bury a real change. Gzip decides, because that is what users download; raw is the tiebreak, and brotli and zstd are per asset below.
No asset changed size.
No runtime gained or lost a runtime module.
Built test/configCases with the defaults a user gets: 2184 test(s), 7727 asset(s), 87 emitted nothing.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The `{% if %}` lines around a `checked="checked"` print a tag whose bare name
fuses with the template, which is a defect in the printer rather than a case
this branch can state. They move to the change that fixes it.
codspeed
Bot
commented
Sep 18, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Merging this PR will degrade performance by 18.68%
⚠️ Different runtime environments detected
Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.
Open the report in CodSpeed to investigate
⚡ 2 improved benchmarks
❌ 2 regressed benchmarks
✅ 390 untouched benchmarks
⏩ 6 skipped benchmarks1
Performance Changes
|
Mode |
Benchmark |
BASE |
HEAD |
Efficiency |
| ❌ |
Memory |
benchmark "many-chunks-commonjs", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
192.3 KB |
541.1 KB |
-64.46% |
| ❌ |
Memory |
benchmark "import-meta-glob", scenario '{"name":"mode-development-rebuild","mode":"development","watch":true}' |
685.8 KB |
1,001.1 KB |
-31.49% |
| ⚡ |
Memory |
benchmark "asset-modules-source", scenario '{"name":"mode-production","mode":"production"}' |
8.4 MB |
6.2 MB |
+34.86% |
| ⚡ |
Simulation |
benchmark "wasm-modules-sync", scenario '{"name":"mode-development","mode":"development"}' |
1,107.5 ms |
831.5 ms |
+33.2% |
Tip Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing test/html-template-attribute-cases (ea499ed) with main (2543f96)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Types CoverageCoverage after merging test/html-template-attribute-cases into main will be
Coverage Report| File | Stmts | Branches | Funcs | Lines | Uncovered Lines |
|---|
| bin | | webpack.js | 98.82% | 100% | 100% | 98.82% | 103 | | examples | | build-common.js | 100% | 100% | 100% | 100% | | | buildAll.js | 100% | 100% | 100% | 100% | | | examples.js | 100% | 100% | 100% | 100% | | | template-common.js | 98.21% | 100% | 100% | 98.21% | 72 | | examples/custom-javascript-parser | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/custom-javascript-parser/internals | | acorn-parse.js | 100% | 100% | 100% | 100% | | | meriyah-parse.js | 100% | 100% | 100% | 100% | | | oxc-parse.js | 100% | 100% | 100% | 100% | | | examples/markdown | | webpack.config.mjs | 100% | 100% | 100% | 100% | | | examples/module-federation | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/reexport-components | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/typescript | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/typescript-non-erasable | | test.filter.js | 50% | 100% | 100% | 50% | 5 | | examples/virtual-modules | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/wasm-bindgen-esm | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/wasm-complex | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/wasm-emscripten | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/wasm-simple | | test.filter.js | 100% | 100% | 100% | 100% | | | examples/wasm-simple-source-phase | | test.filter.js | 100% | 100% | 100% | 100% | | | lib | | APIPlugin.js | 100% | 100% | 100% | 100% | | | AsyncDependenciesBlock.js | 100% | 100% | 100% | 100% | | | AutomaticPrefetchPlugin.js | 93.94% | 100% | 100% | 93.94% | 59, 62 | | BannerPlugin.js | 100% | 100% | 100% | 100% | | | Cache.js | 96.49% | 100% | 100% | 96.49% | 10, 104 | | CacheFacade.js | 100% | 100% | 100% | 100% | | | Chunk.js | 99.72% | 100% | 100% | 99.72% | 42 | | ChunkGraph.js | 100% | 100% | 100% | 100% | | | ChunkGroup.js | 100% | 100% | 100% | 100% | | | ChunkTemplate.js | 100% | 100% | 100% | 100% | | | CircularModulesPlugin.js | 99.50% | 100% | 100% | 99.50% | 289 | | CleanPlugin.js | 97.81% | 100% | 100% | 97.81% | 111, 125, 128, 212, 232 | | CodeGenerationResults.js | 100% | 100% | 100% | 100% | | | CompatibilityPlugin.js | 100% | 100% | 100% | 100% | | | Compilation.js | 98.59% | 100% | 100% | 98.59% | 1760, 2081, 2088, 2096, 2118, 2121, 3057, 3536–3537, 3569, 4158, 4162, 4261, 4282, 4407, 4444, 4451, 4504–4505, 4509, 4514, 4530–4531, 4545–4546, 4551–4552, 46, 5075, 5101, 5927, 5944, 5962, 5978, 5993, 6018, 6021, 6389, 6392–6393, 6398, 6413, 6496, 6520, 6634, 840–841 | | Compiler.js | 98.81% | 100% | 100% | 98.81% | 1116, 1153, 1156, 1336–1337, 1345, 848, 934, 975 | | ConcatenationScope.js | 99.10% | 100% | 100% | 99.10% | 293 | | ConditionalInitFragment.js | 100% | 100% | 100% | 100% | | | ConstPlugin.js | 100% | 100% | 100% | 100% | | | CopyPlugin.js | 99.79% | 100% | 100% | 99.79% | 160 | | DefinePlugin.js | 99.14% | 100% | 100% | 99.14% | 1127, 200–201, 217, 236, 310 | | DependenciesBlock.js | 100% | 100% | 100% | 100% | | | Dependency.js | 98.54% | 100% | 100% | 98.54% | 498, 545 | | DependencyTemplate.js | 100% | 100% | 100% | 100% | | | DependencyTemplates.js | 100% | 100% | 100% | 100% | | | DotenvPlugin.js | 98.07% | 100% | 100% | 98.07% | 391, 439, 452–453 | | DynamicEntryPlugin.js | 100% | 100% | 100% | 100% | | | EntryOptionPlugin.js | 100% | 100% | 100% | 100% | | | EntryPlugin.js | 100% | 100% | 100% | 100% | | | Entrypoint.js | 100% | 100% | 100% | 100% | | | EnvironmentPlugin.js | 97.14% | 100% | 100% | 97.14% | 49 | | ErrorHelpers.js | 98.85% | 100% | 100% | 98.85% | 138 | | EvalDevToolModulePlugin.js | 100% | 100% | 100% | 100% | | | EvalSourceMapDevToolPlugin.js | 100% | 100% | 100% | 100% | | | ExportsInfo.js | 99.26% | 100% | 100% | 99.26% | 415, 431, 763, 860, 878, 922, 927 | | ExportsInfoApiPlugin.js | 100% | 100% | 100% | 100% | | | ExternalModule.js | 98.78% | 100% | 100% | 98.78% | 1361, 1364, 595–599, 601, 766 | | ExternalModuleFactoryPlugin.js | 100% | 100% | 100% | 100% | | | ExternalsPlugin.js | 100% | 100% | 100% | 100% | | | FileSystemInfo.js | 99.75% | 100% | 100% | 99.75% | 187, 285, 3947, 3962, 3986, 3989 | | FlagAllModulesAsUsedPlugin.js | 100% | 100% | 100% | 100% | | | FlagDependencyExportsPlugin.js | 95.64% | 100% | 100% | 95.64% | 119, 130, 146, 166, 170, 50, 52, 528, 533, 54, 540, 555, 558, 57 | | FlagDependencyUsagePlugin.js | 100% | 100% | 100% | 100% | | | FlagEntryExportAsUsedPlugin.js | 100% | 100% | 100% | 100% | | | Generator.js | 100% | 100% | 100% | 100% | | | HotModuleReplacementPlugin.js | 100% | 100% | 100% | 100% | | | HotUpdateChunk.js | 100% | 100% | 100% | 100% | | | IgnorePlugin.js | 100% | 100% | 100% | 100% | | | IgnoreWarningsPlugin.js | 100% | 100% | 100% | 100% | | | InitFragment.js | 100% | 100% | 100% | 100% | | | JavascriptMetaInfoPlugin.js | 100% | 100% | 100% | 100% | | | LazyBarrel.js | 100% | 100% | 100% | 100% | | | LibraryTemplatePlugin.js | 100% | 100% | 100% | 100% | | | LoaderOptionsPlugin.js | 100% | 100% | 100% | 100% | | | LoaderTargetPlugin.js | 100% | 100% | 100% | 100% | | | MainTemplate.js | 100% | 100% | 100% | 100% | | | ManifestPlugin.js | 100% | 100% | 100% | 100% | | | Module.js | 98.50% | 100% | 100% | 98.50% | 1327, 1332, 1391, 1405, 1467, 1476 | | ModuleFactory.js | 100% | 100% | 100% | 100% | | | ModuleFilenameHelpers.js | 98.90% | 100% | 100% | 98.90% | 111, 113 | | ModuleGraph.js | 99.78% | 100% | 100% | 99.78% | 1177 | | ModuleGraphConnection.js | 100% | 100% | 100% | 100% | | | ModuleInfoHeaderPlugin.js | 100% | 100% | 100% | 100% | | | ModuleNotFoundError.js | 100% | 100% | 100% | 100% | | | ModuleProfile.js | 100% | 100% | 100% | 100% | | | ModuleSourceTypeConstants.js | 100% | 100% | 100% | 100% | | | ModuleTemplate.js | 100% | 100% | 100% | 100% | | | ModuleTypeConstants.js | 100% | 100% | 100% | 100% | | | MultiCompiler.js | 98.88% | 100% | 100% | 98.88% | 460, 532, 719, 784 | | MultiStats.js | 100% | 100% | 100% | 100% | | | MultiWatching.js | 93.75% | 100% | 100% | 93.75% | 37, 71 | | NoEmitOnErrorsPlugin.js | 100% | 100% | 100% | 100% | | | NodeStuffPlugin.js | 100% | 100% | 100% | 100% | | | NormalModule.js | 98% | 100% | 100% | 98% | 1103, 1106, 1125, 1142, 1400, 1434, 1450, 1588, 1911, 2211, 2216–2224, 2226, 30 | | NormalModuleFactory.js | 98.01% | 100% | 100% | 98.01% | 1341, 1644, 1661, 1670, 1674, 1702, 1709, 1713, 1718, 1730, 1741, 1790, 1801, 1811, 1862–1864, 1871, 732, 744 | | NormalModuleReplacementPlugin.js | 100% | 100% | 100% | 100% | | | NullFactory.js | 100% | 100% | 100% | 100% | | | OptimizationStages.js | 100% | 100% | 100% | 100% | | | OptionsApply.js | 100% | 100% | 100% | 100% | | | Parser.js | 100% | 100% | 100% | 100% | | | PlatformPlugin.js | 100% | 100% | 100% | 100% | | | PrefetchPlugin.js | 100% | 100% | 100% | 100% | | | ProgressPlugin.js | 99.80% | 100% | 100% | 99.80% | 694 | | ProvidePlugin.js | 100% | 100% | 100% | 100% | | | RawModule.js | 100% | 100% | 100% | 100% | | | RecordIdsPlugin.js | 100% | 100% | 100% | 100% | | | RequestShortener.js | 100% | 100% | 100% | 100% | | | ResolverFactory.js | 100% | 100% | 100% | 100% | | | RuntimeGlobals.js | 100% | 100% | 100% | 100% | | | RuntimeModule.js | 100% | 100% | 100% | 100% | | | RuntimePlugin.js | 95.53% | 100% | 100% | 95.53% | 317, 403, 412, 415, 428–429, 443, 461, 482–483, 506, 526–527, 563–564, 587, 600–601, 673, 686, 707, 726 | | RuntimeTemplate.js | 99.66% | 100% | 100% | 99.66% | 352, 3744, 4579, 4591, 4596, 4598, 4603 | | SelfModuleFactory.js | 100% | 100% | 100% | 100% | | | SingleEntryPlugin.js | 100% | 100% | 100% | 100% | | | SourceMapDevToolModuleOptionsPlugin.js | 100% | 100% | 100% | 100% | | | SourceMapDevToolPlugin.js | 97.25% | 100% | 100% | 97.25% | 227, 231, 233, 408, 416, 445, 536, 539–540, 849, 870, 873 | | Stats.js | 100% | 100% | 100% | 100% | | | Template.js | 100% | 100% | 100% | 100% | | | TemplatedPathPlugin.js | 99.48% | 100% | 100% | 99.48% | 365–366 | | UseStrictPlugin.js | 100% | 100% | 100% | 100% | | | WarnCaseSensitiveModulesPlugin.js | 100% | 100% | 100% | 100% | | | WarnDeprecatedOptionPlugin.js | 100% | 100% | 100% | 100% | | | WarnNoModeSetPlugin.js | 100% | 100% | 100% | 100% | | | WatchIgnorePlugin.js | 100% | 100% | 100% | 100% | | | Watching.js | 100% | 100% | 100% | 100% | | | WebpackError.js | 100% | 100% | 100% | 100% | | | WebpackIsIncludedPlugin.js | 100% | 100% | 100% | 100% | | | WebpackOptionsApply.js | 100% | 100% | 100% | 100% | | | WebpackOptionsDefaulter.js | 100% | 100% | 100% | 100% | | | buildChunkGraph.js | 99.87% | 100% | 100% | 99.87% | 375 | | cli.js | 98.63% | 100% | 100% | 98.63% | 10, 117, 547, 579, 629, 903 | | index.js | 99.73% | 100% | 100% | 99.73% | 184 | | validateSchema.js | 94.67% | 100% | 100% | 94.67% | 100, 87, 89, 98 | | webpack.js | 97.12% | 100% | 100% | 97.12% | 10, 274, 296, 298 | | lib/asset | | AssetBytesGenerator.js | 100% | 100% | 100% | 100% | | | AssetBytesParser.js | 100% | 100% | 100% | 100% | | | AssetGenerator.js | 100% | 100% | 100% | 100% | | | AssetModule.js | 100% | 100% | 100% | 100% | | | AssetModulesPlugin.js | 98.15% | 100% | 100% | 98.15% | 338, 362, 365, 495, 57, 62 | | AssetParser.js | 100% | 100% | 100% | 100% | | | AssetSourceGenerator.js | 100% | 100% | 100% | 100% | | | AssetSourceParser.js | 100% | 100% | 100% | 100% | | | RawDataUrlModule.js | 100% | 100% | 100% | 100% | | | WebManifestGenerator.js | 100% | 100% | 100% | 100% | | | WebManifestParser.js | 100% | 100% | 100% | 100% | | | lib/async-modules | | AsyncModuleHelpers.js | 100% | 100% | 100% | 100% | | | AwaitDependenciesInitFragment.js | 100% | 100% | 100% | 100% | | | InferAsyncModulesPlugin.js | 100% | 100% | 100% | 100% | | | isGeneratorLowered.js | 100% | 100% | 100% | 100% | | | lib/bun | | BunTargetPlugin.js | 100% | 100% | 100% | 100% | | | lib/cache | | AddBuildDependenciesPlugin.js | 100% | 100% | 100% | 100% | | | AddManagedPathsPlugin.js | 100% | 100% | 100% | 100% | | | IdleFileCachePlugin.js | 97.92% | 100% | 100% | 97.92% | 75, 87, |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|