Repository navigation
feat: build RNQC as a Nitro UI module, plus example-nitro - #1120
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
RNQC now builds as a module of Nitro UI on iOS and Android, and
example-nitroruns 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 ofbuild.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 whenSODIUM_ENABLED=1.android/nitro-ui.cmake(new): adds the vendored dependencies, include paths and thesimdutfrename Apple already uses. Nitro UI links libwebsockets' OpenSSL-named mbedtls wrapper (SSL_*) into the same library, so this renames every OpenSSL symbol tornqc_*with the NDK'sllvm-objcopyand 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.ktandcpp-adapter.cppmove toandroid/src/reactnative/, because Nitro UI compilesandroid/src/mainand these are React Native-only (BaseReactPackage, a secondJNI_OnLoad).build.gradleandCMakeLists.txtpoint at the new paths. React Native autolinking searches all ofandroid/, so it still finds the package.Package.swiftresolvesnitro-corewhen Nitro UI places the package beside it, and keepsNitroModulesunder React Native.filespublishes the two new build files.example-nitro(new)example/srcsuites and hooks.globals.ts/polyfills.tssupply the Node-style globals and Web APIs React Native provides.patches/nitro-ui-bundler@0.1.0.patchreads analiasmap fromapp.json(RNQC's source entry,crypto,stream, andbase64-jsforreact-native-quick-base64). It goes away with feat(bundler): enable source exports and resolve native crypto nitro-ui#637 and Bundle Buffer on bare hosts without a react-native-quick-base64 alias #1116.package.json: workspace,lint-staged, andoverridespinningnitro-core/nitrogento the version RNQC generates with.Testing
All at
e226171aunless noted.React Native (the existing example, run during PR preparation)
bun run e2e:iospassed: 42 suites, 2211 tests, 0 failures (iPhone 18 Pro simulator, iOS 27.2).bun run e2e:androidpassed: 42 suites, 2211 tests, 0 failures (emulator, API 36, arm64-v8a).Nitro UI (
example-nitro, Release builds, sodium on, driven with agent-device)androidscript) and aPackage.swiftcomment fix, which don't affect iOS.Static: pre-commit hooks (lint-staged, clang-format,
bun tscacross workspaces includingexample-nitro, bob build);example-nitrolint and Prettier.Attestation:
agentscm/local-validationattestation and screenshot posting don't apply, because the verifier only covers PRs intomain.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-nitrois a workspace app and is not published.Related
nitro-ui.gradleprecedence.ScrollViewclipping;example-nitrowraps its scroll views until it's fixed.🤖 Generated with Claude Code