Files
meatbag/related-product/react_native_feasibility_assessment.md

2.8 KiB

Feasibility Assessment: Remaking Lite-Client Shells in React Native

This document evaluates the complexity and trade-offs of rebuilding the WhetForge stateless "lite-client" shells using React Native instead of Compose Multiplatform (CMP).


1. Feasibility Matrix

Platform Compose Multiplatform (CMP) React Native (RN) React Native Complexity
Android Phone Native Support Native Support Easy (First-class)
iOS Phone Native Support Native Support Easy (First-class)
Desktop (Win/Mac) Native Support (JVM) Supported (RN Windows/macOS) Medium (Slightly heavier, Microsoft-maintained)
Wear OS Watch Excellent (Compose for Wear OS) Very Poor (No official support) Hard (Requires custom native Android wrapping)
Apple watchOS Planned Very Poor (No official support) Hard (Requires custom native watchOS extension wrapping)

2. Platform-Specific Analysis

1. Smartwatches (The Core Wearable Challenge)

  • Compose Multiplatform: Google provides a dedicated, optimized library: Compose for Wear OS. It provides out-of-the-box widgets designed for round watches (scaling, circular lists, rotary input scrolling).
  • React Native: React Native does not natively compile or lay out for watchOS or Wear OS. While you can hack an RN app to run inside an Android Wear OS wrapper, the performance is poor, layout calculations do not adapt well to circular screens, and touch targets are difficult to optimize.

2. Network & VPN Integration (Tailscale Userspace)

  • Compose Multiplatform: Integrating low-level networking (like our Go-compiled userspace Tailscale proxy) is highly native. We call JVM/JNI Go bindings directly in Kotlin.
  • React Native: JavaScript cannot directly interface with JNI/Go binaries. We would have to write custom Native Modules (in Kotlin for Android and Swift for iOS) to manage the VPN lifecycle and forward events to the JavaScript thread.

3. Server-Driven UI (SDUI) Inflation

  • React Native (Winner): React Native is exceptionally good at SDUI. Because JavaScript is highly dynamic, parsing a JSON payload and dynamically mapping it to a dictionary of visual primitives (<View>, <Text>, <Button>) is extremely natural and fast.

3. Conclusion & Recommendation

  • If Phones & Desktops are the primary targets: Remaking the shells in React Native is highly viable. It would open the ecosystem to web/JS developers and make SDUI rendering extremely dynamic.
  • If Smartwatches (Wear OS / watchOS) are a core differentiator: Stick with Compose Multiplatform. The development overhead of trying to force React Native onto watch screens and maintaining custom Swift/Kotlin haptic wrappers outweighs any benefits of JavaScript development.