Skip to content

perf: lazy-load global login and libraries overlays - #1229

Merged
LadyBluenotes merged 1 commit into
mainfrom
codex/lazy-global-overlays
Sep 8, 2026
Merged

LadyBluenotes merged 1 commit into
mainfrom
codex/lazy-global-overlays

Conversation

@LadyBluenotes

@LadyBluenotes LadyBluenotes commented Sep 7, 2026 •

Copy link
Copy Markdown
Member

The global shell eagerly imported the login dialog and libraries overlay even when visitors never opened them. Load each through React.lazy on its first explicit open, with a local Suspense boundary. Keep it mounted after that first open so Radix can handle closing animations and subsequent opens.

Production build comparison using the same installed dependencies:

Client entry and static JS imports Before After
Raw bytes 1,305,258 1,278,499
Gzip bytes 397,499 389,414
Brotli bytes 326,403 319,692

This moves 8,085 gzip bytes out of the entry's static import graph. Both overlays emit separate async chunks. These figures exclude route chunks and are not a whole-page transfer measurement; the first opening now waits for its async chunk.

Summary by CodeRabbit

  • Performance
    • Libraries and login interfaces now load only when opened, helping improve initial application loading performance.
    • Unused overlays and modals no longer load until they are requested.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com e77cce7 Commit Preview URL

Branch Preview URL
Sep 07 2026, 10:18 PM

@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: c6bd7c15-cae6-4338-9d0c-a3587a7dd7f4

📥 Commits

Reviewing files that changed from the base of the PR and between ff1f754 and e77cce7.

📒 Files selected for processing (2)
  • src/contexts/LibrariesOverlayContext.tsx
  • src/contexts/LoginModalContext.tsx

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


📝 Walkthrough

Walkthrough

Changes

The contexts now lazy-load the libraries overlay and login modal. Each component loads when its open function is called and renders through React.Suspense.

Lazy UI component loading

Layer / File(s) Summary
Lazy libraries overlay loading
src/contexts/LibrariesOverlayContext.tsx
The provider dynamically imports LibrariesOverlay, tracks the first open request, and renders the overlay conditionally inside React.Suspense.
Lazy login modal loading
src/contexts/LoginModalContext.tsx
The provider dynamically imports LoginModal, tracks the first open request, and renders the modal conditionally inside React.Suspense.

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

Merge Risk: ⚪ Minimal · up to e77cc

The login modal and libraries overlay now load on first use, reducing initial client bundle size while preserving their open, close, and subsequent-open behavior. No merge-blocking risk remains.

Suggested reviewers: abeuty, tannerlinsley

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: lazy-loading the global login and libraries overlays.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/lazy-global-overlays

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.

@tannerlinsley tannerlinsley added the source-audit Tracked by the automated source audit label Sep 8, 2026
@LadyBluenotes
LadyBluenotes merged commit 362c620 into main Sep 8, 2026
7 checks passed
@LadyBluenotes
LadyBluenotes deleted the codex/lazy-global-overlays branch September 8, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source-audit Tracked by the automated source audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants