Skip to content

fix: web lazy components not hot reloading css - #646

Merged
Brentlok merged 1 commit into
mainfrom
fix/web-lazy-components
Aug 24, 2026
Merged

fix: web lazy components not hot reloading css#646
Brentlok merged 1 commit into
mainfrom
fix/web-lazy-components

Conversation

@Brentlok

@BrentlokBrentlok commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

#642

Summary by CodeRabbit

  • Bug Fixes
    • Improved development-mode loading so CSS is included reliably when using Metro’s lazy graph.
    • Prevented CSS-related styling issues caused by incomplete dependency graph traversal.
  • Compatibility
    • Added safeguards to ensure the Metro integration can be applied repeatedly without duplicate changes.

@coderabbitai

coderabbitaiBot commented Aug 24, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a1e84f79-9d9c-439c-aa16-9289597f8c50

📥 Commits

Reviewing files that changed from the base of the PR and between 0f8bdcd and e416c2f.

📒 Files selected for processing (2)
  • packages/uniwind/src/bundler/adapters/metro/metro.ts
  • packages/uniwind/src/bundler/adapters/metro/patches.ts
 __________________________________________________________________________
< Mirror, mirror on the wall, who's the best AI code reviewer of them all? >
--------------------------------------------------------------------------
\
\ \
\ /\
( )
.( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/web-lazy-components

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.

@greptile-apps

Copy link
Copy Markdown

Greptile Summary

This PR patches Metro lazy development graphs to include Uniwind’s configured CSS entry, allowing CSS changes used by lazy web components to participate in graph traversal and hot reload.

  • Resolves and passes the configured CSS entry when initializing the Metro adapter.
  • Wraps Metro’s initial dependency traversal to add that entry for lazy development graphs.
  • Adds a process-wide marker to avoid installing the prototype patch repeatedly.

Confidence Score: 4/5

The PR appears safe to merge for normal single-config Metro processes, with a non-blocking stale-path issue when multiple configurations are initialized in one process.

The lazy-graph behavior is correctly installed for the first configuration, but the process-wide wrapper captures that configuration’s CSS path and silently ignores later paths.

Files Needing Attention: packages/uniwind/src/bundler/adapters/metro/patches.ts

Important Files Changed

FilenameOverview
packages/uniwind/src/bundler/adapters/metro/metro.tsInstalls the lazy-graph patch with the configured CSS entry path during Metro adapter setup.
packages/uniwind/src/bundler/adapters/metro/patches.tsAdds CSS to lazy development graphs, but its one-time global wrapper retains the first configuration’s path.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[withUniwindConfig] --> B[Resolve configured CSS entry]
B --> C[Patch Metro Graph prototype]
C --> D{Lazy development graph?}
D -- Yes --> E[Add CSS entry to graph entryPoints]
D -- No --> F[Keep original entry points]
E --> G[Run original initial traversal]
F --> G
G --> H[CSS participates in updates]
Loading

Fix all with GreploopFix All in Claude CodeFix All in Codex

Reviews (1): Last reviewed commit: "fix: web lazy components not hot reloadi..." | Re-trigger Greptile

Comment threadpackages/uniwind/src/bundler/adapters/metro/patches.ts
@Brentlok
Brentlok merged commit 280976a into mainAug 24, 2026
3 checks passed
@Brentlok
Brentlok deleted the fix/web-lazy-components branch August 24, 2026 08:07
Sign up for freeto 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

@Brentlok