Skip to content

feat: build RNQC as a Nitro UI module, plus example-nitro - #1120

Merged
boorad merged 3 commits into
nextfrom
feat/react-nitro-example
Dec 1, 2026
Merged

boorad merged 3 commits into
nextfrom
feat/react-nitro-example

Conversation

@boorad

@boorad boorad commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

RNQC now builds as a module of Nitro UI on iOS and Android, and example-nitro runs the example app's full test suite there: 2211/2211 on both platforms. React Native builds are unchanged apart from two moved source files.

Changes

Library (packages/react-native-quick-crypto)

  • android/nitro-ui.gradle (new): Nitro UI applies it in place of build.gradle, which stays React Native's (feat(runtime): apply a module's android/nitro-ui.gradle before build.gradle nitro-ui#840). It adds OpenSSL, and libsodium when SODIUM_ENABLED=1.
  • android/nitro-ui.cmake (new): adds the vendored dependencies, include paths and the simdutf rename Apple already uses. Nitro UI links libwebsockets' OpenSSL-named mbedtls wrapper (SSL_*) into the same library, so this renames every OpenSSL symbol to rnqc_* with the NDK's llvm-objcopy and force-includes a prefix header generated from the same symbol list. That is the Android counterpart of the Apple build's isolation (💭 🔧 Android: libcrypto.so collision when using SQLCipher-based libraries alongside react-native-quick-crypto #1059). OpenSSL is not exported from the runtime library.
  • QuickCryptoPackage.kt and cpp-adapter.cpp move to android/src/reactnative/, because Nitro UI compiles android/src/main and these are React Native-only (BaseReactPackage, a second JNI_OnLoad). build.gradle and CMakeLists.txt point at the new paths. React Native autolinking searches all of android/, so it still finds the package.
  • Package.swift resolves nitro-core when Nitro UI places the package beside it, and keeps NitroModules under React Native.
  • files publishes the two new build files.

example-nitro (new)

Testing

All at e226171a unless noted.

React Native (the existing example, run during PR preparation)

  • bun run e2e:ios passed: 42 suites, 2211 tests, 0 failures (iPhone 18 Pro simulator, iOS 27.2).
  • Then bun run e2e:android passed: 42 suites, 2211 tests, 0 failures (emulator, API 36, arm64-v8a).

Nitro UI (example-nitro, Release builds, sodium on, driven with agent-device)

  • Android: 2211/2211 (Pixel 8 Pro emulator, API 36), on the final tree.
  • iOS: 2211/2211 (iPhone 17 Pro simulator). This ran before the last Android-only changes (generated prefix header, android script) and a Package.swift comment fix, which don't affect iOS.
  • Also checked: the list scrolls on both platforms with the default Starlight layout; the Android runtime library exports no OpenSSL symbols.

Static: pre-commit hooks (lint-staged, clang-format, bun tsc across workspaces including example-nitro, bob build); example-nitro lint and Prettier.

Attestation: agentscm/local-validation attestation and screenshot posting don't apply, because the verifier only covers PRs into main.

Delivery

The library changes reach apps in the next npm release, and native changes need the app to rebuild. React Native apps see no behavior change. example-nitro is a workspace app and is not published.

Related

🤖 Generated with Claude Code

Nitro UI applies android/nitro-ui.gradle and includes android/nitro-ui.cmake for
a module, and compiles its cpp/ and android/src/main sources into its runtime
library. RNQC now provides both files, and its React Native-only Kotlin package
and JNI adapter move to android/src/reactnative so Nitro UI does not compile them.

Nitro UI links libwebsockets' OpenSSL-named mbedtls wrapper into the same
library, so nitro-ui.cmake renames every OpenSSL symbol to rnqc_* and
force-includes a prefix header generated from the same symbol list, as the
Apple build does (#1059).

Package.swift resolves nitro-core when Nitro UI places the package beside it.
A Nitro UI 0.1.0 app with the React Native example's Tests, Benchmarks and
Stress tabs. It reuses the example's test suites and hooks, so the same 2211
tests run on a host without React Native.

- Bundler patch: aliases from app.json (RNQC's source entry, crypto, stream,
  and base64-js in place of react-native-quick-base64) until nitro-ui#637 and
  #1116 remove the need.
- globals.ts and polyfills.ts supply the Node-style globals and Web APIs React
  Native provides.
- Root overrides pin nitro-core and nitrogen to the version RNQC generates with.
@boorad boorad self-assigned this Dec 1, 2026
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
react-native-quick-crypto Ready Ready Preview Dec 1, 2026 6:56pm UTC

Request Review

@boorad

boorad commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator Author

E2E screenshots

Not an agentscm/local-validation attestation: that verifier only covers PRs into main. These are the final screens of the runs listed under Testing. Images expire in 30 days.

iOS Android
React Native (example, bun run e2e:ios / e2e:android at e226171a)
Nitro UI (example-nitro, Release, sodium on, at c0ed570a)
  • React Native: iPhone 18 Pro simulator (iOS 27.2) and emulator (API 36, arm64-v8a), 42 suites, 2211 tests, 0 failures each.
  • Nitro UI: iPhone 17 Pro simulator, 2211/2211 in 8.3 s; Pixel 8 Pro emulator (API 36), 2211/2211 in 9.5 s.
  • c0ed570a only changes the C++ lint paths on top of e226171a.

@boorad
boorad merged commit 3395645 into next Dec 1, 2026
6 checks passed
@boorad
boorad deleted the feat/react-nitro-example branch December 1, 2026 19:46

This branch was successfully deployed

1 active deployment
Preview — c0ed570a Deployed Dec 1, 2026 by vercel[bot]
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.

1 participant