Skip to content

@nk/vision camera#810

Draft
NorbertKlockiewicz wants to merge 35 commits intomainfrom
@nk/vision-camera
Draft

@nk/vision camera#810
NorbertKlockiewicz wants to merge 35 commits intomainfrom
@nk/vision-camera

Conversation

@NorbertKlockiewicz
Copy link
Contributor

Description

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

Screenshots

Related issues

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

rizalibnu and others added 30 commits January 23, 2026 09:07
Add modular resource fetcher adapters to support both Expo and bare React Native environments.

## New Packages

### @rn-executorch/expo-adapter
- Expo-based resource fetcher using expo-file-system
- Supports asset bundles, local files, and remote downloads
- Download management with pause/resume/cancel capabilities

### @rn-executorch/bare-adapter
- Bare React Native resource fetcher using RNFS and background downloader
- Supports all platform-specific file operations
- Background download support with proper lifecycle management

## Core Changes

- Refactor ResourceFetcher to use adapter pattern
- Add initExecutorch() and cleanupExecutorch() for adapter management
- Export adapter interfaces and utilities
- Update LLM controller to support new resource fetching

## App Updates

- Update computer-vision, llm, speech-to-text, text-embeddings apps
- Add adapter initialization to each app
- Update dependencies to use workspace packages
Add a complete bare React Native example app demonstrating LLM integration with react-native-executorch.

## App: llm_bare

### Features
- Simple chat UI for LLM interactions
- Model loading with progress indicator
- Real-time streaming responses
- Send/stop generation controls
- Auto-scrolling message history

### Stack
- **Framework**: React Native 0.81.5 (bare/CLI)
- **LLM**: Uses LLAMA3_2_1B_SPINQUANT model
- **Adapter**: @rn-executorch/bare-adapter
- **Dependencies**: Minimal deps, only essential packages

### Platform Configuration

#### iOS
- Bridging header for RNBackgroundDownloader
- Background URL session handling in AppDelegate
- Background modes (fetch, processing)
- Xcode project configuration

#### Android
- Required permissions for background downloads
- Foreground service configuration
- Network state access
- Proper manifest configuration

### Infrastructure
- Babel configuration for export namespace transform

This serves as a reference implementation for using react-native-executorch in bare React Native environments (non-Expo).
Add explicit resetAdapter() method to ResourceFetcher class for cleaner API.
- Add resetAdapter() static method that sets adapter to null
- Update cleanupExecutorch() to use resetAdapter() instead of type assertion hack
- Update error message to reference new package names (@react-native-executorch/*)

This provides a cleaner, type-safe way to reset the adapter without
requiring "null as unknown as ResourceFetcherAdapter" type assertion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants