Conversation
클라이언트 전용 컴포넌트를 별도 entry point로 분리: - AgentCall, StartCallSection을 client.ts에서 export - React hooks를 사용하는 UI 컴포넌트 격리 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
React hooks(useTranslation)를 사용하므로 클라이언트 전용 마커 필수: - 서버 컴포넌트에서 직접 import 시 런타임 에러 방지 - React RFC #227 준수 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
BREAKING CHANGE: 클라이언트 컴포넌트 import 경로 변경 필요
- AgentCall, StartCallSection → fancall/client로 이동
- LiveRoomRepository, 타입, 스키마, i18n은 main에 유지
설계 철학 (aioia-core + React RFC #227):
- Main entry: 서버 안전 인프라 (React hooks 없음)
- Client entry: UI 컴포넌트 ('use client' 지시어)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
schemas entry 제거하고 client entry 추가:
- index: 서버 안전 코드 (배너 없음)
- client: 클라이언트 전용 ('use client' 배너 주입)
aioia-core PR #38 패턴 적용:
- rollupOptions.output.banner로 조건부 배너 주입
- dts 플러그인에 client.ts 포함
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
BREAKING CHANGE: Import 경로 변경
- schemas 서브패스 제거 (main으로 통합)
- locale 서브패스 제거 (main으로 통합)
- client 서브패스 추가 (UI 컴포넌트)
Before:
import { AgentCall } from "fancall"
import type { LiveRoom } from "fancall/schemas"
import { FANCALL_NS } from "fancall/locale"
After:
import { AgentCall } from "fancall/client"
import type { LiveRoom } from "fancall"
import { FANCALL_NS } from "fancall"
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This PR introduces significant changes by separating the fancall package's entry points into server-side and client-side, improving compatibility with React Server Components (RSC) environments. The application of industry-standard patterns to clarify the package structure is impressive. In particular, using the banner option in vite.config.ts to dynamically inject the 'use client' directive only into client entry points is a very clean and efficient solution. Overall, this is an excellent refactoring that will greatly enhance code quality. As one suggestion, please consider aligning the export style of the newly added client.ts file with other entry points like index.ts to improve consistency, as detailed in the specific comment.
|
🎉 This PR is included in version 0.4.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
요약
업계 표준 패턴 적용으로 fancall 패키지 구조를 재설계했습니다. 서버 안전 코드와 클라이언트 전용 코드를 명확히 분리하여 React Server Components(RSC) 환경과 호환성을 개선했습니다.
목적
다음 문제를 해결합니다:
주요 변경 사항
📦 Entry Point 분리
Main entry (
fancall):Client entry (
fancall/client) (NEW):🗂️ 구조 변경
fancall→ 클라이언트 + 서버 혼재fancall→ 서버 안전만fancall/schemas→ 타입 일부만fancall/locale→ i18n만fancall/client→ UI 컴포넌트🔄 Import 패턴 변경
🏗️ 기술적 근거
aiolia-core + React RFC #227 패턴 준용:
검증 완료:
테스트 체크리스트
Breaking Change 영향
라이브러리 사용자는 import 경로를 다음과 같이 업데이트해야 합니다:
from "fancall"from "fancall/client"from "fancall/schemas"from "fancall"from "fancall/locale"from "fancall"from "fancall"from "fancall"개선 효과
Before (문제)
서버 컴포넌트에서 Repository 사용 시:
After (해결)
🤖 Generated with Claude Code