Lazy-load report pages and split vendor chunks #602

Opentnakamura wants to merge 3 commits into main from perf/lazy-report-routes· opened 3 days ago
+70−6
tnakamura commented 3 days agoAuthor

Why

Lighthouse on the overview page is at 41. The main bundle is 2.3 MB because every report (and echarts, deck.gl, the PDF exporter) is imported eagerly from App.tsx.

What

  • Switch to createBrowserRouter with a single reports/:slug route
  • Each report is loaded on demand with React.lazy + a dynamic import, and prefetched on hover
  • manualChunks moves third-party code into its own vendor chunk so it caches across deploys
  • Build target set to es2015 to match the support matrix on the pricing page

Results

index-*.js went from 2.3 MB to 180 kB locally. Raised the chunk size warning limit since the vendor chunk trips the default 500 kB.

tnakamura added 3 commits 3 days ago
Move to createBrowserRouterc64f031
Lazy-load reports with dynamic importsc54f018
Split vendor chunk and lower build targetc84f064

Review required

Review the changes, then submit to get graded.

Some checks haven’t completed yet

1 check: dojo / review-grader

Keyboard shortcuts

Site-wide

Focus the search bar
/
Show this dialog
?

Pull request

Move to the next file
j
Move to the previous file
k
Filter changed files
t
Comment on the selected lines
c
Select a range of lines
Shiftclick