GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: run every ES module config case with cross-chunk imports forced on by alexander-akait · Pull Request #23536 · webpack/webpack

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Nov 23, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Summary

Refs #20536. This is a step toward making optimization.concatenateModules.crossChunkImports safe to enable by default.

TEST_CROSS_CHUNK_IMPORTS=1 makes ConfigTestCases force the option on for every config with output.module where concatenation runs. Development mode leaves concatenation off, so the switch leaves those configs alone. A new CI job, cross-chunk-imports, runs the suite this way. It waits on lint, basic and unit, like the other jobs that take minutes.

Local result, with the option forced on:

run result
first sweep 23 failed of 19,096
after fixing the switch and the test 19,085 passed, 0 failed

None of the 23 failures was a linking bug:

  • 22 came from the first version of the switch. It turned concatenation on in development cases, and its WEBPACK_* name leaked into the import.meta.env snapshot.
  • The last one was a collision in the test. library/module-entry-with-initial-chunk built two configs into one side.mjs, and with linking the two copies differ. Each config's chunk now has its own name, and the case passes under both suites with and without the option.

What kind of change does this PR introduce?

test

Did you add tests for your changes?

Yes: the new CI job reruns the existing ConfigTestCases suite.

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/cross-chunk-imports.md names the job and the switch.

Use of AI

Written with Claude Code (AI): it added the switch and the job, ran the sweep and triaged each failure. The requester chose the plan and reviews the result.


Generated by Claude Code

Summary by CodeRabbit

  • Tests

    • CI now runs the configuration test suite with cross-chunk imports enabled on the latest LTS version of Node.js.
    • Module output configurations with concatenation enabled are also tested with cross-chunk imports enabled, while retaining existing concatenation options.
  • Documentation

    • Added details about how the cross-chunk import checks run in CI.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@alexander-akait
test: run every ES module config case with cross-chunk imports forced on
e15d633
@changeset-bot

changeset-bot Bot commented Nov 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e15d633

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Nov 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Reports for e15d633, computed by this pull request's own code. Each section updates when its workflow finishes.


Preview package

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@23536
  • yarn
yarn add -D webpack@https://pkg.pr.new/webpack@23536
  • pnpm
pnpm add -D webpack@https://pkg.pr.new/webpack@23536

From Preview package run #13971.


Generated code size

Comparing base (221d2fb) to head (e15d633). Merging this pull request changes the size of 3 asset(s) whose tests it leaves untouched, adds 2 new asset(s) and deletes 2 asset(s).

What moved Tests Assets Gzip Raw Test edit
Changed, test untouched 2 3 🔴 ↑ +8 B 🔴 ↑ +16 B —
Changed, test edited 0 0 — — —
New 1 2 ⚪ added +617 B ⚪ added +953 B —
Deleted 1 2 -618 B -954 B —
Unchanged — 11044 — — —

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.

Sample apps

No sample app changed size.

26 unchanged app(s)
App Gzip Gzip change Raw Raw change
library amd 1.37 KiB — 2.64 KiB —
library amd-require 1.37 KiB — 2.63 KiB —
library assign 1.37 KiB — 2.63 KiB —
library assign-properties 1.41 KiB — 2.75 KiB —
library commonjs 1.37 KiB — 2.62 KiB —
library commonjs-module 1.37 KiB — 2.63 KiB —
library commonjs-static 1.54 KiB — 3.50 KiB —
library commonjs2 1.37 KiB — 2.63 KiB —
library global 1.37 KiB — 2.62 KiB —
library jsonp 1.37 KiB — 2.62 KiB —
library module 1.20 KiB — 2.30 KiB —
library self 1.37 KiB — 2.62 KiB —
library system 1.40 KiB — 2.69 KiB —
library this 1.37 KiB — 2.62 KiB —
library umd 1.43 KiB — 2.82 KiB —
library umd2 1.43 KiB — 2.82 KiB —
library var 1.37 KiB — 2.63 KiB —
library window 1.37 KiB — 2.62 KiB —
node-ssr 96.21 KiB — 370.39 KiB —
node-ssr-esm 96.56 KiB — 370.95 KiB —
react-100 32.83 KiB — 151.45 KiB —
react-1k 73.38 KiB — 897.75 KiB —
react-1k-esm 72.87 KiB — 896.58 KiB —
react-5k 188.96 KiB — 4.02 MiB —
webworker 36.75 KiB — 95.18 KiB —
webworker-esm 35.89 KiB — 93.90 KiB —
3 asset(s) changed size, test untouched
Asset Before After Change Gzip (9) Brotli (11) Zstd (19)
🔴 ↑ library/module-entry-with-initial-chunk no-concat/no-concat.mjs 6.13 KiB 6.14 KiB +10 B (+0.16%) +7 B (+0.41%) +11 B (+0.73%) +3 B (+0.18%)
🔴 ↑ library/module-entry-with-initial-chunk concat/concat.mjs 6.13 KiB 6.14 KiB +6 B (+0.10%) +4 B (+0.23%) -1 B (-0.07%) +5 B (+0.30%)
🟢 ↓ side-effects/issue-13063 vendors.js.LICENSE.txt 2.11 KiB 2.11 KiB 0 B (—) -3 B (-0.67%) -2 B (-0.53%) -2 B (-0.45%)
2 asset(s) this pull request adds
Asset Raw Gzip (9) Brotli (11) Zstd (19)
⚪ added library/module-entry-with-initial-chunk no-concat/side-no-concat.mjs 477 B 309 B 281 B 308 B
⚪ added library/module-entry-with-initial-chunk concat/side-concat.mjs 476 B 308 B 279 B 306 B
2 asset(s) this pull request no longer emits
Asset Raw Gzip (9) Brotli (11) Zstd (19)
➖ library/module-entry-with-initial-chunk concat/side.mjs 477 B 309 B 280 B 308 B
➖ library/module-entry-with-initial-chunk no-concat/side.mjs 477 B 309 B 280 B 308 B

No runtime gained or lost a runtime module.

Built test/configCases with the defaults a user gets, and the apps in test/sizeCoreReports (apps/): 2524 test(s), 11049 asset(s), 112 emitted nothing.

From Generated code size run #8606.


Types Coverage

Typed lines: 99.65% (209290 of 210024)

Kind Base Head Change
any 41 41 —
unknown 16 16 —
object 13 13 —
Function 0 0 —
untyped 0 0 —

any counts EXPECTED_ANY, a written any and JSDoc's * and ? for any type. unknown counts a written unknown; ThrownValue, the unknown a throw or a rejected promise hands on, is left out. object counts EXPECTED_OBJECT and Object, Function counts EXPECTED_FUNCTION. Untyped counts the any TypeScript infers where no type is written: a type argument a call leaves to inference that comes out any, whether a lib signature defaults it, as in const map = new Map() and Array(5), or a generic call infers it from an any argument; and const list = []. An identifier that only holds an any written in the project's files is not counted again, as the any row counts it where it is written; an any a lib signature returns, such as JSON.parse's, is counted in neither row.

This pull request adds or removes no escape hatch, any or untyped identifier.

33 file(s) in lib/, hot/, declarations/ and bin/ still have an escape hatch, `any` or untyped identifiers
File Typed lines any unknown object Function untyped
declarations/WebpackOptions.ts 100.00% 7
lib/Compilation.js 99.97% 5 2
lib/module/NormalModule.js 100.00% 4 1
lib/loaders/LoaderOptionsPlugin.js 100.00% 4
lib/serialization/ObjectMiddleware.js 100.00% 4
lib/hmr/HotModuleReplacement.runtime.js 100.00% 2 1
lib/module/NormalModuleFactory.js 100.00% 3
lib/stats/StatsFactory.js 100.00% 2 1
lib/Compiler.js 99.89% 2
lib/config/defineConfig.js 100.00% 2
lib/hmr/JavascriptHotModuleReplacement.runtime.js 100.00% 2
lib/index.js 100.00% 2
lib/javascript/syntax-printer.js 99.99% 2
lib/loaders/LoaderRunner.js 100.00% 2
lib/module/Module.js 99.77% 2
lib/module/Parser.js 100.00% 2
lib/node/nodeConsole.js 100.00% 2
lib/config/cli.js 100.00% 1
lib/dll/DllReferencePlugin.js 100.00% 1
lib/graph/ModuleGraph.js 99.15% 1
lib/hmr/HotModuleReplacementPlugin.js 100.00% 1
lib/javascript/JavascriptParser.js 100.00% 1
lib/javascript/syntax-parser.js 100.00% 1
lib/logging/Logger.js 100.00% 1
lib/logging/createConsoleLogger.js 100.00% 1
lib/output/ManifestPlugin.js 100.00% 1
lib/serialization/types.js 100.00% 1
lib/stats/DefaultStatsFactoryPlugin.js 99.87% 1
lib/stats/StatsPrinter.js 100.00% 1
lib/util/SortableSet.js 100.00% 1
lib/util/makeSerializable.js 100.00% 1
lib/util/terminalColors.js 100.00% 1
lib/worker/Worker.js 100.00% 1

From Types Coverage run #4616.


Module loading

How many files a fresh Node.js process loads (require or import) to do each thing below; a change from the pull request's base is marked 🔴 when it grew and 🟢 when it shrank. Every file is startup time, so fewer is better. webpack files are this package's own (lib/, hot/); node_modules files are its dependencies'.

What the process does webpack files node_modules files
require("webpack") 2 0
import "webpack" 2 0
JavaScript syntax 12 0
CSS syntax 12 0
HTML syntax 11 0
XML syntax 11 0
JavaScript minifier 13 0
CSS minifier 14 0
HTML minifier 19 0
XML minifier 14 0
JSON minifier 1 0
development build 422 103
production build 430 131
watch with HMR, one rebuild 446 110

From Module loading run #1860.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test harness conditionally enables crossChunkImports for qualifying module configuration cases. A new CI job runs those cases with the option enabled, and the documentation describes the job.

Changes: Cross-chunk import test coverage

Layer / File(s) Summary
Enable the option in configuration cases
test/templates/ConfigTestCases.js, test/configCases/library/module-entry-with-initial-chunk/webpack.config.js
The test harness sets crossChunkImports when the environment variable is set, output is a module, and concatenation is enabled. The cache-group chunk name now includes the configuration name.
Run configuration cases in CI
.github/workflows/test.yml, docs/cross-chunk-imports.md
A new CI job runs ConfigTestCases.basictest with TEST_CROSS_CHUNK_IMPORTS=1. The documentation describes the job’s conditions and test suite.

Possibly related PRs

  • webpack/webpack#23525: Changes cross-chunk side-effect, namespace import, and initial chunk linking exercised by the new configuration test run.
  • webpack/webpack#23491: Introduces the optimization.concatenateModules.crossChunkImports option enabled by the test harness.
  • webpack/webpack#23533: Changes cross-chunk re-export linking exercised by the new configuration test run.

Suggested reviewers: hai-x, bjohansebas

Change: Other

Merge Risk: Minimal · up to e15d6

This change only adds a test switch and a CI job for cross-chunk imports, with no production behavior change. It is ready to merge, subject to normal CI results.

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 the conventional-commit form with the type "test" and no scope. The changeset adds a TEST_CROSS_CHUNK_IMPORTS switch in ConfigTestCases that forces crossChunkImports on for ES module co…
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 conventional-commit form with the type "test" and no scope. The changeset adds a TEST_CROSS_CHUNK_IMPORTS switch in ConfigTestCases that forces crossChunkImports on for ES module configs, plus a new CI job that reruns the suite. The title describes this main change. The requirement lists "test" as an allowed type. The branch prefix was not provided, so the match between type and branch prefix could not be checked.

  • 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

  • X
  • Mastodon
  • Reddit
  • LinkedIn
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: webpack/webpack
  • Branch: test/cross-chunk-imports-corpus
  • File: .coderabbit.yaml
  • Commit: e15d633
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ca852d80-7fa2-4178-a770-4cb70835f51c
Commits

Reviewing files that changed from the base of the PR and between 221d2fb and e15d633.

Files selected for processing: 4

  • .github/workflows/test.yml
  • docs/cross-chunk-imports.md
  • test/configCases/library/module-entry-with-initial-chunk/webpack.config.js
  • test/templates/ConfigTestCases.js

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait alexander-akait mentioned this pull request Nov 23, 2026
perf(esm): keep modules in the registry when linking them would grow the output #23537
Merged
@codspeed

codspeed Bot commented Nov 23, 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

ℹ️ 15 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 test/cross-chunk-imports-corpus (e15d633) with main (221d2fb)

Open in CodSpeed
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait merged commit 3a4df61 into main Nov 23, 2026
56 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@alexander-akait
alexander-akait deleted the test/cross-chunk-imports-corpus branch November 23, 2026 06:03
@alexander-akait alexander-akait mentioned this pull request Nov 23, 2026
feat(esm): link modules with side effects through init functions #23540
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

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.

1 participant

@alexander-akait
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.