Skip to content

Commit da727cb

Browse files
committed
docs: address PR review feedback
- Fix EOF line ending in .gitignore - Add react-native-nitro-modules to all installation instructions - Update performance claims from '58x' to 'hundreds of times faster' - Reframe JSI mentions to focus on Nitro Modules architecture - Add libsodium/xsalsa20 configuration documentation
1 parent 428b2a8 commit da727cb

4 files changed

Lines changed: 28 additions & 12 deletions

File tree

docs/content/docs/guides/migration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ npm uninstall react-native-crypto rn-nodeify react-native-randombytes
3333
### Install RNQC
3434

3535
```bash
36-
npm install react-native-quick-crypto
36+
npm install react-native-quick-crypto react-native-nitro-modules
3737
cd ios && pod install
3838
```
3939
</Step>

docs/content/docs/introduction/complete-setup.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,19 @@ yarn start --reset-cache
197197
</Tab>
198198

199199
</Tabs>
200+
201+
## XSalsa20 Support (Optional)
202+
203+
If you need to use the `xsalsa20` cipher algorithm, you must enable libsodium support by setting an environment variable **before building your native code**:
204+
205+
```bash
206+
export RN_QUICK_CRYPTO_LIBSODIUM=1
207+
```
208+
209+
This can be done:
210+
- **iOS**: Set in your Xcode build settings or in a pre-build script
211+
- **Android**: Add to your `gradle.properties` or as a build environment variable
212+
213+
<Callout type="warn">
214+
Without this flag, attempting to use `xsalsa20` will throw a runtime error: `"libsodium must be enabled to use this cipher"`
215+
</Callout>

docs/content/docs/introduction/quick-start.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,22 +93,22 @@ Follow these steps to integrate Quick Crypto into your React Native project.
9393
<Tabs items={['npm', 'yarn', 'pnpm', 'bun']}>
9494
<Tab value="npm">
9595
```bash
96-
npm install react-native-quick-crypto
96+
npm install react-native-quick-crypto react-native-nitro-modules
9797
```
9898
</Tab>
9999
<Tab value="yarn">
100100
```bash
101-
yarn add react-native-quick-crypto
101+
yarn add react-native-quick-crypto react-native-nitro-modules
102102
```
103103
</Tab>
104104
<Tab value="pnpm">
105105
```bash
106-
pnpm add react-native-quick-crypto
106+
pnpm add react-native-quick-crypto react-native-nitro-modules
107107
```
108108
</Tab>
109109
<Tab value="bun">
110110
```bash
111-
bun add react-native-quick-crypto
111+
bun add react-native-quick-crypto react-native-nitro-modules
112112
```
113113
</Tab>
114114
</Tabs>

docs/content/docs/introduction/what-is-rnqc.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ React Native has historically lacked a robust, high-performance cryptographic st
1515

1616
**RNQC was created because complex apps need a FULL, INDEPENDENT cryptographic standard.**
1717

18-
We wanted a complete, standalone cryptographic library for React Native where you can simply call `install()` to polyfill the environment, ensuring all your cryptographic operations run smoothly and **up to 58x faster** than standard JS solutions.
18+
We wanted a complete, standalone cryptographic library for React Native where you can simply call `install()` to polyfill the environment, ensuring all your cryptographic operations run smoothly and **hundreds of times faster** than standard JS solutions.
1919

2020
<Callout type="info" title="Built by Margelo">
2121
This library was built at **Margelo**, an elite app development agency, specifically to power high-performance crypto apps and wallets.
@@ -29,8 +29,8 @@ We wanted a complete, standalone cryptographic library for React Native where yo
2929
We believe improved performance shouldn't require code rewrites.
3030
RNQC implements the **exact** Node.js API surface. If you know Node `crypto`, you know RNQC. There is zero learning curve.
3131

32-
### 2. Performance First (JSI)
33-
We bypass the "Bridge". All operations communicate directly with C++ via the **JavaScript Interface (JSI)**.
32+
### 2. Performance First (Nitro Modules)
33+
We bypass the "Bridge". All operations communicate directly with C++ via **Nitro Modules**, a modern architecture built on top of JSI (JavaScript Interface).
3434
Heavy tasks (like `pbkdf2` or key generation) are offloaded to a dedicated native thread pool to ensure your UI **never freezes**, even during intensive encryption.
3535

3636
### 3. Secure Defaults
@@ -40,18 +40,18 @@ We don't roll our own crypto. All primitives map directly to the platform-native
4040

4141
## Architecture
4242

43-
RNQC bridges the gap between the JavaScript world and native C++ performance using JSI.
43+
RNQC bridges the gap between the JavaScript world and native C++ performance using **Nitro Modules**.
4444

4545
```mermaid
4646
graph TD
47-
JS[JavaScript Thread] -->|JSI Call| C[C++ Host Object]
47+
JS[JavaScript Thread] -->|Nitro Module Call| C[C++ Hybrid Object]
4848
C -->|Direct Memory Access| O[OpenSSL / Native Crypto]
4949
O -->|Result| C
5050
C -->|Return Value| JS
5151
```
5252

53-
### The JSI Advantage
54-
Unlike the legacy Bridge, which relies on asynchronous JSON message passing (slow, serializable-only), **JSI (JavaScript Interface)** allows C++ code to expose "Host Objects" directly to the JavaScript runtime.
53+
### Nitro Modules Architecture
54+
Unlike the legacy Bridge, which relies on asynchronous JSON message passing (slow, serializable-only), **Nitro Modules** provides a modern architecture built on JSI (JavaScript Interface), allowing C++ code to expose "Hybrid Objects" directly to the JavaScript runtime.
5555
1. **Zero Serialization**: Data (like `ArrayBuffer`) is shared by reference. No cloning large buffers.
5656
2. **Synchronous Execution**: Methods like `randomBytes` or `update` run instantly, just like native JS functions.
5757
3. **Thread Safety**: Heavy operations automatically offload to a C++ thread pool to prevent UI jank.

0 commit comments

Comments
 (0)