docs(10_Wiki): 위키 전체 재구성 — Topic_* 폴더를 4개 카테고리로 통합 + 대규모 중복 제거
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
This commit is contained in:
@@ -0,0 +1,152 @@
|
||||
---
|
||||
id: wiki-2026-0508-new-architecture
|
||||
title: New Architecture (React Native Fabric/TurboModules)
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [Fabric, TurboModules, RN New Arch, React Native New Architecture]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [react-native, mobile, architecture, jsi, fabric]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: typescript
|
||||
framework: react-native-0.77
|
||||
---
|
||||
|
||||
# New Architecture (React Native)
|
||||
|
||||
## 매 한 줄
|
||||
> **"매 RN의 async-bridge JSON 통신을 JSI 기반 동기 C++ binding으로 교체한 ground-up rewrite."**. 2018 발표, 2024 RN 0.76부터 default, 2026 현재 RN 0.77+에서 legacy bridge는 deprecated. Fabric (renderer) + TurboModules (native modules) + Codegen (typed interface) 의 3개 pillar.
|
||||
|
||||
## 매 핵심
|
||||
|
||||
### 매 4 pillar
|
||||
- **JSI (JavaScript Interface)**: C++ API로 JS engine (Hermes/JSC/V8)과 native가 직접 binding — 매 JSON serialization 제거.
|
||||
- **Fabric**: 매 new renderer — shadow tree를 C++로, concurrent rendering, synchronous layout.
|
||||
- **TurboModules**: 매 lazy-load native modules — JSI 통한 direct invocation, no bridge.
|
||||
- **Codegen**: 매 spec.ts → native interface (Java/ObjC/C++) 자동 생성.
|
||||
|
||||
### 매 legacy bridge 문제점
|
||||
- 모든 native call이 JSON serialize → async queue → deserialize.
|
||||
- Synchronous UI update 불가 (text input lag).
|
||||
- Type safety 없음 — runtime error.
|
||||
- 모든 native module이 startup에 load — slow cold start.
|
||||
|
||||
### 매 응용
|
||||
1. Meta Threads — Fabric으로 60fps scroll.
|
||||
2. Shopify Mobile — TurboModules로 startup 30% 단축.
|
||||
3. Microsoft Teams Mobile — Codegen으로 C++ shared core ↔ RN bridge.
|
||||
|
||||
## 💻 패턴
|
||||
|
||||
### TurboModule spec (TypeScript)
|
||||
```typescript
|
||||
// NativeCalculator.ts
|
||||
import type { TurboModule } from 'react-native';
|
||||
import { TurboModuleRegistry } from 'react-native';
|
||||
|
||||
export interface Spec extends TurboModule {
|
||||
add(a: number, b: number): number;
|
||||
multiply(a: number, b: number): Promise<number>;
|
||||
readonly getConstants: () => { PI: number };
|
||||
}
|
||||
|
||||
export default TurboModuleRegistry.getEnforcing<Spec>('Calculator');
|
||||
```
|
||||
|
||||
### Codegen-generated Android (Kotlin)
|
||||
```kotlin
|
||||
// Auto-generated from spec
|
||||
abstract class NativeCalculatorSpec(ctx: ReactApplicationContext)
|
||||
: ReactContextBaseJavaModule(ctx), TurboModule {
|
||||
@ReactMethod(isBlockingSynchronousMethod = true)
|
||||
abstract fun add(a: Double, b: Double): Double
|
||||
}
|
||||
|
||||
// User implementation
|
||||
class CalculatorModule(ctx: ReactApplicationContext)
|
||||
: NativeCalculatorSpec(ctx) {
|
||||
override fun getName() = "Calculator"
|
||||
override fun add(a: Double, b: Double) = a + b
|
||||
}
|
||||
```
|
||||
|
||||
### Fabric custom component (iOS)
|
||||
```cpp
|
||||
// MyViewComponentDescriptor.h
|
||||
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
||||
|
||||
namespace facebook::react {
|
||||
class MyViewShadowNode final
|
||||
: public ConcreteViewShadowNode<MyViewComponentName,
|
||||
MyViewProps,
|
||||
MyViewEventEmitter> {
|
||||
public:
|
||||
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
||||
};
|
||||
using MyViewComponentDescriptor = ConcreteComponentDescriptor<MyViewShadowNode>;
|
||||
}
|
||||
```
|
||||
|
||||
### JSI direct binding (synchronous)
|
||||
```cpp
|
||||
// Install host function on JS runtime
|
||||
runtime.global().setProperty(
|
||||
runtime, "nativeCompute",
|
||||
jsi::Function::createFromHostFunction(
|
||||
runtime, jsi::PropNameID::forAscii(runtime, "nativeCompute"), 1,
|
||||
[](jsi::Runtime& rt, const jsi::Value&, const jsi::Value* args, size_t) {
|
||||
double x = args[0].asNumber();
|
||||
return jsi::Value(heavyCompute(x)); // sync, no bridge
|
||||
}));
|
||||
```
|
||||
|
||||
### Enable New Arch (RN 0.77)
|
||||
```bash
|
||||
# iOS
|
||||
RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
|
||||
# Android (gradle.properties)
|
||||
newArchEnabled=true
|
||||
hermesEnabled=true
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| New RN project (2026) | New Arch + Hermes default |
|
||||
| Legacy app w/ many native modules | gradual interop migration |
|
||||
| Heavy synchronous native call | TurboModule (JSI) |
|
||||
| Custom view (canvas, video) | Fabric component |
|
||||
| Sharing C++ core (cross-platform) | JSI host objects |
|
||||
|
||||
**기본값**: New Arch enabled — 매 2026 default, legacy bridge는 deprecated.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[Concurrent_Rendering]]
|
||||
- 응용: [[Hermes]] · [[Fabric_Renderer]] · [[Hydration]]
|
||||
- Adjacent: [[FFI]] · [[BLoC]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: RN performance critical (60fps list, real-time UI), native module 다수, C++ shared core.
|
||||
**언제 X**: simple JS-only RN app, legacy 0.6x 유지보수만, Expo Go (managed) — 매 자동 적용.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Mixing legacy + new arch native modules without interop layer**: build break.
|
||||
- **Spec drift**: spec.ts 변경 후 codegen 재실행 안 함 — runtime crash.
|
||||
- **Sync JSI call from main thread**: UI block — async/queue로 offload.
|
||||
- **Skipping Hermes**: New Arch는 Hermes 가정 (JSC도 가능하지만 perf 저하).
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (React Native docs 2026, Meta engineering blog, RN 0.77 release notes).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — RN New Architecture (JSI/Fabric/TurboModules/Codegen) |
|
||||
Reference in New Issue
Block a user