Skip to content

feat: P1 번들 최적화 - Shiki dynamic import 및 Barrel imports 제거#103

Merged
ryu9663 merged 1 commit intomainfrom
feat/p1-bundle-optimization
Jan 18, 2026
Merged

feat: P1 번들 최적화 - Shiki dynamic import 및 Barrel imports 제거#103
ryu9663 merged 1 commit intomainfrom
feat/p1-bundle-optimization

Conversation

@ryu9663
Copy link
Owner

@ryu9663 ryu9663 commented Jan 18, 2026

Summary

  • Shiki Dynamic Import: Code.tsx에서 static import → dynamic import로 변경하여 초기 번들 사이즈 감소
  • Barrel Imports 제거: src/types/index.ts 삭제 및 19개 파일 직접 import로 변경하여 Tree-shaking 최적화

Changes

Shiki Dynamic Import (bundle-dynamic-imports)

  • 파일: src/app/post/[id]/Markdown/_components/Code.tsx
  • 변경: import { codeToHtml } from "shiki"await import("shiki")
  • 효과: shiki 라이브러리(~150KB)가 코드 블록 렌더링 시에만 로드

Barrel Imports 제거 (bundle-barrel-imports)

  • 삭제: src/types/index.ts
  • 변경: 19개 파일의 import 경로 직접 지정
    • HeadingType@/types/headingType
    • PostType, PostWithoutMarkdownType@/types/apiResponseType
    • SearchParamsType@/types/nextSegmentType

Test plan

  • 빌드 성공 확인 (pnpm build)
  • TypeScript 컴파일 오류 없음
  • 33개 페이지 정상 생성

🤖 Generated with Claude Code

## Changes

### Shiki Dynamic Import
- `Code.tsx`에서 static import → dynamic import로 변경
- 코드 블록이 있는 포스트에서만 shiki 라이브러리 로드
- 초기 번들 사이즈 감소 효과

### Barrel Imports 제거
- `src/types/index.ts` 삭제
- 19개 파일의 import를 직접 경로로 변경
  - HeadingType → @/types/headingType
  - PostType, PostWithoutMarkdownType → @/types/apiResponseType
  - SearchParamsType → @/types/nextSegmentType
- Tree-shaking 최적화 활성화

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Jan 18, 2026

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

Project Deployment Review Updated (UTC)
blog Building Building Preview, Comment Jan 18, 2026 5:43am

@ryu9663 ryu9663 merged commit 2c0bcd9 into main Jan 18, 2026
2 checks passed
@ryu9663 ryu9663 deleted the feat/p1-bundle-optimization branch January 18, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant