Skip to content

feat(minify): inline more functions and values, merge imports and exports - #22909

Merged
alexander-akait merged 11 commits into
mainfrom
feat/minify-inline-gaps
Oct 26, 2026
Merged

alexander-akait merged 11 commits into
mainfrom
feat/minify-inline-gaps

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes more of the size gaps between webpack's JS minifier and swc/oxc. Every change is in the improve phase, which writes less than terser only where the program provably runs the same.

  • Values: a value is folded into a write to an outer name, into a property store on a let/const, and into a for…in/for…of object. A binding whose straight-line writes leave every read known is replaced by its value. A primitive is read straight off an object literal.
  • Functions: a function called in place runs at the top level when toplevel owns its vars. A literal argument is read in place of its parameter. A small function called from several places is copied into each call when its arguments are read in order.
  • Spelling: imports and export{…} lists of one module merge. function f(){}…export default f becomes export default function f(){}. A bare var moves into a later var. A number moves to the right of *, &, | and ^, as oxc and esbuild write it.
  • Fixes: a property read folded into a tagged template no longer binds the tag's this (now (0,a.b)```). A sequence on the right of a constant-left ||/&&/??` is no longer lifted out, which dropped code the operator would run.

Gap lists: swcSmaller.js −23/+1, oxcSmaller.js −16/+8. The added entries are 1–3 bytes of gzip noise from writing numbers last, or cases where oxc's output is wrong (this of a tag).

Before/after (compress: {}, mangle: false; raw/gzip bytes):

Input main This PR
(function(){ var e = g(); s = e; })() (inline: false) !function(){var e=g();s=e}() — 72/86 !function(){s=g()}() — 64/78
let a = 1; if (o) a = 2; else a = 2; a++; console.log(a); let a=1;a=2,console.log(++a) — 48/68 console.log(3) — 34/54
export { f as a }; export { b } from 'm'; export { c } from 'm'; export default f; (default options, module) function a(){return 1}export{a};export{b}from"m";export{c}from"m";export default a; — 83/78 export default function a(){return 1}export{a};export{b,c}from"m"; — 66/77

The 31 schemas/**/*.check.js validators are regenerated, since they are minified with this printer.

What kind of change does this PR introduce?

feat

Did you add tests for your changes?

Yes: test/unitCases/javascript/printer.unittest.js (what transforms and what must not), plus the gap lists and IMPROVED_YET_BIGGER in test/specCases/minify-corpora.spectest.js. The jsMinify fixture now uses value + 1, so its byte-for-byte comparison with terser tests the plugin rather than the improve phase.

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?

docs/syntax.md (the syntax-printer.js bullet) describes the new rewrites.

Use of AI

Claude Code wrote the changes and tests: four agents each triaged one family of gap-list entries, and the results were merged and checked with the printer unit tests, the corpus groups, the fuzz seeds and yarn lint.


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • JavaScript minification can simplify additional expressions, inline eligible function calls, and propagate known primitive and object-property values.
    • Eligible object methods can be called without a receiver, and safe argument values can be substituted at their reads.
    • Import and export declarations can be merged, including into existing export lists.
  • Bug Fixes
    • Minification preserves bindings and side effects when scope, evaluation order, or property access affects behavior.
  • Documentation
    • Updated the syntax guide to describe the expanded minification transformations.

@changeset-bot

changeset-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c587583

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added area: parser JavaScript parsing and dependency analysis (lib/javascript, lib/dependencies) area: config Options, defaults, validation (lib/config, schemas/) labels Oct 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR is packaged and the instant preview of its latest commit is available.

Install it locally:

  • npm
npm i -D webpack@https://pkg.pr.new/webpack@22909
  • yarn
yarn add -D webpack@https://pkg.pr.new/webpack@22909
  • pnpm
pnpm add -D webpack@https://pkg.pr.new/webpack@22909

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Types Coverage

Coverage after merging feat/minify-inline-gaps into main will be
99.27%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
bin
   webpack.js98.84%100%100%98.84%113
declarations
   WebpackOptions.ts99.94%100%100%99.94%4266
examples
   build-common.js100%100%100%100%
   buildAll.js100%100%100%100%
   examples.js100%100%100%100%
   template-common.js98.21%100%100%98.21%72
examples/custom-javascript-parser
   test.filter.js100%100%100%100%
examples/custom-javascript-parser/internals
   acorn-parse.js100%100%100%100%
   meriyah-parse.js100%100%100%100%
   oxc-parse.js100%100%100%100%
examples/markdown
   webpack.config.mjs100%100%100%100%
examples/module-federation
   test.filter.js100%100%100%100%
examples/reexport-components
   test.filter.js100%100%100%100%
examples/ssr
   test.filter.js100%100%100%100%
examples/typescript
   test.filter.js100%100%100%100%
examples/typescript-non-erasable
   test.filter.js50%100%100%50%5
examples/virtual-modules
   test.filter.js100%100%100%100%
examples/wasm-bindgen-esm
   test.filter.js100%100%100%100%
examples/wasm-complex
   test.filter.js100%100%100%100%
examples/wasm-emscripten
   test.filter.js100%100%100%100%
examples/wasm-simple
   test.filter.js100%100%100%100%
examples/wasm-simple-source-phase
   test.filter.js100%100%100%100%
lib
   Chunk.js100%100%100%100%
   Compilation.js98.74%100%100%98.74%1823, 2135, 2142, 2150, 2172, 2175, 3161, 3720, 3763, 4358, 4362, 4488, 4509, 4634, 4671, 4678, 4731–4732, 4736, 4741, 4757–4758, 4772–4773, 4778–4779, 5307, 5333, 6254, 6271, 6289, 6305, 6320, 6345, 6348, 6760, 6763–6764, 6769, 6784, 6867, 6891, 883–884
   Compiler.js98.81%100%100%98.81%1107, 1144, 1147, 1323–1324, 1332, 848, 932, 972
   Dependency.js100%100%100%100%
   DependencyTemplate.js100%100%100%100%
   EntryPlugin.js100%100%100%100%
   Entrypoint.js100%100%100%100%
   ExternalsPlugin.js100%100%100%100%
   FileSystemInfo.js100%100%100%100%
   InitFragment.js100%100%100%100%
   LibraryTemplatePlugin.js100%100%100%100%
   ModuleFilenameHelpers.js100%100%100%100%
   ModuleNotFoundError.js100%100%100%100%
   MultiCompiler.js98.91%100%100%98.91%489, 561, 748, 813
   NormalModule.js100%100%100%100%
   NullFactory.js100%100%100%100%
   ProgressPlugin.js100%100%100%100%
   RawModule.js100%100%100%100%
   RequestShortener.js100%100%100%100%
   SingleEntryPlugin.js100%100%100%100%
   WebpackError.js100%100%100%100%
   index.js100%100%100%100%
   webpack.js98.59%100%100%98.59%306, 308
lib/asset
   AssetBytesGenerator.js100%100%100%100%
   AssetBytesParser.js91.67%100%100%91.67%27
   AssetGenerator.js100%100%100%100%
   AssetModule.js100%100%100%100%
   AssetModulesPlugin.js98.45%100%100%98.45%334, 360, 363, 493, 58
   AssetParser.js96.15%100%100%96.15%47
   AssetSourceGenerator.js100%100%100%100%
   AssetSourceParser.js91.67%100%100%91.67%27
   RawDataUrlModule.js100%100%100%100%
   WebManifestGenerator.js100%100%100%100%
   WebManifestParser.js100%100%100%100%
lib/async-modules
   AsyncModuleHelpers.js100%100%100%100%
   AwaitDependenciesInitFragment.js100%100%100%100%
   InferAsyncModulesPlugin.js100%100%100%100%
   isGeneratorLowered.js100%100%100%100%
lib/bun
   BunTargetPlugin.js100%100%100%100%
lib/cache
   AddBuildDependenciesPlugin.js100%100%100%100%
   AddManagedPathsPlugin.js100%100%100%100%
   Cache.js98.25%100%100%98.25%104
   CacheFacade.js100%100%100%100%
   IdleFileCachePlugin.js97.92%100%100%97.92%75, 87, 95
   MemoryCachePlugin.js92%100%100%92%33, 42
   MemoryWithGcCachePlugin.js93.42%100%100%93.42%106, 120–121, 130, 88
   PackFileCacheStrategy.js96.54%100%100%96.54%1304, 1404, 1408, 1470, 1716, 1796, 1819, 1849, 684, 703, 713–715, 717, 733–734, 739, 742, 744, 749, 754, 779, 785, 819, 825, 831, 836, 847, 856, 861–862, 864, 881, 887–888, 890
   ResolverCachePlugin.js100%100%100%100%
   getLazyHashedEtag.js100%100%100%100%
   mergeEtags.js100%100%100%100%
lib/config
   OptionsApply.js100%100%100%100%
   PlatformPlugin.js100%100%100%100%
   WebpackOptionsApply.js100%100%100%100%
   WebpackOptionsDefaulter.js100%100%100%100%
   browserslistTargetHandler.js100%100%100%100%
   cli.js98.89%100%100%98.89%114, 549, 581, 631
   defaults.js99.59%100%100%99.59%1633–1635, 1643, 288, 548
   defineConfig.js100%100%100%100%
   getClaimedAssetTypes.js100%100%100%100%
   normalization.js99.14%100%100%99.14%285–286, 356, 371
   target.js100%100%100%100%
   validateSchema.js94.67%100%100%94.67%100, 87, 89, 98
lib/container
   ContainerEntryDependency.js100%100%100%100%
   ContainerEntryModule.js100%100%100%100%
   ContainerEntryModuleFactory.js100%100%100%100%
   ContainerExposedDependency.js100%100%100%100%
   ContainerPlugin.js100%100%100%100%
   ContainerReferencePlugin.js100%100%100%100%
   FallbackDependency.js100%100%100%100%
   FallbackItemDependency.js100%100%100%100%
   FallbackModule.js100%100%100%100%
   FallbackModuleFactory.js100%100%100%100%
   HoistContainerReferencesPlugin.js100%100%100%100%
   ModuleFederationPlugin.js100%100%100%100%
   RemoteModule.js100%100%100%100%
   RemoteRuntimeModule.js100%100%100%100%
   RemoteToExternalDependency.js100%100%100%100%
   declaredRemotes.js100%100%100%100%
   moduleFederationHooks.js100%100%100%100%
   options.js100%100%100%100%
lib/context
   ContextExclusionPlugin.js100%100%100%100%
   ContextModule.js99.88%100%100%99.88%1495
   ContextModuleFactory.js95.70%100%100%95.70%230, 257, 276, 280–281, 289, 466, 487, 492, 534, 543, 545, 549, 552, 558–559
   ContextReplacementPlugin.js100%100%100%100%
lib/css
   CssGenerator.js99.29%100%100%99.29%1085, 129, 305, 837
   CssInjectStyleRuntimeModule.js100%100%100%100%
   CssLoadingRuntimeModule.js100%100%100%100%
   CssModule.js100%100%100%100%
   CssModulesPlugin.js98.72%100%100%98.72%217, 418, 432, 445, 458, 481, 494, 507, 520
   CssParser.js99.76%100%100%99.76%1122, 2457, 3104, 3107, 3113, 3545, 975
   CssServerStylesRuntimeModule.js100%100%100%100%
   conventions.js100%100%100%100%
   cssMinify.js100%100%100%100%
   data.js99.84%100%100%99.84%229, 5605
   syntax-parser.js99.71%100%100%99.71%11104–11105, 11657–11658, 11695, 11905, 11954, 14388, 14449–14452, 14557–14558, 14656–14657, 15430, 15726, 15728, 16283, 16675, 16717, 19107, 3066, 3068, 3073, 3086, 3837, 3843
   syntax-printer.js99.33%100%100%99.33%2611–2612, 2614–2615, 2617–2618, 2623, 2893–2896, 2989, 356, 3690, 4115, 4251, 4928, 5242, 6134, 730
   syntax.js100%100%100%100%
   topologicalSort.js100%100%100%100%
lib/debug
   ProfilingPlugin.js100%100%100%100%
lib/define
   DefinePlugin.js99.42%100%100%99.42%1488, 936, 938, 943, 967
   DotenvPlugin.js97.61%100%100%97.61%276, 395, 443, 456–457
   EnvironmentPlugin.js100%100%100%100%
lib/deno
   DenoTargetPlugin.js100%100%100%100%
lib/dependencies
   ConstDependency.js100%100%100%100%
   ContextElementDependency.js100%100%100%100%
   NullDependency.js100%100%100%100%
lib/dependencies/amd
   AMDDefineDependency.js100%100%100%100%
   AMDDefineDependencyParserPlugin.js100%100%100%100%
   AMDPlugin.js99.31%100%100%99.31%54
   AMDRequireArrayDependency.js100%100%100%100%
   AMDRequireContextDependency.js100%100%100%100%
   AMDRequireDependenciesBlock.js100%100%100%100%
   AMDRequireDependenciesBlockParserPlugin.js100%100%100%100%
   AMDRequireDependency.js100%100%100%100%
   AMDRequireItemDependency.js100%100%100%100%
   AMDRuntimeModules.js95.45%100%100%95.45%65
   LocalModule.js100%100%100%100%
   LocalModuleDependency.js100%100%100%100%
   LocalModulesHelpers.js100%100%100%100%
   RequireJsStuffPlugin.js100%100%100%100%
   UnsupportedDependency.js100%100%100%100%
lib/dependencies/commonjs
   CommonJsDependencyHelpers.js98.63%100%100%98.63%43
   CommonJsExportRequireDependency.js99.21%100%100%99.21%413, 415, 417
   

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Generated code size

Comparing base (44405d7) to head (c587583). Merging this pull request changes the size of 8 asset(s) whose tests it leaves untouched.

What moved Tests Assets Gzip Raw Test edit
Changed, test untouched 3 8 🟢 ↓ -99 B 🟢 ↓ -175 B —
Changed, test edited 0 0 — — —
New 0 0 — — —
Deleted 0 0 — — —
Unchanged — 9195 — — —

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 — a new asset was created, not grown, so it reads gray (⚪ added) — and 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.

8 asset(s) changed size, test untouched
Asset Before After Change Gzip (9) Brotli (11) Zstd (19)
🟢 ↓ library/module-live-bindings-hoisted 2/library-2.mjs 1.83 KiB 1.80 KiB -32 B (-1.70%) -8 B (-0.86%) -5 B (-0.60%) -3 B (-0.32%)
🟢 ↓ optimization/minimize-json 6/bundle6.js 267 B 240 B -27 B (-10.11%) -18 B (-10.59%) -8 B (-5.63%) -20 B (-12.58%)
🟢 ↓ optimization/minimize-json 0/bundle0.js 270 B 243 B -27 B (-10.00%) -18 B (-10.59%) -2 B (-1.46%) -20 B (-12.58%)
🟢 ↓ optimization/minimize-json 4/bundle4.js 273 B 246 B -27 B (-9.89%) -18 B (-10.59%) -20 B (-14.18%) -20 B (-12.58%)
🟢 ↓ optimization/minimize-json 5/bundle5.js 294 B 267 B -27 B (-9.18%) -18 B (-10.40%) -19 B (-13.10%) -19 B (-11.80%)
🟢 ↓ optimization/minimize-json 1/bundle1.js 297 B 270 B -27 B (-9.09%) -17 B (-9.66%) -18 B (-12.68%) -19 B (-11.59%)
🔴 ↑ optimization/minify-traversal-work 1/bundle1.js 1.85 KiB 1.85 KiB -4 B (-0.21%) +1 B (+0.15%) — +2 B (+0.29%)
🟢 ↓ optimization/minify-traversal-work 0/bundle0.js 2.36 KiB 2.36 KiB -4 B (-0.17%) -3 B (-0.37%) -3 B (-0.45%) -3 B (-0.37%)

No runtime gained or lost a runtime module.

Built test/configCases with the defaults a user gets: 2292 test(s), 9203 asset(s), 102 emitted nothing.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 5ec541b and c587583.

Files ignored due to path filters: 34
  • schemas/WebpackOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/BannerPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/HtmlParserOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/LoaderOptionsPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/ManifestPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/SSRManifestPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/SourceMapDevToolPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/WatchIgnorePlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/asset/AssetGeneratorOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/asset/AssetInlineGeneratorOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/asset/AssetResourceGeneratorOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/container/ContainerPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/container/ContainerReferencePlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/container/ModuleFederationPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/css/CssAutoOrModuleParserOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/css/CssGeneratorOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/css/CssModuleGeneratorOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/css/CssModuleParserOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/css/CssParserOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/define/DotenvPluginOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/dll/DllPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/dll/DllReferencePlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/ids/HashedModuleIdsPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/json/JsonModulesPluginParser.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/optimize/AggressiveSplittingPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/optimize/LimitChunkCountPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/optimize/MinChunkSizePlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/output/CleanOptions.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/sharing/ConsumeSharedPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/sharing/ProvideSharedPlugin.check.js is excluded by !schemas/**/*.check.js
  • schemas/plugins/sharing/SharePlugin.check.js is excluded by !schemas/**/*.check.js
  • test/configCases/optimization/minify-traversal-work/__snapshots__/ConfigCacheTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/configCases/optimization/minify-traversal-work/__snapshots__/ConfigTest.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
  • test/unitCases/javascript/__snapshots__/printer.unittest.js.snap is excluded by !**/*.snap, !test/**/__snapshots__/**
Files selected for processing: 1
  • docs/syntax.md
Files skipped from review as they are similar to previous changes: 1
  • docs/syntax.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The JavaScript compressor adds guarded value and function inlining, object-property folding, declaration movement, and import/export merging. The change also updates syntax documentation, compression tests, comparison lists, corpus exceptions, and a Changeset.

Changes: JavaScript minification

Layer / File(s) Summary
Value tracking and guarded folding
lib/javascript/syntax-printer.js, test/unitCases/javascript/printer.unittest.js
The compressor tracks eligible local and object-literal values, checks declaration order and execution effects, and applies guarded substitutions and property-hoisting changes. Tests cover rewrites and cases where reads must remain.
Inlining and declaration movement
lib/javascript/syntax-printer.js, test/unitCases/javascript/printer.unittest.js
The compressor adds guarded argument substitution and function copying, top-level function inlining, and declaration movement into loop heads or later declarations. Tests cover applicable rewrites and preservation conditions.
Module and expression rewrites
lib/javascript/syntax-printer.js, test/unitCases/javascript/printer.unittest.js
The compressor merges compatible imports and exports, folds eligible declarations into default exports, and adjusts expression ordering and conditional-throw merging.
Documentation and comparison updates
.changeset/066-minify-inline-gaps.md, docs/syntax.md, test/helpers/oxcSmaller.js, test/helpers/swcSmaller.js, test/specCases/minify-corpora.spectest.js, test/unitCases/javascript/printer.unittest.js
The syntax documentation and Changeset describe minification changes. Comparison lists and corpus exceptions are updated. Compression tests also include a fixture-expression change.

Possibly related PRs

  • webpack/webpack#22897: Both changes address tagged-template this behavior in syntax-printer.js and update related tests and comparison entries.
  • webpack/webpack#22887: Both changes modify the minify-corpora test contract.

Priority: Low

Change: Feature

Merge Risk: Minimal · up to c5875

No actionable merge-blocking risk is identified in the supplied incremental change; normal checks can proceed.

Pre-merge checks: Passed 4
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title uses valid Conventional Commit form with the allowed type feat, optional scope minify, and a subject that accurately describes the main changes.
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.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codspeed

codspeed Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning, 1 note

⚠️ 117 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

ℹ️ 45 benchmarks have no flamegraph

The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

See affected benchmarks

✅ 351 untouched benchmarks


Comparing feat/minify-inline-gaps (c587583) with main (44405d7)

Open in CodSpeed

terser writes `2*e` for `value * 2`, which writing numbers last turns back, so the byte-for-byte comparison with the reference minifier would test the improve phase rather than the plugin's comments and maps.

Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD
…rimitives off object literals

Also keeps a constant-left sequence lift out of the right side of `||`, `&&` and `??`, which dropped code the operator would run.

Claude-Session: https://claude.ai/code/session_01ViD41i2KdwwGxrDk7yrjeD
@alexander-akait
alexander-akait force-pushed the feat/minify-inline-gaps branch from 5ec541b to c587583 Compare October 25, 2026 19:37
@alexander-akait
alexander-akait merged commit 9acffe7 into main Oct 26, 2026
69 checks passed
@alexander-akait
alexander-akait deleted the feat/minify-inline-gaps branch October 26, 2026 00:29
alexander-akait added a commit that referenced this pull request Oct 27, 2026
…own unit tests (#22942)

* test(javascript): cover the settling pass and other printer gaps main brought in

Eleven cases, each held to running as its source does, reach what the
printer test left unrun of #22909's settling of known values and the
built-ins probe. The operator each switch was left with is its default.

Claude-Session: https://claude.ai/code/session_017TkBWTk3wcyUcJYDp5ZhaP

* test: cover hasOctalEscape and fold two fallbacks nothing reaches

`new Set(undefined)` is already the empty set a missing family gave,
and the cold template reader never starts at a chunk's start, which the
fast reader handles before handing it over.

Claude-Session: https://claude.ai/code/session_017TkBWTk3wcyUcJYDp5ZhaP

* ci: hold each language's syntax to its own unit tests

`yarn test:syntax-coverage` runs each language's tokenizer, parser,
printer and minifier tests in a jest process of its own and fails when
what they never run grows past tooling/syntax-coverage.json. CI runs it
when a pull request touches the syntax or its tests.

Claude-Session: https://claude.ai/code/session_017TkBWTk3wcyUcJYDp5ZhaP

* chore: shorten the conditional comment changeset to one sentence

Claude-Session: https://claude.ai/code/session_017TkBWTk3wcyUcJYDp5ZhaP

* test(javascript): drop the handler cases #22926 left nothing to test

An event handler is now minified as a function body itself, so there is
no wrap to read back and no answer to fall back from; the three cases
that held that fallback fail on main.

Claude-Session: https://claude.ai/code/session_017TkBWTk3wcyUcJYDp5ZhaP

* ci: drop the syntax-coverage job, keep yarn test:syntax-coverage local

Claude-Session: https://claude.ai/code/session_017TkBWTk3wcyUcJYDp5ZhaP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: config Options, defaults, validation (lib/config, schemas/) area: parser JavaScript parsing and dependency analysis (lib/javascript, lib/dependencies)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant