refactor(topics): 멀티 에이전트용 지식 재편 — _Common(공통 기본기) + Domain_* 구조
에이전트 8종(대화형/프로그래머 C·S/디자이너/설계자/기획자/QA/PD/PM)에게 [공통 기본 능력 + 롤별 Specialty] 2층으로 지식을 주입하기 위한 재분류. 문서 내용·포맷은 무수정, 폴더 이동만 (6,372개 문서 수 보존 확인). - Topic_Programming → Domain_Programming (내부 구조 보존) - Topic_Graphic → Domain_Design - Topic_Business → Domain_Product - Topic_General → Domain_General - _Common 신설: Math(구 Topic_Math_Specialty), Reasoning(구 General/From_Thinking & Reasoning), Reasoning_Creativity(구 General/From_창의성), Communication(Poetic_Blog_Writing + From_writing) - 타 도메인의 From_* 폴더는 유지 (출처 표기일 뿐, 이미 도메인에 맞게 분류된 문서) - 빈 폴더 정리 (memory/procedures) - 에이전트→폴더 매핑은 workspace의 .astra/agent-knowledge-map.json (9개 에이전트) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,170 @@
|
||||
---
|
||||
id: wiki-2026-0508-fabric
|
||||
title: Fabric
|
||||
category: 10_Wiki/Topics
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [React Native Fabric, Fabric Renderer, RN New Architecture]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
verification_status: applied
|
||||
tags: [react-native, fabric, renderer, mobile, jsi]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: cpp
|
||||
framework: react-native
|
||||
---
|
||||
|
||||
# Fabric
|
||||
|
||||
## 매 한 줄
|
||||
> **"매 Fabric 는 React Native 의 new renderer — JSI 기반 synchronous JS↔native 의 enables"**. 2018-2024 에 incrementally rolled out, RN 0.74+ 에서 default. 매 legacy bridge (async JSON serialization) 의 replace, 매 concurrent React features (Suspense, Transitions) 의 mobile 의 enable.
|
||||
|
||||
## 매 핵심
|
||||
|
||||
### 매 Architecture (vs Old Bridge)
|
||||
- **Old bridge**: JS thread ↔ Native thread async JSON messages. Serialize cost, no sync calls, list jank.
|
||||
- **Fabric**: JSI (JavaScript Interface) — JS engine (Hermes) 의 C++ HostObjects 의 direct access. Sync calls, shared memory, type-safe via codegen.
|
||||
|
||||
### 매 Components
|
||||
- **JSI**: lightweight C++ API for JS engines (Hermes/JSC). 매 binding의 base.
|
||||
- **Fabric Renderer (C++)**: shadow tree, layout (Yoga), commit phase. 매 cross-platform.
|
||||
- **TurboModules**: lazy-loaded native modules with codegen-typed interface.
|
||||
- **Codegen**: TS/Flow types → C++/Java/ObjC native code.
|
||||
- **Hermes**: default JS engine (faster startup, lower memory, bytecode).
|
||||
|
||||
### 매 응용
|
||||
1. React 18 concurrent features (Suspense, useTransition) on mobile.
|
||||
2. Synchronous measure/layout queries.
|
||||
3. Type-safe native module bindings.
|
||||
4. New Architecture only libs (Reanimated 3, Skia).
|
||||
|
||||
## 💻 패턴
|
||||
|
||||
### Enable New Architecture (RN 0.76+)
|
||||
```bash
|
||||
# Default ON in 0.76+; explicit:
|
||||
# ios/Podfile
|
||||
# RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
|
||||
|
||||
# android/gradle.properties
|
||||
newArchEnabled=true
|
||||
```
|
||||
|
||||
### Spec-driven Native Component (Codegen)
|
||||
```ts
|
||||
// MyViewNativeComponent.ts
|
||||
import type { ViewProps } from 'react-native';
|
||||
import type { Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
||||
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
||||
|
||||
export interface NativeProps extends ViewProps {
|
||||
color?: string;
|
||||
count?: WithDefault<Int32, 0>;
|
||||
}
|
||||
|
||||
export default codegenNativeComponent<NativeProps>('MyView');
|
||||
```
|
||||
|
||||
### TurboModule Spec
|
||||
```ts
|
||||
// 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 call (impossible on old bridge)
|
||||
greet(name: string): Promise<string>;
|
||||
}
|
||||
|
||||
export default TurboModuleRegistry.getEnforcing<Spec>('Calculator');
|
||||
```
|
||||
|
||||
### iOS TurboModule Implementation
|
||||
```objc
|
||||
// Calculator.mm
|
||||
#import "Calculator.h"
|
||||
|
||||
@implementation Calculator
|
||||
RCT_EXPORT_MODULE()
|
||||
|
||||
- (NSNumber *)add:(double)a b:(double)b {
|
||||
return @(a + b);
|
||||
}
|
||||
|
||||
- (std::shared_ptr<facebook::react::TurboModule>)
|
||||
getTurboModule:(const facebook::react::ObjCTurboModule::InitParams &)params {
|
||||
return std::make_shared<facebook::react::NativeCalculatorSpecJSI>(params);
|
||||
}
|
||||
@end
|
||||
```
|
||||
|
||||
### JSI Direct Binding (advanced)
|
||||
```cpp
|
||||
// C++ side
|
||||
runtime.global().setProperty(
|
||||
runtime, "nativeAdd",
|
||||
Function::createFromHostFunction(runtime,
|
||||
PropNameID::forAscii(runtime, "nativeAdd"), 2,
|
||||
[](Runtime& rt, const Value&, const Value* args, size_t) {
|
||||
return Value(args[0].asNumber() + args[1].asNumber());
|
||||
}));
|
||||
```
|
||||
|
||||
### Concurrent Features on RN
|
||||
```jsx
|
||||
import { useTransition, Suspense } from 'react';
|
||||
|
||||
function App() {
|
||||
const [isPending, startTransition] = useTransition();
|
||||
const [query, setQuery] = useState('');
|
||||
return (
|
||||
<>
|
||||
<TextInput onChangeText={(t) => startTransition(() => setQuery(t))} />
|
||||
<Suspense fallback={<Spinner />}>
|
||||
<Results query={query} />
|
||||
</Suspense>
|
||||
</>
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| New project (2026) | Fabric default (RN 0.76+) |
|
||||
| Legacy app | Migrate incrementally; interop layer |
|
||||
| Custom native view | Fabric component + codegen |
|
||||
| Sync native call | TurboModule (impossible old) |
|
||||
| Heavy animation | Reanimated 3 (Fabric-only) |
|
||||
|
||||
**기본값**: New Architecture ON, Hermes ON, codegen-driven specs.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[React Native]] · [[React]]
|
||||
- 변형: [[TurboModules]] · [[Hermes]] · [[JSI]]
|
||||
- 응용: [[React Native Skia]]
|
||||
- Adjacent: [[Concurrent React]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: RN new architecture migration, TurboModule/Fabric component authoring, JSI binding.
|
||||
**언제 X**: pure JS-only RN questions (state management, navigation library).
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **Mixing old bridge modules with Fabric without interop**: runtime crash.
|
||||
- **Skipping codegen**: hand-written specs drift from native; codegen 의 source of truth.
|
||||
- **JSI HostObject 의 long-running work**: blocks JS thread; offload to native thread.
|
||||
- **Old `NativeModules.X` API in new code**: TurboModuleRegistry 의 사용.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (React Native official docs — New Architecture, RFC 0588 Fabric).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — Fabric renderer / new arch full content |
|
||||
Reference in New Issue
Block a user