perf: lazy load page components and playground dialog#81
Conversation
React.lazy for ApiLayout, ApiPage, DocsLayout, DocsPage, LandingPage in App.tsx. Lazy load PlaygroundDialog in Layout.tsx — CodeMirror only loads when user opens the dialog. entry-client chunk: 1MB+ → 325KB (101KB gzip). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughApp and Layout components are updated to implement lazy loading. Route components and the API playground dialog now use ChangesLazy Loading with Suspense Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Shows skeleton loader during client-side navigation while lazy chunks load, instead of blank screen. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b55ef7d to
cb3c0fc
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/chronicle/src/server/App.tsx`:
- Around line 42-52: Server-rendered HTML can mismatch the client because
React.Suspense with ThemeSkeleton fallback may be rendered differently between
server and client; update App.tsx so server and client produce the same markup
during hydration by disabling Suspense fallback on the server or using an
SSR-friendly lazy loader. Concretely, detect server vs client (e.g., a
isHydrated or typeof window check) and: when running on server, render the lazy
children directly (ApiLayout/ApiPage or DocsLayout/DocsPage/LandingPage) instead
of wrapping them with Suspense fallback, or replace React.lazy usage with an
SSR-aware loader (e.g., loadable-components) so Suspense doesn't emit a fallback
on the client during hydration; ensure the changes touch the Suspense wrapper,
ThemeSkeleton, and how ApiPage/DocsPage/LandingPage are imported so server and
client markup match.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e7e3dcc8-581e-4272-8308-e712034f5f9c
📒 Files selected for processing (2)
packages/chronicle/src/server/App.tsxpackages/chronicle/src/themes/default/Layout.tsx
Lazy load Toc in default theme Page to reduce DocsPage chunk. Inline skeleton fallback for page Suspense boundary. Search lazy-loading skipped — breaks Vite splitting heuristic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Multiple APIs can share the same basePath, causing duplicate key warning. Use basePath + name for unique keys. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
React.lazyfor page components (ApiLayout,ApiPage,DocsLayout,DocsPage,LandingPage) inApp.tsxPlaygroundDialoginLayout.tsx— CodeMirror bundle only loads when user clicks "Test request"entry-client.js: 1MB+ → 325KB (101KB gzip), 68% reductionPlaygroundDialog(429KB) andApiPage(99KB) split into separate on-demand chunksTest plan
🤖 Generated with Claude Code