Skip to content

fix(start-plugin-core): restore per route stylesheets on Windows - #8202

Open
czearing wants to merge 1 commit into
TanStack:mainfrom
czearing:fix/rsbuild-windows-route-manifest-paths
Open

fix(start-plugin-core): restore per route stylesheets on Windows#8202
czearing wants to merge 1 commit into
TanStack:mainfrom
czearing:fix/rsbuild-windows-route-manifest-paths

Conversation

@czearing

@czearing czearing commented Aug 31, 2026

Copy link
Copy Markdown

🎯 Changes

The Rsbuild integration keys route chunks by the module path rspack reports, which uses the OS separator, while the generated route tree stores every route path with forward slashes, so on Windows every manifest lookup misses and each route is pruned from the Start manifest without its stylesheets or preloads.

Route paths are now converted to the POSIX form before they become manifest keys, which restores each route's own css and preloads and puts the route stylesheet back in the render blocking head. Linux and macOS are unaffected, since both sides of the lookup already agree there.

This was found on a production Rsbuild build of a Start app on Windows. The served page carried only the root stylesheet, painted unstyled for roughly 286 ms, and reflowed once the route styles arrived. With the change the same route ships its stylesheets in the head and that unstyled window is gone.

Validation: a new unit test drives the Rsbuild build normalizer and the manifest builder with Windows style module paths, it fails on the current code and passes with the fix, and the package unit suite reports no new failures.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with the relevant test commands, or tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Bug Fixes

    • Fixed Windows builds where route stylesheets and preload resources were missing from the generated Start manifest.
    • Ensured route assets are correctly associated regardless of operating-system path formatting.
  • Tests

    • Added coverage for Windows-style paths and verified that routes receive their stylesheets and preloads correctly.

…tart manifest

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e4f8b4d1-e914-4bb1-aec7-413019413974

📥 Commits

Reviewing files that changed from the base of the PR and between 37877da and 2d717d5.

📒 Files selected for processing (3)
  • .changeset/rsbuild-windows-route-manifest.md
  • packages/start-plugin-core/src/rsbuild/normalized-client-build.ts
  • packages/start-plugin-core/tests/rsbuild/normalized-client-build.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

Rsbuild now normalizes Rspack route module paths to POSIX separators. New tests verify Windows route chunk matching and manifest stylesheet and preload entries. A patch changeset documents the fix.

Changes

Windows route manifest

Layer / File(s) Summary
Normalize route module paths
packages/start-plugin-core/src/rsbuild/normalized-client-build.ts
Adds toPosixPath and applies it to route file paths derived from Rspack modules.
Validate Windows manifest output
packages/start-plugin-core/tests/rsbuild/normalized-client-build.test.ts, .changeset/rsbuild-windows-route-manifest.md
Adds Windows-path compilation fixtures and tests for normalized route keys, stylesheets, and preloads. Declares a patch release.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 2d717

This change restores route-specific stylesheets and preloads on Windows without altering behavior on other platforms; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: restoring per-route stylesheet handling on Windows in start-plugin-core.
Description check ✅ Passed The description explains the root cause, fix, user impact, platform scope, validation, checklist completion, and changeset release impact. It matches the required template.
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: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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