refactor(debug): DebugTools 허브 패턴 — 단일 lazy import로 통합

- debug/index.tsx: 모든 디버그 도구 조합 export
- KoreaMap: lazy import 1줄 + JSX 1줄만 유지
- 디버그 도구 추가/제거 시 debug/index.tsx만 수정
This commit is contained in:
htlee 2026-03-26 10:46:05 +09:00
부모 364a34ce10
커밋 7fe9e048bf
2개의 변경된 파일29개의 추가작업 그리고 5개의 파일을 삭제

파일 보기

@ -201,10 +201,10 @@ const FILTER_I18N_KEY: Record<string, string> = {
cnFishing: 'filters.cnFishingMonitor',
};
// [DEBUG] 좌표 디버그 — DEV에서만 동적 로드, 프로덕션 번들에서 완전 제거
// [DEBUG] 개발용 도구 — DEV에서만 동적 로드, 프로덕션 번들에서 완전 제거
import { lazy, Suspense } from 'react';
const DevCoordDebug = import.meta.env.DEV
? lazy(() => import('./debug/DevCoordDebug'))
const DebugTools = import.meta.env.DEV
? lazy(() => import('./debug'))
: null;
export function KoreaMap({ ships, allShips, aircraft, satellites, layers, osintFeed, currentTime, koreaFilters, transshipSuspects, cableWatchSuspects, dokdoWatchSuspects, dokdoAlerts, vesselAnalysis, groupPolygons, hiddenShipCategories, hiddenNationalities, externalFlyTo, onExternalFlyToDone, opsRoute }: Props) {
@ -615,8 +615,8 @@ export function KoreaMap({ ships, allShips, aircraft, satellites, layers, osintF
>
<NavigationControl position="top-right" />
{/* [DEBUG] Ctrl+Click 좌표 표시 — 프로덕션 번들에서 완전 제거 */}
{DevCoordDebug && <Suspense><DevCoordDebug mapRef={mapRef} /></Suspense>}
{/* [DEBUG] 개발용 도구 — 프로덕션 번들에서 완전 제거 */}
{DebugTools && <Suspense><DebugTools mapRef={mapRef} /></Suspense>}
<Source id="country-labels" type="geojson" data={countryLabelsGeoJSON()}>
<Layer

파일 보기

@ -0,0 +1,24 @@
/**
* [DEBUG] export
*
* / .
* KoreaMap에서는 lazy import.
* .
*/
import type { MapRef } from 'react-map-gl/maplibre';
import DevCoordDebug from './DevCoordDebug';
interface Props {
mapRef: React.RefObject<MapRef | null>;
}
export default function DebugTools({ mapRef }: Props) {
return (
<>
<DevCoordDebug mapRef={mapRef} />
{/* 디버그 도구 추가 시 여기에 한 줄 추가 */}
{/* <DevZoneOverlay mapRef={mapRef} /> */}
{/* <DevPerformance mapRef={mapRef} /> */}
</>
);
}