How shopify/react-native-skia works
Main Components Architecture
┌─ React Native Application ─────────────────────────────────────┐
• ┌─ React Native Skia ──────────────────────────────────┐ │
• ┌─ JavaScript/TypeScript Layer ─────────────────┐ │ │
• Components API │ │ │
• Animation System │ │ │
• DOM Renderer │ │ │
• ┘ │ │
• ┌─ Native Bridge ────────────────────────────────┐ │ │
• JSI Bindings │ │ │
• Native Module Interface │ │ │
• ┘ │ │
• ┌─ Platform-Specific Implementation ──────────────┐ │ │
• ┌─ iOS ─────────┐ ┌─ Android ────────┐ │ │ │
• Metal Context │ │ OpenGL Context │ │ │ │
• ┘ └─────────────────┘ │ │ │
• ┌─ Web ─────────┐ │ │ │
• WebGL Context │ │ │ │
• ┘ │ │ │
• ┘ │ │
• ┌─ Skia Engine ─────────────────────────────────┐ │ │
• Graphics Pipeline │ │ │
• Rendering Engine │ │ │
• Canvas Operations │ │ │
• ┘ │ │
• ┘ │
• ┘
Key Components to Highlight
a. JavaScript/TypeScript Layer:
• DOM API (/src/dom)
• Renderer (/src/renderer)
• Animation system (/src/animation)
• Component library (/src/renderer/components)
b. Native Bridge:
• JSI implementations (/cpp/jsi)
• Platform contexts (/cpp/rnskia)
• Native module specs (/src/specs)
c. Platform-Specific:
• iOS implementation (/ios)
• Android implementation (/android)
• Web implementation (/src/web)
d. Core Skia Integration:
• Skia types (/src/skia/types)
• Core functionality (/src/skia/core)
• Platform-specific bindings
Data Flow Indicators
• Component rendering pipeline
• Native bridge communication
• Graphics processing flow
• Event handling
Additional Elements
• Testing infrastructure
• Build system
• External dependencies
• Development tools