Repository navigation
refactor: one hot.inject enum for what is added to the compilation - #2484
Conversation
…half `hot.client.transport` names only the wire now; a module exporting a client class of your own goes in the new `hot.client.module`. `hot.inject` switches only `HotModuleReplacementPlugin`, and `hot.client: false` only the runtime in the page, so the two no longer overlap; both off adds nothing, as `inject: false` alone did before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
Reverts the `hot.client.module` split, so `hot.client.transport` names a wire or a client module as before. `hot.inject` becomes "all" | "plugin" | "client" | "none" — the runtime (client and overlay), HotModuleReplacementPlugin, both or neither — replacing the boolean and `hot.client: false`, so one option says what goes in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
|
| Name | Type |
|---|---|
| webpack-dev-middleware | Minor |
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
e50564b5-1fb0-4ec2-b14b-083cd7848913
📒 Files selected for processing: 16
.changeset/finish-dev-server-migration.md.changeset/hot-inject.mdREADME.mdsrc/hot.jssrc/options.check.jssrc/options.jsonsrc/utils.jstest/__snapshots__/validation-options.test.js.snap.webpack5test/e2e/inject.test.jstest/e2e/messages.test.jstest/e2e/process-update.test.jstest/inject-client.test.jstest/universal-target.test.jstest/validation-options.test.jstypes/hot.d.tstypes/utils.d.ts
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
…says `apply` is the injected client's mode, so it only leaves the plugin out when a client is added. The transport-function warning no longer says the plugin is applied under "client", and the README says the "plugin" and "none" modes turn off only the default token requirement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2484 +/- ##
=======================================
Coverage 96.58% 96.59%
=======================================
Files 24 24
Lines 2637 2640 +3
=======================================
+ Hits 2547 2550 +3
Misses 90 90 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Generated by Claude Code |
hot.inject(boolean) andhot.client: falsewere two overlapping switches:inject: falsedropped both the runtime andHotModuleReplacementPlugin, whileclient: falsedropped only the runtime. This replaces both with one enum. Neither option has shipped yet, so nothing released breaks.hot.injectHotModuleReplacementPlugin"all"(default)"plugin""client""none"subscribehot.clientnow takes options only.hot.inject: true/falseandhot.client: falsefail validation with the valid values listed."client"is new: the runtime is added without the plugin, and a plugin in the configuration is kept without the "redundant plugin" warning.hot.tokenrequirement is turned off whenever no client is added ("plugin"/"none"), asinject: falsedid before.hot.client.transportstill names a wire ("sse"/"ws") or a module exporting a client class: the first commit split the module out intohot.client.module, and the second reverts that, so there stays a single option.Tests
"client", and validation cases for the enum and for the old shapes. Existing uses are mapped (inject: false→"none",client: false→"plugin")."client"with the configuration's own plugin applies updates in place;"client"with no plugin connects and leavesmodule.hotundefined.writeToDiskEACCES, which root never gets); e2e 233 of 233; lint, types and schema check clean.client: falseto"plugin"withhotand"none"without, on a build of this branch: its full suite shows the same sandbox-only failures as before.🤖 Generated with Claude Code
https://claude.ai/code/session_01UjuMAuk9o6UazjHzcAQCTA
Generated by Claude Code
Summary by CodeRabbit
hot.injectsupports"all","plugin","client", and"none"modes to control whether the browser client, HMR plugin, both, or neither are added."client"mode can add the browser client while preserving an HMR plugin already configured in your project.