feat(rsc): support configurable CSS link props#13945
Conversation
|
@codex review |
📦 Binary Size-limit
❌ Size increased by 12.00KB from 61.90MB to 61.91MB (⬆️0.02%) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f00442b812
ℹ️ 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".
Rsdoctor Bundle Diff AnalysisFound 6 projects in monorepo, 5 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 popular-libsPath:
📦 Download Diff Report: popular-libs Bundle Diff 📁 react-10kPath:
📦 Download Diff Report: react-10k Bundle Diff 📁 react-1kPath:
📦 Download Diff Report: react-1k Bundle Diff 📁 react-5kPath:
📦 Download Diff Report: react-5k Bundle Diff 📁 ui-componentsPath:
📦 Download Diff Report: ui-components Bundle Diff Generated by Rsdoctor GitHub Action |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0cbee5861
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e0e0cb272
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for configuring the props applied to generated CSS <link> elements in the RSC pipeline, and exposes the normalized props on the RSC runtime manifest.
Changes:
- Plumb
cssLinkoptions through the JS plugin API → N-API binding → Rust plugin state. - Expose normalized
cssLinkPropson the RSC runtime manifest and spread them onto generated stylesheet link elements. - Add a new RSC config case/test covering custom CSS link props and disabling default
precedence.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/rspack-test/configCases/rsc-plugin/css-link-props/test.config.js | Adds a new config case harness for the CSS link props scenario. |
| tests/rspack-test/configCases/rsc-plugin/css-link-props/src/framework/entry.ssr.js | SSR entry wiring to consume the RSC stream for the test case. |
| tests/rspack-test/configCases/rsc-plugin/css-link-props/src/framework/entry.rsc.js | Adds assertions verifying cssLinkProps exposure and <link> generation behavior. |
| tests/rspack-test/configCases/rsc-plugin/css-link-props/src/framework/entry.client.js | Minimal client entry placeholder for the test case. |
| tests/rspack-test/configCases/rsc-plugin/css-link-props/src/Client.js | Client component that imports CSS to trigger stylesheet emission. |
| tests/rspack-test/configCases/rsc-plugin/css-link-props/src/Client.css | CSS asset used by the client component. |
| tests/rspack-test/configCases/rsc-plugin/css-link-props/src/App.js | Server entry component that renders the client component. |
| tests/rspack-test/configCases/rsc-plugin/css-link-props/rspack.config.js | Configures ServerPlugin cssLink options and build layers for the new case. |
| packages/rspack/src/builtin-plugin/rsc/RscServerPlugin.ts | Adds cssLink option typing and forwards it into the builtin binding. |
| packages/rspack/src/builtin-plugin/rsc/RscClientPlugin.ts | Replaces @ts-ignore with @ts-expect-error for binding access. |
| crates/rspack_plugin_rsc/src/server_plugin.rs | Stores css link props in plugin state and passes them into manifest construction. |
| crates/rspack_plugin_rsc/src/reference_manifest.rs | Adds RscCssLinkProps type and includes css link props in the entry manifest. |
| crates/rspack_plugin_rsc/src/plugin_state.rs | Persists css link props in plugin state and clears them between compilations. |
| crates/rspack_plugin_rsc/src/manifest_runtime_module.rs | Ensures runtime manifest generation receives css link props. |
| crates/rspack_plugin_rsc/src/lib.rs | Re-exports RscCssLinkProps for use by the binding layer. |
| crates/rspack_loader_swc/src/rsc_transforms/to_client_ref.rs | Spreads __rspack_rsc_manifest__.cssLinkProps into generated <link> props. |
| crates/rspack_binding_api/src/raw_options/raw_builtins/mod.rs | Adjusts downcast ownership to support updated TryFrom conversion. |
| crates/rspack_binding_api/src/plugins/rsc.rs | Adds N-API option parsing/normalization for css link options into RscCssLinkProps. |
| crates/node_binding/napi-binding.d.ts | Exposes cssLink options and JsRscCssLinkOptions types to TS consumers. |
Comments suppressed due to low confidence (1)
crates/rspack_plugin_rsc/src/reference_manifest.rs:1
css_link_propsis added without an explicit serde rename. Unless the struct (or module) is already usingrename_all = "camelCase", this will serialize ascss_link_props, but the JS runtime/tests expectcssLinkProps. Add#[serde(rename = "cssLinkProps")]on this field (or ensure a camelCase rename policy applies here) so the manifest key matches the public API.
#![allow(clippy::ref_option_ref)]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
cssLinkoptions to RSCServerPluginfor configuring generated stylesheet<link>propscssLinkPropsprecedenceRelated links
Checklist