Skip to content

Commit e73a4d8

Browse files
authored
fix(macOS): Add support for react-native-macos v0.62 (#197)
1 parent ef27b46 commit e73a4d8

5 files changed

+31
-8
lines changed

example/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
},
1212
"peerDependencies": {
1313
"react": "~16.8.6 || ~16.9.0 || ~16.11.0 || ~16.13.1",
14-
"react-native": "^0.60.6 || ^0.61.5 || ^0.62.2 || ^0.63 || 1000.0.0",
15-
"react-native-macos": "^0.60 || ^0.61.39"
14+
"react-native": "^0.60.6 || ^0.61.5 || ^0.62.2 || ^0.63.2 || 1000.0.0",
15+
"react-native-macos": "^0.60.0 || ^0.61.0 || ^0.62.0"
1616
},
1717
"devDependencies": {
1818
"@babel/core": "^7.0.0",

ios/pod_helpers.rb

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
#
4+
# This source code is licensed under the MIT license found in the
5+
# LICENSE file in the root directory of this source tree.
6+
#
7+
8+
def try_pod(name, podspec, project_root)
9+
pod name, :podspec => podspec if File.exist?(File.join(project_root, podspec))
10+
end

ios/use_react_native-0.60.rb

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#
77
# rubocop:disable Layout/LineLength
88

9+
require_relative('pod_helpers.rb')
10+
911
def include_react_native!(react_native:, target_platform:, project_root:, flipper_versions:)
1012
pod 'React', :path => react_native
1113
pod 'React-Core', :path => "#{react_native}/React", :inhibit_warnings => true
@@ -36,9 +38,10 @@ def include_react_native!(react_native:, target_platform:, project_root:, flippe
3638
pod 'glog', :podspec => "#{react_native}/third-party-podspecs/glog.podspec"
3739
pod 'Folly', :podspec => "#{react_native}/third-party-podspecs/Folly.podspec"
3840

39-
# Required by `react-native-macos` otherwise it will find Boost elsewhere
40-
boost = "#{react_native}/third-party-podspecs/boost-for-react-native.podspec"
41-
pod 'boost-for-react-native', :podspec => boost if File.exist?(File.join(project_root, boost))
41+
# Required by `react-native-macos`; otherwise it will find Boost elsewhere
42+
try_pod('boost-for-react-native',
43+
"#{react_native}/third-party-podspecs/boost-for-react-native.podspec",
44+
project_root)
4245
end
4346

4447
# rubocop:enable Layout/LineLength

ios/use_react_native-0.62.rb

+11-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#
77
# rubocop:disable Layout/LineLength
88

9+
require_relative('pod_helpers.rb')
10+
911
def add_flipper_pods!(versions = {})
1012
versions['Flipper'] ||= '~> 0.33.1'
1113
versions['DoubleConversion'] ||= '1.1.7'
@@ -70,7 +72,15 @@ def include_react_native!(react_native:, target_platform:, project_root:, flippe
7072

7173
pod 'DoubleConversion', :podspec => "#{react_native}/third-party-podspecs/DoubleConversion.podspec"
7274
pod 'glog', :podspec => "#{react_native}/third-party-podspecs/glog.podspec"
73-
pod 'Folly', :podspec => "#{react_native}/third-party-podspecs/Folly.podspec"
75+
76+
# `react-native` pods
77+
try_pod('Folly', "#{react_native}/third-party-podspecs/Folly.podspec", project_root)
78+
79+
# `react-native-macos` pods
80+
try_pod('RCT-Folly', "#{react_native}/third-party-podspecs/RCT-Folly.podspec", project_root)
81+
try_pod('boost-for-react-native',
82+
"#{react_native}/third-party-podspecs/boost-for-react-native.podspec",
83+
project_root)
7484
end
7585

7686
# rubocop:enable Layout/LineLength

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
},
4242
"peerDependencies": {
4343
"react": "~16.8.6 || ~16.9.0 || ~16.11.0 || ~16.13.1",
44-
"react-native": "^0.60.6 || ^0.61.5 || ^0.62.2 || ^0.63 || 1000.0.0",
45-
"react-native-macos": "^0.60 || ^0.61.39"
44+
"react-native": "^0.60.6 || ^0.61.5 || ^0.62.2 || ^0.63.2 || 1000.0.0",
45+
"react-native-macos": "^0.60.0 || ^0.61.0 || ^0.62.0"
4646
},
4747
"peerDependenciesMeta": {
4848
"react-native-macos": {

0 commit comments

Comments
 (0)