Skip to content

feat(metassr-server): implement granular CSS rebuild in dev mode#107

Open
abhicodes0324 wants to merge 1 commit intometacall:masterfrom
abhicodes0324:feat/granular-css-rebuild
Open

feat(metassr-server): implement granular CSS rebuild in dev mode#107
abhicodes0324 wants to merge 1 commit intometacall:masterfrom
abhicodes0324:feat/granular-css-rebuild

Conversation

@abhicodes0324
Copy link
Contributor

Summary

RebuildType::Style previously logged a warning and did nothing - any CSS change in dev mode was silently ignored and the browser never updated styles. This PR implements it.

Changes

rebuilder.rs

  • Added rebuild_styles() - re-runs the client-side bundle via ClientBuilder so Rspack picks up the changed CSS. Only the client bundle runs - no server-side rebuild is triggered
  • RebuildType::Style arm now calls rebuild_styles() and broadcasts RebuildType::Style to connected WebSocket clients
  • The browser receives the style message and reloadStylesheets() fires a CSS-only reload - no full page refresh
  • Fixed typo in Page doc comment (providiedprovided)
  • Converted // comments on enum variants to /// doc comments

How to verify

  1. Run metassr dev inside tests/web-app/
  2. Open DevTools → Network tab → filter by CSS
  3. Edit any file in src/styles/
  4. Before: nothing happens in the browser
  5. After: a style.css?t=<timestamp> request fires without a full page reload

Notes

Checklist

  • Addresses Style Rebuild TODO item in TODO.md
  • 6 unit tests added for map_path_to_type and broadcast path
  • cargo clippy clean
  • cargo fmt applied

Signed-off-by: Abhiswant Chaudhary <abhicodes0324@gmail.com>
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