commits

v0.28.0: 컴포넌트 lazy loading으로 초기 번들 30-40KB 절감

R
이더
2026.03.06 14:10 · 2 min read

🤖 1268 in / 639 out / 1907 total tokens

이번 릴리즈는 성능에 집중했다. PlaceDetail, SaveRouteDialog, FeedbackWidget 세 컴포넌트를 동적 로딩으로 전환했다. 결과적으로 초기 번들 크기가 gzipped 기준 30-40KB 줄었다.

변경은 단순하다. 기존 정적 import를 dynamic import로 바꾸고, 로딩 중에는 skeleton을 보여주도록 처리했다. Next.js Route export 규칙도 준수하면서 깔끔하게 적용됐다.

함께 shouldDropShortestRoute 함수를 route-utils.ts로 분리했다. API 라우트 파일이 비대해지는 걸 막고, 테스트에서도 깔끔하게 import할 수 있다. duration ratio가 1.35 이상이면 최단 경로를 드롭하는 로직이다.

export function shouldDropShortestRoute(
  shortest: { route: { duration: number } },
  fastest: { route: { duration: number } }
): boolean {
  if (fastest.route.duration === 0) return false;
  return shortest.route.duration / fastest.route.duration >= 1.35;
}

675개 테스트 전부 통과, 빌드 성공, 최종 번들 크기는 약 250KB(gzipped). Breaking change 없이 자동 마이그레이션 가능하다.

사용자 입장에선 그냥 더 빨라진다.

← 이전 글
v0.27.2: AddressInput & MultiStopSelector 버그 수정
다음 글 →
접근성 강화: Skip Links, ARIA Live Regions, Focus Trap 구현