Skip to content

perf(dashboard): lazy-load echarts implementations - #1016

Closed
janburzinski wants to merge 1 commit into
mainfrom
cursor/perf-lazy-load-echarts-624f
Closed

janburzinski wants to merge 1 commit into
mainfrom
cursor/perf-lazy-load-echarts-624f

Conversation

@janburzinski

@janburzinski janburzinski commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Slice 5 of the PR 984 split: lazy-load ECharts implementations. Merge independently — do not wait for PostHog/Three/Cal/Kiwi (slice 6) or GEO server-scope (#1015).

Sync wrappers stay on the public import path. Each chart's -impl loads on demand through React.lazy + LazyChartBoundary (SSR placeholder, then Suspense). Declarative parts (Area, Brush, …) live in -parts / echarts-brush-part so compound-component children do not pull ECharts into the initial JS.

In scope

  • All four charts (area, bar, line, pie) + shared Brush + LazyChartBoundary
  • Review fixes from perf(dashboard): cut RPC fan-out, bundle size and backend latency #984 that travel with the impls: ActiveDot rest opacity, default-tooltip effect deps, brush live-handler useLayoutEffect, skeleton placeholder
  • Unused FC leftover after moving markers into -parts

Out of scope

Success metric: Network — echarts-*-impl (and the ECharts vendor they pull) not in the initial JS of /geo or Home. The impl chunk loads when the chart is needed. Measure this chunk's Initial-JS delta. Not /geo JS 4.67→3.95 MB (that is a checkpoint after this slice and slice 6 + editor lazy).

Extracted from closed #984 @ 15c45339 onto current main (#1010 / #1009). Not stacked on #1015.

Review with copy/rename detection (git diff -C20 origin/main); ~9k lines moved, not new. Cubic previously skipped the impls as "too large".

Screenshot/Recording (if applicable)

N/A — no visual redesign. Charts still hydrate into the same layout via the LazyChartBoundary skeleton. No browser demo attached.

Checklist
  • I ran a self-review before opening this PR
  • I ran formatting/linting/type checks locally
  • I updated docs when behavior or setup changed
  • I only added comments where the logic is not obvious
  • I have used conventional commits for the PR title and commit messages
  • I did not use AI to write the code in this PR or have disclosed that I did
Open in Web Open in Cursor 

Summary by cubic

Lazy-loads ECharts chart implementations so ECharts is no longer in the initial JS of /geo or Home. The four chart wrappers stay synchronous; each -impl chunk loads on demand via React.lazy and LazyChartBoundary, which renders an SSR-safe skeleton until hydration.

Notes for review

  • Declarative parts (Area, Brush, etc.) moved to -parts modules so compound-component children don't pull ECharts into the initial JS.
  • Sync wrappers keep the public import path unchanged.
  • Includes review fixes from perf(dashboard): cut RPC fan-out, bundle size and backend latency #984: ActiveDot rest opacity, default-tooltip effect deps, brush live-handler useLayoutEffect, and the skeleton placeholder.
  • Review with copy/rename detection — git diff -C20 origin/main; ~9k lines moved, not new.

Written for commit 41debf3. Summary will update on new commits.

Review in cubic

Keep the four chart wrappers sync and load ECharts implementations on
demand via LazyChartBoundary. Shared Brush and null-marker parts stay
out of the initial JS so cartesian and pie charts split the same way.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
notra Error Error Sep 11, 2026 5:26pm UTC
4 Skipped Deployments
Project Deployment Actions Updated
notra-agent Skipped Skipped Sep 11, 2026 5:26pm UTC
notra-onboarding-agent Skipped Skipped Sep 11, 2026 5:26pm UTC
notra-ui Skipped Skipped Sep 11, 2026 5:26pm UTC
notra-web Skipped Skipped Sep 11, 2026 5:26pm UTC

Request Review

@github-actions github-actions Bot added apps/dashboard Changes files in apps/dashboard priority/normal Issue priority or pull request review urgency; maintainers decide type/feature PR change classification labels Sep 11, 2026
@github-actions

Copy link
Copy Markdown

React Doctor found 1 new issue in 1 file · 1 error · score 73 / 100 (Needs work) · 1 fixed · vs main

Errors

Reviewed by React Doctor for commit 41debf3. See inline comments for fixes.

selectedSector,
selectSector,
};
}, [live, pie?.isClickable, selectedSector, selectSector]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-hooks-js/refs (error)

This component misses React Compiler's automatic memoization & re-renders more than it should: Cannot access refs during render. Rewrite the flagged code so the compiler can optimize it.

Fix → React refs are values that are not needed for rendering. Refs should only be accessed outside of render, such as in event handlers or effects. Accessing a ref value (the current property) during render can cause your component not to update as expected (https://react.dev/reference/react/useRef).

Docs

This branch had an error being deployed

1 failed and 4 inactive deployments
Preview – notra — 41debf33 Deployed Sep 11, 2026 by vercel[bot]
Preview – notra-agent — 41debf33 Deployed Sep 11, 2026 by vercel[bot]
Preview – notra-ui — 41debf33 Deployed Sep 11, 2026 by vercel[bot]
Preview – notra-onboarding-agent — 41debf33 Deployed Sep 11, 2026 by vercel[bot]
Preview – notra-web — 41debf33 Deployed Sep 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apps/dashboard Changes files in apps/dashboard priority/normal Issue priority or pull request review urgency; maintainers decide type/feature PR change classification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant