Commit ed55e2a
chore(deps): upgrade nitrogen and react-native-nitro-modules to ^0.35.0 (#3162)
## Summary
- Upgrade `nitrogen` and `react-native-nitro-modules` from `^0.31.1` to
`^0.35.0`
- Fixes build failure with `react-native-nitro-modules` 0.35.0
(`Unresolved reference 'updateNative'`)
- Adds `--stack-size=65536` workaround for nitrogen codegen exponential
type traversal bug
## Background
Nitro Modules
[v0.35.0](https://github.com/mrousavy/nitro/releases/tag/v0.35.0)
includes a **breaking change** for Kotlin HybridObjects — the
`updateNative()` API was removed to fix a critical memory leak. This
caused the build failure reported in #3159.
### Why `--stack-size=65536`?
Nitrogen 0.35.0 has a known [exponential type traversal
bug](mrousavy/nitro#1232) where
`getReferencedTypes()` revisits the same types repeatedly without a
visited set. For large specs like ours (40+ methods, complex nested
structs), this exceeds the default Node.js stack size. Increasing the
stack size is a safe workaround until the upstream fix
([mrousavy/nitro#1232](mrousavy/nitro#1232)) is
merged — at which point we can revert to the standard `nitrogen` CLI.
## Changes
### Dependencies
- `nitrogen`: `^0.31.1` → `^0.35.0`
- `react-native-nitro-modules`: `^0.31.1` → `^0.35.0` (root devDeps,
peerDeps, example, example-expo)
### Scripts (`package.json`)
- `nitrogen` and `specs` scripts now use `node --stack-size=65536
node_modules/nitrogen/lib/index.js` instead of bare `nitrogen` CLI
### Generated files (`nitrogen/generated/` — gitignored)
- Regenerated with nitrogen 0.35.0
- `HybridRnIapSpec.kt`: `updateNative()` removed (fixes #3159)
- JNI initialization updated internally to `facebook::jni::initialize()`
pattern
## Test plan
- [x] `yarn typecheck` passes
- [x] `yarn lint` passes
- [x] `yarn test` — 251 tests passed
- [x] `yarn specs` — generates 1/1 HybridObject successfully
Closes #3159
🤖 Generated with [Claude Code](https://claude.ai/code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Chores**
* Bumped react-native-nitro-modules and related tooling to ^0.35.0 and
updated CLI execution scripts.
* **Improvements**
* More consistent, null-safe in-app purchase data across iOS and Android
with standardized init/connection flows, improved serialization, and a
minimal promoted-product fallback.
* Public API shapes now consistently use variant-wrapped optional values
for more predictable behavior.
* **Bug Fixes**
* Safer purchase error handling that preserves original error details.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 1d2623e commit ed55e2a
File tree
7 files changed
+536
-373
lines changed- android/src/main/java/com/margelo/nitro/iap
- example-expo
- example
- ios
7 files changed
+536
-373
lines changedLines changed: 151 additions & 120 deletions
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11234 | 11234 | | |
11235 | 11235 | | |
11236 | 11236 | | |
11237 | | - | |
11238 | | - | |
11239 | | - | |
| 11237 | + | |
| 11238 | + | |
| 11239 | + | |
11240 | 11240 | | |
11241 | 11241 | | |
11242 | | - | |
| 11242 | + | |
11243 | 11243 | | |
11244 | 11244 | | |
11245 | 11245 | | |
11246 | 11246 | | |
11247 | 11247 | | |
11248 | | - | |
| 11248 | + | |
11249 | 11249 | | |
11250 | 11250 | | |
11251 | 11251 | | |
| |||
12300 | 12300 | | |
12301 | 12301 | | |
12302 | 12302 | | |
12303 | | - | |
| 12303 | + | |
12304 | 12304 | | |
12305 | 12305 | | |
12306 | 12306 | | |
12307 | 12307 | | |
12308 | | - | |
| 12308 | + | |
12309 | 12309 | | |
12310 | 12310 | | |
12311 | 12311 | | |
12312 | 12312 | | |
12313 | 12313 | | |
12314 | | - | |
| 12314 | + | |
12315 | 12315 | | |
12316 | 12316 | | |
12317 | 12317 | | |
| |||
12335 | 12335 | | |
12336 | 12336 | | |
12337 | 12337 | | |
12338 | | - | |
12339 | | - | |
12340 | | - | |
| 12338 | + | |
| 12339 | + | |
| 12340 | + | |
12341 | 12341 | | |
12342 | 12342 | | |
12343 | 12343 | | |
12344 | | - | |
| 12344 | + | |
12345 | 12345 | | |
12346 | 12346 | | |
12347 | 12347 | | |
| |||
12833 | 12833 | | |
12834 | 12834 | | |
12835 | 12835 | | |
12836 | | - | |
| 12836 | + | |
12837 | 12837 | | |
12838 | 12838 | | |
12839 | 12839 | | |
| |||
0 commit comments