jsi
React Native JSI (JavaScript Interface) — C++ API for interacting with the JS runtime. Use whenever the user asks about or writes C++ code that touches JSI types or patterns: jsi::Runtime, jsi::Value, jsi::Object, jsi::Function, jsi::Array, jsi::ArrayBuffer, jsi::String, jsi::Symbol, jsi::BigInt, jsi::PropNameID, jsi::HostObject, jsi::HostFunction, jsi::NativeState, jsi::WeakObject, jsi::Scope, JSIException, JSINativeException, JSError, HostFunctionType, createFromHostFunction, getHostObject, setNativeState, evaluateJavaScript, queueMicrotask, drainMicrotasks, setRuntimeData, getRuntimeData, ISerialization, rt.global(), jsi.h, jsi-inl.h, JSI binding, C++ native module, calling JS from C++, calling C++ from JS, HostObject destructor, shared_ptr, CallInvoker, invokeAsync, folly::dynamic with JSI, zero-copy ArrayBuffer, TurboModule C++ layer, Nitro Module, jsi::WithRuntimeDecorator, or any question about the boundary between C++ and the JavaScript engine in React Native.
What this skill does
# React Native JSI The JavaScript Interface (JSI) is a C++ API that lets native code interact directly with the JavaScript engine — reading and writing JS values, calling JS functions, and exposing C++ objects to JS — without going through the old async bridge. ## References Load at most one reference file per question. Prefer the most specific match. | File | Load when question is about | |------|-----------------------------| | `overview.md` | JSI architecture, why `rt.global()`, sync vs async model, why some methods take `Runtime&`, event loop absence, `queueMicrotask`/`drainMicrotasks`, `setRuntimeData`/`getRuntimeData`, `evaluateJavaScript` caveat, prototype manipulation | | `core-types.md` | JSI type system: `Value`, `PropNameID`, `HostFunction`, `HostObject`, `NativeState`, `WeakObject`, `Array`, `ArrayBuffer`, `BigInt`, `Scope` — constructors, ownership, lifetimes, GC behavior | | `casting-and-serialization.md` | The `get`/`as` naming convention, `getPropertyAsObject`/`getPropertyAsFunction`, string encoding (`createFromAscii` vs `createFromUtf8`), zero-copy string access, C++↔JS type mapping, `createFromJsonUtf8`, `folly::dynamic`, `ISerialization` | | `threading-safety.md` | Single-thread rule, write operations from multiple threads, JSI object destruction order, `Value` non-copyable + `shared_ptr` pattern, hot reload / bundle reload pitfalls, `WithRuntimeDecorator<AroundLock>` | | `calling-js-and-async.md` | Installing `HostFunction` bindings, calling JS functions from C++, `callWithThis`, `callAsConstructor` (JS Set / Map / Promise), `invokeAsync` + `CallInvoker`, Promise resolve/reject patterns, `JSIException` hierarchy | | `performance.md` | Batching sequential calls, caching `PropNameID`, zero-copy `ArrayBuffer` via `MutableBuffer`, `setExternalMemoryPressure`, `Scope` in tight loops, avoiding `evaluateJavaScript` for function calls | | `setup-and-templates.md` | Installing a JSI binding in Android (FBJNI, JSIModulePackage) and iOS (ObjC++ `.mm`), library scaffolding templates, JSI vs TurboModules vs Nitro Modules | | `module-approaches.md` | Choosing between Pure JSI, TurboModules, Nitro Modules, or a pure C++ core with thin adapter — decision tree, trade-offs, boilerplate comparison | | `cpp-memory-patterns.md` | C++ memory for JS developers: `unique_ptr`, `shared_ptr`, `std::move`, lambda captures, RAII, circular ownership, the GC boundary between JS heap and native heap | | `debugging-and-pitfalls.md` | Crash traces, symbolication (`c++filt`, `addr2line`, `atos`, `ndk-stack`), ASan, common JSI crash patterns, pre-ship checklist |
Related in Web Dev
generating-lwc-components
IncludedLightning Web Components with PICKLES methodology and 165-point scoring. Use this skill when the user creates or edits LWC components, builds wire service patterns, or writes Jest tests for LWC. TRIGGER when: user creates/edits LWC components, touches lwc/**/*.js, .html, .css, .js-meta.xml files, or asks about wire service, SLDS, or Jest LWC tests. DO NOT TRIGGER when: Apex classes (use generating-apex), Aura components, or Visualforce.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Set up queries with useQuery, mutations with useMutation, configure QueryClient caching strategies, implement optimistic updates, and handle infinite scroll with useInfiniteQuery. Use when: setting up data fetching in React projects, migrating from v4 to v5, or fixing object syntax required errors, query callbacks removed issues, cacheTime renamed to gcTime, isPending vs isLoading confusion, keepPreviousData removed problems.
document-processor-api
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
nutrient-document-processing
IncludedProcess documents with Nutrient DWS. Use when the user wants to generate PDFs from HTML or URLs, convert Office/images/PDFs, assemble or split packets, OCR scans, extract text/tables/key-value pairs, redact PII, watermark, sign, fill forms, optimize PDFs, or produce compliance outputs like PDF/A or PDF/UA. Triggers include convert to PDF, merge these PDFs, OCR this scan, extract tables, redact PII, sign this PDF, make this PDF/A, or linearize for web delivery.
tanstack-query
IncludedManage server state in React with TanStack Query v5. Covers useMutationState, simplified optimistic updates, throwOnError, network mode (offline/PWA), and infiniteQueryOptions. Use when setting up data fetching, fixing v4→v5 migration errors (object syntax, gcTime, isPending, keepPreviousData), or debugging SSR/hydration issues with streaming server components.
accelint-nextjs-best-practices
IncludedNext.js performance optimization and best practices. Use when writing Next.js code (App Router or Pages Router); implementing Server Components, Server Actions, or API routes; optimizing RSC serialization, data fetching, or server-side rendering; reviewing Next.js code for performance issues; fixing authentication in Server Actions; or implementing Suspense boundaries, parallel data fetching, or request deduplication.