Skip to content

Commit a35efb9

Browse files
janicduplessisfacebook-github-bot
authored andcommitted
Use autolink script in template on iOS (#27984)
Summary: We use this for RN tester but it is not currently included in npm releases. It cleans up the podfile a lot and will make adding / removing pods easier in the future since it won't require users to update their project. ## Changelog [iOS] [Added] - Use autolink script in template on iOS Pull Request resolved: #27984 Test Plan: Not sure if there is a way to end to end test this but I've been using this autolink script in my fork for a while. Differential Revision: D19787729 Pulled By: cpojer fbshipit-source-id: b843ea723085830f13e8f0149833d1beb1efdfac
1 parent cd194b8 commit a35efb9

File tree

3 files changed

+4
-31
lines changed

3 files changed

+4
-31
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
"ReactCommon",
4343
"README.md",
4444
"rn-get-polyfills.js",
45+
"scripts/autolink-ios.rb",
4546
"scripts/compose-source-maps.js",
4647
"scripts/ios-configure-glog.sh",
4748
"scripts/launchPackager.bat",

scripts/autolink-ios.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def use_react_native! (options={})
4343
pod 'React-jsinspector', :path => "#{prefix}/ReactCommon/jsinspector"
4444
pod 'ReactCommon/callinvoker', :path => "#{prefix}/ReactCommon"
4545
pod 'ReactCommon/turbomodule/core', :path => "#{prefix}/ReactCommon"
46-
pod 'Yoga', :path => "#{prefix}/ReactCommon/yoga"
46+
pod 'Yoga', :path => "#{prefix}/ReactCommon/yoga", :modular_headers => true
4747

4848
pod 'DoubleConversion', :podspec => "#{prefix}/third-party-podspecs/DoubleConversion.podspec"
4949
pod 'glog', :podspec => "#{prefix}/third-party-podspecs/glog.podspec"

template/ios/Podfile

+2-30
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
platform :ios, '10.0'
2+
require_relative '../node_modules/react-native/scripts/autolink-ios'
23
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
34

45
# Add Flipper Pods
@@ -39,36 +40,7 @@ end
3940

4041
target 'HelloWorld' do
4142
# Pods for HelloWorld
42-
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
43-
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
44-
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
45-
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
46-
pod 'React', :path => '../node_modules/react-native/'
47-
pod 'React-Core', :path => '../node_modules/react-native/'
48-
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
49-
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
50-
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
51-
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
52-
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
53-
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
54-
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
55-
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
56-
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
57-
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
58-
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
59-
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
60-
61-
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
62-
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
63-
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
64-
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
65-
pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon"
66-
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
67-
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
68-
69-
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
70-
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
71-
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
43+
use_react_native!
7244

7345
target 'HelloWorldTests' do
7446
inherit! :complete

0 commit comments

Comments
 (0)