Skip to content

Commit ed55e2a

Browse files
hyochanclaude
andauthored
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

7 files changed

+536
-373
lines changed

android/src/main/java/com/margelo/nitro/iap/HybridRnIap.kt

Lines changed: 151 additions & 120 deletions
Large diffs are not rendered by default.

example-expo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"react-dom": "19.1.0",
3838
"react-native": "0.81.4",
3939
"react-native-gesture-handler": "~2.28.0",
40-
"react-native-nitro-modules": "^0.31.1",
40+
"react-native-nitro-modules": "^0.35.0",
4141
"react-native-reanimated": "~4.1.1",
4242
"react-native-safe-area-context": "~5.6.0",
4343
"react-native-screens": "~4.16.0",

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"react": "19.1.0",
1919
"react-native": "0.81.1",
2020
"react-native-dotenv": "^3.4.11",
21-
"react-native-nitro-modules": "^0.31.1",
21+
"react-native-nitro-modules": "^0.35.0",
2222
"react-native-safe-area-context": "^5.6.1",
2323
"react-native-screens": "^4.15.4"
2424
},

ios/HybridRnIap.swift

Lines changed: 109 additions & 68 deletions
Large diffs are not rendered by default.

ios/RnIapHelper.swift

Lines changed: 256 additions & 165 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"lint:tsc": "tsc -p tsconfig.json --noEmit --skipLibCheck",
5757
"lint:ci": "yarn lint:tsc && yarn lint:eslint && yarn lint:prettier",
5858
"prepare": "npx tsx scripts/check-nitro-versions.ts && bob build && yarn nitrogen && yarn build:plugin",
59-
"nitrogen": "nitrogen",
60-
"specs": "nitrogen --logLevel=\"debug\"",
59+
"nitrogen": "node --stack-size=65536 node_modules/nitrogen/lib/index.js",
60+
"specs": "yarn nitrogen --logLevel=\"debug\"",
6161
"test": "jest --coverage",
6262
"test:library": "jest --coverage",
6363
"test:example": "yarn workspace rn-iap-example test --coverage",
@@ -108,19 +108,19 @@
108108
"husky": "^8.0.3",
109109
"jest": "^30.1.1",
110110
"lint-staged": "^15.2.0",
111-
"nitrogen": "^0.31.1",
111+
"nitrogen": "^0.35.0",
112112
"prettier": "^3.3.3",
113113
"react": "19.1.0",
114114
"react-native": "0.81.1",
115115
"react-native-builder-bob": "^0.38.4",
116-
"react-native-nitro-modules": "^0.31.1",
116+
"react-native-nitro-modules": "^0.35.0",
117117
"react-test-renderer": "^19.1.1",
118118
"typescript": "^5.9.2"
119119
},
120120
"peerDependencies": {
121121
"react": "*",
122122
"react-native": "*",
123-
"react-native-nitro-modules": "^0.31.1"
123+
"react-native-nitro-modules": "^0.35.0"
124124
},
125125
"workspaces": [
126126
"example"

yarn.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11234,18 +11234,18 @@ __metadata:
1123411234
languageName: node
1123511235
linkType: hard
1123611236

11237-
"nitrogen@npm:^0.31.1":
11238-
version: 0.31.1
11239-
resolution: "nitrogen@npm:0.31.1"
11237+
"nitrogen@npm:^0.35.0":
11238+
version: 0.35.0
11239+
resolution: "nitrogen@npm:0.35.0"
1124011240
dependencies:
1124111241
chalk: ^5.3.0
11242-
react-native-nitro-modules: ^0.31.1
11242+
react-native-nitro-modules: ^0.35.0
1124311243
ts-morph: ^27.0.0
1124411244
yargs: ^18.0.0
1124511245
zod: ^4.0.5
1124611246
bin:
1124711247
nitrogen: lib/index.js
11248-
checksum: c241d96700e6182281470ccbe0f89140f513cec33a30d6d3f07f6c1c8af3d04afce9240d98b3b6ff61e152fddbe8ff877401d1e6a401a864cbb760fff149d579
11248+
checksum: d99d27ff6c5cacf1acaf11aa21ee58b401b1d185086b103a6cc26e92433505e4aef93b8a8281b21f872f219d8ad7a96412ac28c36894542a709eebb86e523fc3
1124911249
languageName: node
1125011250
linkType: hard
1125111251

@@ -12300,18 +12300,18 @@ __metadata:
1230012300
husky: ^8.0.3
1230112301
jest: ^30.1.1
1230212302
lint-staged: ^15.2.0
12303-
nitrogen: ^0.31.1
12303+
nitrogen: ^0.35.0
1230412304
prettier: ^3.3.3
1230512305
react: 19.1.0
1230612306
react-native: 0.81.1
1230712307
react-native-builder-bob: ^0.38.4
12308-
react-native-nitro-modules: ^0.31.1
12308+
react-native-nitro-modules: ^0.35.0
1230912309
react-test-renderer: ^19.1.1
1231012310
typescript: ^5.9.2
1231112311
peerDependencies:
1231212312
react: "*"
1231312313
react-native: "*"
12314-
react-native-nitro-modules: ^0.31.1
12314+
react-native-nitro-modules: ^0.35.0
1231512315
languageName: unknown
1231612316
linkType: soft
1231712317

@@ -12335,13 +12335,13 @@ __metadata:
1233512335
languageName: node
1233612336
linkType: hard
1233712337

12338-
"react-native-nitro-modules@npm:^0.31.1":
12339-
version: 0.31.1
12340-
resolution: "react-native-nitro-modules@npm:0.31.1"
12338+
"react-native-nitro-modules@npm:^0.35.0":
12339+
version: 0.35.0
12340+
resolution: "react-native-nitro-modules@npm:0.35.0"
1234112341
peerDependencies:
1234212342
react: "*"
1234312343
react-native: "*"
12344-
checksum: a3c9ebb2d4b3959caa9fafe6b50c3cfab6c7a518f000686a4eeb1a9c11646c7646cf8320810e04530a91dae2e867d9dfa4a06579bb682341301e3174cfd17b3b
12344+
checksum: f006daa1aa58f1a0165a4d6fc087c8d190f2857a7acfd6b47080e5979f05beb20455ed3c66831d489df4eb57d2f430d1610094ed4d6ae3946e17d83362161aa6
1234512345
languageName: node
1234612346
linkType: hard
1234712347

@@ -12833,7 +12833,7 @@ __metadata:
1283312833
react-native: 0.81.1
1283412834
react-native-dotenv: ^3.4.11
1283512835
react-native-monorepo-config: ^0.1.9
12836-
react-native-nitro-modules: ^0.31.1
12836+
react-native-nitro-modules: ^0.35.0
1283712837
react-native-safe-area-context: ^5.6.1
1283812838
react-native-screens: ^4.15.4
1283912839
react-test-renderer: 19.1.0

0 commit comments

Comments
 (0)