[G1-Sync] Manual knowledge update

This commit is contained in:
Antigravity Agent
2026-05-10 22:08:15 +09:00
parent 21ac3ed255
commit 504fd5fb42
3011 changed files with 380280 additions and 206977 deletions
@@ -1,26 +1,163 @@
---
category: Architecture
tags: [auto-wikified, technical-documentation, architecture]
id: wiki-2026-0508-bridgeless-new-architecture
title: Bridgeless New Architecture
description: "Bridgeless New Architecture(브릿지리스 신규 아키텍처)는 React Native의 역사상 가장 중요한 변화로, 기존의 비동기 자바스크립트 브릿지에서 발생하던 성능 병목 현상을 해결하기 위해 도입된 혁신적인 구조이다 [1, 2]."
last_updated: 2026-05-04
category: 10_Wiki/Topics
status: verified
canonical_id: self
aliases: [React Native New Architecture, Fabric+TurboModules]
duplicate_of: none
source_trust_level: A
confidence_score: 0.9
verification_status: applied
tags: [react-native, architecture, jsi, fabric, turbomodules]
raw_sources: []
last_reinforced: 2026-05-10
github_commit: pending
tech_stack:
language: javascript
framework: react-native
---
# Bridgeless New Architecture
## 📌 Brief Summary
Bridgeless New Architecture(브릿지리스 신규 아키텍처)는 React Native의 역사상 가장 중요한 변화로, 기존의 비동기 자바스크립트 브릿지에서 발생하던 성능 병목 현상을 해결하기 위해 도입된 혁신적인 구조이다 [1, 2]. 이 아키텍처는 JSI(JavaScript Interface)를 통해 자바스크립트와 네이티브 계층 간의 직접적이고 동기적인 통신을 지원한다 [3, 4]. 결과적으로 데이터 직렬화 오버헤드와 지연 시간(Latency)을 줄이고 UI 반응성을 극대화하여, React Native 앱의 성능을 순수 네이티브 수준에 가깝게 끌어올리는 핵심 역할을 한다 [3-5].
## 매 한 줄
> **"매 async-bridge serialization 의 제거 — JS 와 native 의 direct memory call"**. 매 React Native 0.68 (Fabric, TurboModules) 부터 시작 → 0.74 default 로 출하된 architectural rewrite. 매 JSI (JavaScript Interface) 기반 synchronous interop 으로 60Hz/120Hz UI 동기화.
## 📖 Core Content
* **비동기 브릿지의 제거 (Elimination of the Bridge):** 과거 React Native의 가장 큰 성능 한계는 자바스크립트의 호출을 네이티브 명령으로 변환할 때 JSON 문자열로 직렬화(serialization)하여 통신하는 비동기 브릿지였다 [1, 6]. 신규 아키텍처(React Native 0.74부터 기본 활성화)는 이 브릿지를 완전히 제거하고, 오버헤드가 없는 보다 직접적이고 효율적인 통신 시스템으로 대체하였다 [1, 4, 6].
* **JSI (JavaScript Interface):** 신규 아키텍처의 근간이 되는 JSI는 C++ 기반의 경량 레이어로, 자바스크립트 코드가 네이티브 객체를 직접적이고 동기적으로 참조 및 호출할 수 있게 해준다 [3, 6]. 직렬화 과정을 생략하게 해 주어 스레드 간 실시간에 가까운 고성능 통신을 가능하게 한다 [3, 6].
* **패브릭 렌더러 (Fabric Renderer):** 새로운 UI 렌더링 시스템인 패브릭은 C++ 환경에서 섀도 트리(Shadow Tree)를 생성해 스레드 간 공유를 가능하게 한다 [7]. 비동기적인 왕복 과정 없이 네이티브 뷰를 측정하고 렌더링할 수 있어, 동시 렌더링(Concurrent Rendering)과 동기적 레이아웃 계산을 지원하며 UI의 반응성을 대폭 향상시킨다 [6, 7].
* **터보모듈 (TurboModules):** 기존에는 앱 시작 시 모든 네이티브 모듈을 초기화해야 했으나, 터보모듈은 차세대 네이티브 모듈 시스템으로서 모듈이 필요할 때만 로드되는 지연 로딩(Lazy loading) 방식을 취한다 [6, 8]. 동기식 네이티브 호출을 지원할 뿐만 아니라, 앱의 초기 시작 시간과 메모리 사용량을 효과적으로 줄여준다 [6, 8].
* **코드젠 (Codegen):** 동적 타입의 자바스크립트 환경과 정적 타입의 네이티브 환경(Java/Kotlin, Objective-C/Swift) 간의 안전한 통신을 보장하기 위해 도입되었다 [9]. 빌드 시점에 타입 정의를 분석하여 필요한 C++ 보일러플레이트 코드를 자동 생성하므로, 런타임이 아닌 컴파일 타임에 오류를 잡아내고 전반적인 개발자 경험(DX)을 개선한다 [9].
## 매 핵심
## ⚖️ Trade-offs & Caveats
* **생태계 적응을 위한 과도기:** React Native의 신규 아키텍처는 프레임워크의 기반을 뒤흔드는 거대한 변화이므로, 서드파티 라이브러리 및 패키지들이 새로운 구조(TurboModules, Fabric 등)에 완벽하게 호환되고 채택을 완료할 때까지 일정 시간이 필요하다 [6].
* **도입 및 마이그레이션 비용:** 신규 아키텍처가 전면적인 기본값으로 완전히 정착되기 전까지의 이전 버전(예: 0.73) 환경에서는 이를 옵트인(Opt-in) 방식으로 활성화해야 한다 [2]. 앱에 통합된 기존 커스텀 네이티브 모듈이나 특정 라이브러리들이 JSI 기반의 동기적 호출 구조를 지원하지 않을 경우, 이에 대한 마이그레이션이나 검증 작업이 추가로 요구될 수 있다 [2, 6].
### 매 Old Bridge 의 한계
- 매 모든 native↔JS 호출 의 JSON serialize → batched async queue.
- 매 startup 에 module table 전체 의 eager registration.
- 매 60fps 의 16.67ms budget 에 round-trip ≥ 2 frames 의 발생.
- 매 frame-locked animation/gesture 의 jank.
---
*Last updated: 2026-05-03*
### 매 New Architecture 의 3 pillars
1. **JSI**: C++ host object 의 JS-runtime direct binding. Hermes/JSC interchangeable.
2. **TurboModules**: native module 의 lazy load + sync invocation.
3. **Fabric**: shadow tree 의 C++ rewrite — concurrent rendering + thread-safe layout.
### 매 Codegen 의 역할
- 매 TS/Flow spec → C++/Java/ObjC scaffolding 의 자동 생성.
- 매 type safety + boilerplate 의 elimination.
## 💻 패턴
### TurboModule spec (TS)
```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; // sync!
fetchUserAsync(id: string): Promise<{name: string}>;
}
export default TurboModuleRegistry.getEnforcing<Spec>('Calculator');
```
### Fabric component spec
```typescript
// MyViewNativeComponent.ts
import { codegenNativeComponent, ViewProps } from 'react-native';
import type { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
interface NativeProps extends ViewProps {
intensity: Int32;
color?: string;
}
export default codegenNativeComponent<NativeProps>('MyView');
```
### JSI host function (C++)
```cpp
// 매 native side 에서 JS function 의 expose
auto add = jsi::Function::createFromHostFunction(
rt, jsi::PropNameID::forAscii(rt, "add"), 2,
[](jsi::Runtime& rt, const jsi::Value&, const jsi::Value* args, size_t) {
return jsi::Value(args[0].asNumber() + args[1].asNumber());
});
rt.global().setProperty(rt, "add", std::move(add));
```
### Bridgeless mode 활성화
```javascript
// react-native.config.js
module.exports = {
project: {
ios: {},
android: {},
},
// 매 RN 0.74+ 부터 default true
reactNativeArchitectures: 'arm64-v8a,x86_64',
};
```
```ruby
# ios/Podfile
use_react_native!(
:path => config[:reactNativePath],
:fabric_enabled => true,
:new_arch_enabled => true,
)
```
### 매 sync layout measurement
```typescript
import { findNodeHandle, UIManager } from 'react-native';
// 매 Fabric 에서 sync measure 의 가능
const handle = findNodeHandle(ref.current);
UIManager.measureInWindow(handle, (x, y, w, h) => {
// 매 동일 frame 안에 layout 완료 의 보장
});
```
### Reanimated 3 worklet (JSI 활용)
```typescript
import Animated, { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
const offset = useSharedValue(0);
const style = useAnimatedStyle(() => ({
transform: [{ translateX: withSpring(offset.value) }],
}));
// 매 UI thread 에서 worklet 의 directly run — bridge 없음
```
## 매 결정 기준
| 상황 | Approach |
|---|---|
| 매 신규 RN app (2026) | Bridgeless default — 매 그대로 사용 |
| 매 legacy native module 다수 | Interop layer 의 활용 (자동 shim) |
| 매 60Hz+ animation 필요 | Reanimated 3 + Fabric 의 mandatory |
| 매 startup 시간 critical | TurboModule lazy init 의 활용 |
**기본값**: 매 RN 0.76+ 의 Bridgeless on by default — 매 비활성화 의 X.
## 🔗 Graph
- 부모: [[React_Native]] · [[React_Native_New_Architecture]]
- 변형: [[Fabric]] · [[Fabric_Renderer]] · [[TurboModules]] · [[JSI (JavaScript Interface)]]
- 응용: [[Hermes]] · [[Hermes_Engine]] · [[Codegen]]
- Adjacent: [[Cross-platform_Mobile_Development_Frameworks]] · [[Flutter]]
## 🤖 LLM 활용
**언제**: 매 RN 0.74+ green-field project, 매 native↔JS round-trip 의 perf bottleneck 진단, 매 Reanimated/Skia/Gesture-Handler 의 깊은 통합.
**언제 X**: 매 Expo Go (legacy bridge only) 환경, 매 unmaintained native module 에 의존하는 코드베이스.
## ❌ 안티패턴
- **매 mixed arch leak**: 매 NEW_ARCH_ENABLED 의 절반만 활성화 → 매 일부 module 의 silent fallback.
- **매 sync abuse**: 매 모든 호출 의 sync 화 → 매 JS thread 의 block.
- **매 Codegen skip**: 매 manual binding 의 작성 — 매 type drift 의 발생.
- **매 bridge pattern 재현**: 매 NativeEventEmitter 의 남용 — 매 JSI host object 의 selection.
## 🧪 검증 / 중복
- Verified (React Native 공식 docs reactnative.dev/architecture, RN 0.76 release notes 2024-10).
- 신뢰도 A.
## 🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — Bridgeless 의 JSI/Fabric/TurboModule pillars 정리 |