mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 06:06:10 +00:00
fix(insights): load the intraday pulse chart through the shared chart runtime
The pulse page imported the intraday area chart directly, so its `from "recharts"` import minted a second recharts fingerprint chunk and pushed total client JS past its budget. Route it through the shared chart-runtime barrel via the same single next/dynamic boundary every other chart uses, so recharts stays one shared chunk.
This commit is contained in:
1 parent
ba5a17a54e
commit
af4cad46fe
2 files changed
+16
-1
No files matched your search
@@ -20,7 +20,21 @@ import { MetricTargetSummary } from "@/components/insights/metric-target-summary
|
||||
import { EcgCrossLink } from "@/components/insights/ecg-cross-link";
|
||||
import { SubPageShell } from "@/components/insights/sub-page-shell";
|
||||
import { TileHeader } from "@/components/insights/tile-header";
|
||||
import { IntradayPulseChart } from "@/components/insights/intraday-pulse-chart";
|
||||
import dynamic from "next/dynamic";
|
||||
import { ChartSkeleton } from "@/components/charts/chart-skeleton";
|
||||
|
||||
// Load the intraday area chart through the shared chart-runtime boundary (the
|
||||
// one recharts chunk), not as a direct import — a direct `from "recharts"`
|
||||
// import would mint a second recharts fingerprint chunk and trip the bundle
|
||||
// budget. Same `dynamic(() => import("@/components/charts/chart-runtime"))`
|
||||
// pattern every other chart uses.
|
||||
const IntradayPulseChart = dynamic(
|
||||
() =>
|
||||
import("@/components/charts/chart-runtime").then((mod) => ({
|
||||
default: mod.IntradayPulseChart,
|
||||
})),
|
||||
{ ssr: false, loading: () => <ChartSkeleton /> },
|
||||
);
|
||||
import {
|
||||
getAgeFromDateOfBirth,
|
||||
getPersonalizedPulseTarget,
|
||||
|
||||
@@ -42,3 +42,4 @@ export { DoseStrengthCurve } from "@/components/medications/dose-strength-curve"
|
||||
export { DrugLevelChart } from "@/components/medications/drug-level-chart";
|
||||
export { EfficacyChart } from "@/components/medications/detail/efficacy/efficacy-chart";
|
||||
export { AssessmentHistoryChart } from "@/components/mental-health/assessment-history-chart";
|
||||
export { IntradayPulseChart } from "@/components/insights/intraday-pulse-chart";
|
||||
Reference in new issue
Block a user