React Native Workers provides real, separate-thread Hermes runtimes for React Native with a Web Worker–style API, structured cloning, native module access, shared memory, and typed RPC.

Stars

80

7-day growth

No data

Forks

0

Open issues

0

License

MIT

Last updated

2026-07-27

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It solves the long-standing problem of blocking the single JS thread in React Native by offering true multi-threading with native module support, shared memory primitives, and minimal bundle overhead.

Who it is for

  • React Native developers building CPU-intensive apps
  • Developers needing background data processing or parallel computation
  • Teams using native modules that require offloading work from the UI thread
  • Engineers optimizing performance in React Native with the New Architecture

Use cases

  • Offloading heavy image filters or video processing to a background thread
  • Running real-time sensor data parsing or simulation loops without UI stutter
  • Performing parallel cryptographic or data compression tasks
  • Implementing a background service for network requests or database operations

Strengths

  • Real, isolated Hermes runtime per worker with its own heap and event loop
  • Full native module access (TurboModules, legacy, Nitro) inside workers
  • Shared memory primitives (SharedStore, SharedValue, SharedBuffer) for low-latency data exchange
  • Small worker bundles (~150 KB vs ~1.4 MB) via Metro shim and tree-shaking

Considerations

  • Requires React Native 0.81.4+ with New Architecture and Hermes
  • Structured clone does not yet support Map, Set, RegExp, Error, or BigInt
  • Platform native modules (Java/ObjC) require opt-in per worker and Android needs manual registration

README quick start

React Native Workers

Real threads for React Native. Web Worker–style API, backed by a separate Hermes runtime on its own thread — with structured-clone messaging, timers, shared memory, and full native-module access.

Documentation · Quick start · API reference · Examples


React Native runs all your JavaScript on a single JS thread, and drives UI updates from it. A long parse, a big image filter, or a tight simulation loop blocks that thread — so it can't dispatch updates and your UI stalls.

This library gives you a real one:

import { Worker } from '@ammarahmed/react-native-workers';

const worker = new Worker({
  inline: `self.onmessage = (e) => self.postMessage({ doubled: e.data * 2 });`,
});

worker.onmessage = (e) => console.log(e.data); // { doubled: 42 }
worker.postMessage(21);

It's a headless React Native: no UI, but the same JavaScript engine, the same timers and Promises, and the same native modules you already use.

Why it's different

A real threadIts own Hermes runtime with its own heap and event loop, not a time-slice of yours.
Native modules workTurboModules, legacy modules and Nitro modules all resolve inside a worker — react-native-mmkv, react-native-blob-util and friends work unmodified.
Shared memory, not just messagesA ladder from postMessage to lock-free shared cells and raw shared ArrayBuffers — pick the cost you want to pay.
Typed two-way RPCCall across the boundary like a local async function, in both directions, with one shared type.
Small bundlesWorker bundles ship ~150 KB instead of ~1.4 MB, because the UI half of React Native never enters the graph.
DebuggableEvery worker is its own DevTools target — breakpoints, stepping, and console.log forwarded to the host with a [Worker:name] tag.

Install

npm install @ammarahmed/react-native-workers

Requires the New Architecture with Hermes (RN 0.81.4+, developed against 0.86).

Description

Real threads for React Native. Web Worker–style API, backed by a separate Hermes runtime on its own thread — with structured-clone messaging, timers, shared memory, and full native-module access.

Related repositories

Similar projects matched by category, topics, and programming language.

makecindy
Featured
makecindy GitHub avatar

cindy

Cindy is an open-source AI agent that runs locally on your machine, integrates multiple AI harnesses and models, and provides memory, skills, and automation to perform real work in your projects and apps.

AI & Machine LearningLarge Language Models
958
TanStack
Featured
TanStack GitHub avatar

router

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.

Web DevelopmentFrontend Frameworks
14,861
mereyabdenbekuly-ctrl
Featured
mereyabdenbekuly-ctrl GitHub avatar

clodex-ide

Clodex is an open-source, local-first agentic IDE that combines persistent AI tasks, code, terminal, browser, Git, models, memory, and governed execution in one Electron workspace, currently in technical preview.

AI & Machine LearningAI Agents
859