Skip to content

Commit d1f984a

Browse files
abueideclaude
andauthored
fix(deps): widen react-native-get-random-values peer range to 1.x || 2.x (#1284)
Allow consumers on the New Architecture (RN 0.81+/Expo SDK 54+) to use react-native-get-random-values 2.x, which is required for New-Arch iOS builds, while keeping 1.x working for older React Native versions. Changes: - core: peerDependency 1.x -> "1.x || 2.x" (consumer picks the version compatible with their RN; old RN keeps 1.x, RN >=0.81 can use 2.x) - sovran: move react-native-get-random-values from a hard dependency to a peerDependency ("1.x || 2.x"). sovran's source never imports it; the hard dependency force-resolved a single version for every consumer, which is what blocked New-Arch users from installing 2.x. It is already a documented install step in the README, so a peer is the correct declaration. - root: add it as a devDependency (^1.11.0) so the monorepo build/test still resolves it for core's uuid polyfill (mirrors how @react-native-async-storage/async-storage is handled). Unlike PR #1174, this does NOT raise the floor to 2.x, so it does not break consumers (or the e2e-compat example) on RN < 0.81. Fixes #1102 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent a58bdcc commit d1f984a

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"react": "18.2.0",
5353
"react-native": "^0.72.7",
5454
"react-native-builder-bob": "^0.23.1",
55+
"react-native-get-random-values": "^1.11.0",
5556
"rimraf": "^5.0.5",
5657
"semantic-release": "^22.0.12",
5758
"semantic-release-yarn": "^3.0.2",

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@segment/sovran-react-native": "^1.1.0",
6464
"react": "*",
6565
"react-native": "*",
66-
"react-native-get-random-values": "1.x"
66+
"react-native-get-random-values": "1.x || 2.x"
6767
},
6868
"peerDependenciesMeta": {
6969
"@react-native-async-storage/async-storage": {

packages/sovran/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
"peerDependencies": {
6969
"@react-native-async-storage/async-storage": "2.x",
7070
"react": "*",
71-
"react-native": "*"
71+
"react-native": "*",
72+
"react-native-get-random-values": "1.x || 2.x"
7273
},
7374
"peerDependenciesMeta": {
7475
"@react-native-async-storage/async-storage": {
@@ -78,7 +79,6 @@
7879
"dependencies": {
7980
"ansi-regex": "5.0.1",
8081
"deepmerge": "^4.2.2",
81-
"react-native-get-random-values": "1.x",
8282
"shell-quote": "1.8.0",
8383
"uuid": "^14.0.0"
8484
},

yarn.lock

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4608,7 +4608,7 @@ __metadata:
46084608
"@segment/sovran-react-native": ^1.1.0
46094609
react: "*"
46104610
react-native: "*"
4611-
react-native-get-random-values: 1.x
4611+
react-native-get-random-values: 1.x || 2.x
46124612
peerDependenciesMeta:
46134613
"@react-native-async-storage/async-storage":
46144614
optional: true
@@ -4636,7 +4636,6 @@ __metadata:
46364636
ansi-regex: "npm:5.0.1"
46374637
deepmerge: "npm:^4.2.2"
46384638
jest: "npm:^29.7.0"
4639-
react-native-get-random-values: "npm:1.x"
46404639
semantic-release: "npm:^22.0.8"
46414640
shell-quote: "npm:1.8.0"
46424641
typescript: "npm:^5.2.2"
@@ -4645,6 +4644,7 @@ __metadata:
46454644
"@react-native-async-storage/async-storage": 2.x
46464645
react: "*"
46474646
react-native: "*"
4647+
react-native-get-random-values: 1.x || 2.x
46484648
peerDependenciesMeta:
46494649
"@react-native-async-storage/async-storage":
46504650
optional: true
@@ -6829,6 +6829,7 @@ __metadata:
68296829
react: "npm:18.2.0"
68306830
react-native: "npm:^0.72.7"
68316831
react-native-builder-bob: "npm:^0.23.1"
6832+
react-native-get-random-values: "npm:^1.11.0"
68326833
rimraf: "npm:^5.0.5"
68336834
semantic-release: "npm:^22.0.12"
68346835
semantic-release-yarn: "npm:^3.0.2"
@@ -16110,7 +16111,7 @@ __metadata:
1611016111
languageName: node
1611116112
linkType: hard
1611216113

16113-
"react-native-get-random-values@npm:1.x":
16114+
"react-native-get-random-values@npm:^1.11.0":
1611416115
version: 1.11.0
1611516116
resolution: "react-native-get-random-values@npm:1.11.0"
1611616117
dependencies:

0 commit comments

Comments
 (0)