perf: lazy load document PDF reader#763
Conversation
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
📝 WalkthroughWalkthroughThe PDF preview components in ChangesPDF viewer lazy loading
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/document-viewer-pdf-reader-lazy.test.ts (1)
12-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert both dynamic wrappers and
ssr: false.The test only checks for one generic dynamic import and one fallback string. It would still pass if either PDF component were removed or if
ssr: falsewere dropped; assert each named wrapper and its options explicitly.🤖 Prompt for 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. In `@tests/document-viewer-pdf-reader-lazy.test.ts` around lines 12 - 16, Update the test assertions around the dynamic PDF viewer imports to verify both named wrappers, NativePdfEmbed and PdfCanvasViewer, are present with their respective dynamic import paths and explicitly configured with ssr: false. Keep the existing loading fallback checks, but assert each component’s wrapper and options independently so removing either wrapper or its SSR setting causes the test to fail.
🤖 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.
Nitpick comments:
In `@tests/document-viewer-pdf-reader-lazy.test.ts`:
- Around line 12-16: Update the test assertions around the dynamic PDF viewer
imports to verify both named wrappers, NativePdfEmbed and PdfCanvasViewer, are
present with their respective dynamic import paths and explicitly configured
with ssr: false. Keep the existing loading fallback checks, but assert each
component’s wrapper and options independently so removing either wrapper or its
SSR setting causes the test to fail.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0d321b0d-fe40-4101-a199-47a3ba3df461
📒 Files selected for processing (2)
src/components/DocumentViewer.tsxtests/document-viewer-pdf-reader-lazy.test.ts
Pull request was closed
Merges the frontend document-viewer PDF chunking optimization from performance task: lazy-load PDF reader only when needed.
Summary by CodeRabbit
Performance Improvements
Bug Fixes