Skip to content

Commit b9979ee

Browse files
feat(frontend): optimize client-side bundle size for Onboarding Progress Tracker
1 parent 4b9caf0 commit b9979ee

7 files changed

Lines changed: 475 additions & 464 deletions

File tree

frontend/src/app/(public)/register/page.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
11
import RegistrationForm from "@/components/RegistrationForm";
22
import Link from "next/link";
33
import GuestGuard from "@/components/GuestGuard";
4-
import { OnboardingProgressTracker, type OnboardingStep } from "@/components/OnboardingProgressTracker";
4+
import dynamic from "next/dynamic";
5+
import OnboardingTrackerSkeleton from "@/components/OnboardingTrackerSkeleton";
6+
import type { OnboardingStep } from "@/components/OnboardingProgressTracker";
7+
8+
/**
9+
* Lazy-load the tracker so its JS bundle (including framer-motion) is only
10+
* fetched after the page paints — the skeleton renders instantly in its place.
11+
*/
12+
const OnboardingProgressTracker = dynamic(
13+
() => import("@/components/OnboardingProgressTracker").then((m) => m.OnboardingProgressTracker),
14+
{
15+
ssr: false,
16+
loading: () => (
17+
<OnboardingTrackerSkeleton
18+
stepCount={5}
19+
loadingLabel="Loading onboarding steps…"
20+
/>
21+
),
22+
},
23+
);
524

625
/**
726
* Demo steps shown on the registration page so users understand the full

0 commit comments

Comments
 (0)