Skip to content

fix(client): load the page when a sibling compilation builds, in reload mode - #2468

Merged
alexander-akait merged 2 commits into
mainfrom
fix/client-reload-on-sibling-builds
Oct 6, 2026
Merged

alexander-akait merged 2 commits into
mainfrom
fix/client-reload-on-sibling-builds

Conversation

@alexander-akait

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

Copy link
Copy Markdown
Member

Summary

In a multi-compiler build, each page's client carries the name of its own compilation and ignores every other compilation's events. That is right for applying an update in place, since a sibling's hash is not this bundle's. It means a page rendered from another bundle's output (a server bundle, for instance) is never told to reload when that bundle changes.

webpack-dev-server has always reloaded on any compilation's change, and its universal-config tests rely on it: changing the server entry reloads the browser page.

In apply: "reload", a successful (built, no errors) sibling build now loads the page. Nothing is applied in place and a build with errors still leaves the page alone. hmr and hmr-only behave as before.

Test plan

  • Two new cases in test/e2e/multi-compiler.test.js, using the one-bundle-per-page route: a sibling's successful build reloads the page, and a sibling's failed build does not. The first fails without the change.
  • The multi-compiler and live-reload suites pass (22 tests), and lint, prettier and build:types are clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • In reload mode, pages now reload after a successful build from a sibling compilation, even when it has a different name from the selected compilation.
    • Failed sibling builds leave the page unchanged; the page does not reload when a sibling build reports errors.
    • This behavior applies to multi-compiler builds where the page may use bundles from more than one compilation.

@changeset-bot

changeset-bot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: db1687e

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

This PR includes changesets to release 1 package
Name Type
webpack-dev-middleware Patch

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

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e6145b9c-8870-4af1-b85e-5289d6caa7b9
📥 Commits

Reviewing files that changed from the base of the PR and between d6cb930 and db1687e.

📒 Files selected for processing (2)
  • README.md
  • client-src/index.js

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


Walkthrough

When a named compilation differs from the configured name, the client now reloads the page if it receives a successful built event and applyMode() is "reload". The client continues to skip local update processing for that compilation. New end-to-end tests cover successful and failed sibling builds. The README and changeset describe the behavior.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to db168

The failed-build test may check too early to catch an erroneous reload after the event is handled. This is a bounded test-confidence gap; synchronizing the assertion with client processing is a follow-up.

Architecture Summary

Architecture risk: 🔵 Low · up to 68526

The change affects 3 systems.

Changed systems: client-src, README.md, test

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — client-src (service) was modified; 1 changed file maps to changed impact.
  • observed — README.md (service) was modified; 1 changed file maps to changed impact.
  • observed — test (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in README.md: The name option description now specifies that, with apply: "reload", a successful build from any other compilation still reloads the page.
  • observed — Modified behavior in client-src/index.js: For events from a named compilation that differs from options.name, the client now reloads on a successful built event when applyMode() is "reload"; it still skips local update processing for the mismatched compilation.
  • observed — Modified behavior in test/e2e/multi-compiler.test.js: Added a test confirming that, in reload mode, a successful sibling build reloads the /page/app page while it continues to render app-v1.
  • observed — Modified behavior in test/e2e/multi-compiler.test.js: Added a test confirming that a failed sibling build does not reload the page in reload mode.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: successful sibling compilations trigger a page reload in reload mode.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 …
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.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ed6f6b84-1267-4bd4-8bba-8a09bf12e616
📥 Commits

Reviewing files that changed from the base of the PR and between 39ca955 and 68526c0.

📒 Files selected for processing (4)
  • .changeset/client-reload-on-sibling-builds.md
  • README.md
  • client-src/index.js
  • test/e2e/multi-compiler.test.js

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

Comment thread test/e2e/multi-compiler.test.js Resolved
@codecov

codecov Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.30%. Comparing base (e7f5380) to head (db1687e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2468      +/-   ##
==========================================
+ Coverage   96.29%   96.30%   +0.01%     
==========================================
  Files          23       23              
  Lines        2507     2519      +12     
==========================================
+ Hits         2414     2426      +12     
  Misses         93       93              

☔ 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.

@alexander-akait
alexander-akait force-pushed the fix/client-reload-on-sibling-builds branch from 19db232 to d6cb930 Compare October 6, 2026 09:28
alexander-akait and others added 2 commits October 6, 2026 09:57
…ad mode

The name filter kept a sibling's build away from the client, which is right
for applying an update in place. A page rendered from another bundle's output,
a server bundle for instance, was then never told to reload when that bundle
changed. webpack-dev-server has always reloaded on any compilation's change.

A build with errors still leaves the page alone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
app.edit only writes the file, so a three second pause could end before the
build or its event. The test waits for the build to complete with errors, then
for the watcher to go quiet, before it checks that the page was left alone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
@alexander-akait
alexander-akait force-pushed the fix/client-reload-on-sibling-builds branch from d6cb930 to db1687e Compare October 6, 2026 10:02
@alexander-akait
alexander-akait merged commit 07b9fbc into main Oct 6, 2026
24 checks passed
@alexander-akait
alexander-akait deleted the fix/client-reload-on-sibling-builds branch October 6, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant