Skip to content

fix(rsc): skip client entry mismatch without injections#14018

Merged
SyMind merged 1 commit into
mainfrom
client-entry-mismatch
May 12, 2026
Merged

fix(rsc): skip client entry mismatch without injections#14018
SyMind merged 1 commit into
mainfrom
client-entry-mismatch

Conversation

@SyMind
Copy link
Copy Markdown
Member

@SyMind SyMind commented May 12, 2026

Summary

  • Skip RSC client entry mismatch diagnostics when an entry has no client compiler injections.
  • Avoid mutating missing client entries by replacing the final unwrap with a guarded lookup.
  • This supports multi-entry RSC setups where an RSC-only service entry has no client components or CSS and does not need a matching client compiler entry.

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings May 12, 2026 09:18
@github-actions github-actions Bot added the release: bug fix release: bug related release(mr only) label May 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing b913353 to security(ci): remove PR title lint workflow (#14016) by neverland

🙈 Size remains the same at 61.97MB

@github-actions
Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 6 projects in monorepo, 0 projects with changes.

📊 Quick Summary
Project Total Size Change
popular-libs 1.7 MB 0
react-10k 5.7 MB 0
react-1k 826.3 KB 0
rome 1.6 MB 0
react-5k 2.7 MB 0
ui-components 4.8 MB 0

Generated by Rsdoctor GitHub Action

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 12, 2026

Merging this PR will not alter performance

✅ 34 untouched benchmarks
⏩ 25 skipped benchmarks1


Comparing client-entry-mismatch (b913353) with main (fd9b3d8)2

Open in CodSpeed

Footnotes

  1. 25 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (f83f2f5) during the generation of this report, so fd9b3d8 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

📝 Rspack Ecosystem CI: Open

suite result
rsbuild ❌ failure
rspress ✅ success
rsdoctor ✅ success
lynx-stack ❌ failure
examples ✅ success
devserver ✅ success
modernjs ✅ success
plugin ✅ success
rstest ✅ success
rsbuild-rsc-plugin ✅ success
rslib ✅ success

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new RSC config-case to ensure builds don’t fail with “client entry mismatch” diagnostics when there are no client injections and no CSS imports to inject.

Changes:

  • Add a new rsc-service-no-client-injection config-case with minimal server/client entries.
  • Update the RSC client plugin to skip mismatch handling when there’s nothing to inject (no client entries + no CSS).
  • Avoid a potential panic by replacing an unwrap() with if let Some(...).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/rspack-test/configCases/rsc-plugin/rsc-service-no-client-injection/test.config.js Config-case bundle selection for the new scenario.
tests/rspack-test/configCases/rsc-plugin/rsc-service-no-client-injection/src/framework/rsc-service.rsc.js Adds an RSC entry that exercises import.meta.rspackRsc.
tests/rspack-test/configCases/rsc-plugin/rsc-service-no-client-injection/src/framework/entry.ssr.js SSR entry that consumes the RSC entry.
tests/rspack-test/configCases/rsc-plugin/rsc-service-no-client-injection/src/framework/entry.rsc.js RSC entry with assertion validating the output.
tests/rspack-test/configCases/rsc-plugin/rsc-service-no-client-injection/src/framework/entry.client.js Empty client entry for “no injection” scenario.
tests/rspack-test/configCases/rsc-plugin/rsc-service-no-client-injection/src/RscService.js Server-entry module using rspackRsc.loadCss().
tests/rspack-test/configCases/rsc-plugin/rsc-service-no-client-injection/src/App.js Minimal server-entry app returning "main".
tests/rspack-test/configCases/rsc-plugin/rsc-service-no-client-injection/rspack.config.js Two-compiler setup for server (node) + client (web) using RSC plugins.
crates/rspack_plugin_rsc/src/client_plugin.rs Skips mismatch when no injections; avoids unwrap panic when entry is missing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/rspack_plugin_rsc/src/client_plugin.rs
Comment thread crates/rspack_plugin_rsc/src/client_plugin.rs
@SyMind
Copy link
Copy Markdown
Member Author

SyMind commented May 12, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SyMind SyMind merged commit a13b3d0 into main May 12, 2026
42 checks passed
@SyMind SyMind deleted the client-entry-mismatch branch May 12, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants