Skip to content

perf(ui): load PageViewer and MarkdownPreview eagerly to eliminate render waterfall#1180

Merged
perber merged 1 commit into
mainfrom
perf/eager-page-viewer
Jun 19, 2026
Merged

perf(ui): load PageViewer and MarkdownPreview eagerly to eliminate render waterfall#1180
perber merged 1 commit into
mainfrom
perf/eager-page-viewer

Conversation

@perber

@perber perber commented Jun 19, 2026

Copy link
Copy Markdown
Owner

Every page view requires both PageViewer and MarkdownPreview. Lazy loading them caused a 3-step sequential fetch (index → PageViewer → MarkdownPreview) on every page load. Making PageViewer eager pulls MarkdownPreview into the main bundle, eliminating the waterfall at the cost of a larger initial chunk (446 kB → 1261 kB unminified; 141 kB → 389 kB gzip). Total bytes transferred remain nearly identical.

…nder waterfall

Every page view requires both PageViewer and MarkdownPreview. Lazy loading them
caused a 3-step sequential fetch (index → PageViewer → MarkdownPreview) on every
page load. Making PageViewer eager pulls MarkdownPreview into the main bundle,
eliminating the waterfall at the cost of a larger initial chunk (446 kB → 1261 kB
unminified; 141 kB → 389 kB gzip). Total bytes transferred remain nearly identical.
Copilot AI review requested due to automatic review settings June 19, 2026 18:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the UI’s initial page render by removing a sequential lazy-load chain for the page view route. Since every page view always needs PageViewer (and it in turn needs MarkdownPreview), the change makes PageViewer an eager import so it lands in the main bundle and avoids a render-time waterfall.

Changes:

  • Stop lazily importing PageViewer and instead export it eagerly from the routes module.
  • Keep other route components lazily loaded while ensuring the common page-view path no longer incurs extra sequential chunk fetches.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@perber
perber merged commit 3fe0567 into main Jun 19, 2026
10 checks passed
@perber
perber deleted the perf/eager-page-viewer branch June 19, 2026 18:26
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.

2 participants