Bước 1 — Native Module:
- Chuyển từ RCTBridgeModule (iOS) / ReactContextBaseJavaModule (Android) sang TurboModule spec.
- Viết file spec TypeScript NativeFoo.ts với interface Spec extends TurboModule.
- Chạy bundle exec pod install → Codegen sinh RNFooSpec.h/.mm.
- iOS: implement class kế thừa <RNFooSpec> protocol.
- Android: extends NativeFooSpec abstract class.
Bước 2 — Native Component (custom view):
- iOS: RCTViewManager → RCTComponentViewProtocol + Fabric component descriptor.
- Android: ViewManager → RCTViewManager (Fabric variant) + ViewProps C++ struct.
- Codegen type: "components" cho component spec.
Bước 3 — Update package.json:
"codegenConfig": {
"name": "RNFooSpec",
"type": "all",
"jsSrcsDir": "src"
}Bước 4 — Test compat:
- expo doctor hoặc npx react-native doctor báo issue.
- Build app với RCT_NEW_ARCH_ENABLED=1 (iOS) / newArchEnabled=true (Android gradle.properties).
- Test toàn bộ public API, đặc biệt method sync (vốn async ở bridge).
- Run trên cả Hermes và JSC.
Bước 5 — Document:
- README ghi version RN tối thiểu hỗ trợ.
- CHANGELOG cảnh báo breaking change (nếu API JS có thay đổi).
- Drop legacy support sau 2–3 minor version để clean codebase.
Resources: RN New Arch Working Group có spreadsheet tracking lib status (✅ supported, 🚧 in-progress, ❌ unsupported).