Skip to content

Commit

Permalink
feat: RFC-0759 use @react-native/core-cli-utils for 0.75 iOS autolinking
Browse files Browse the repository at this point in the history
The dependency graph looks like this for the iOS Podfile:

  [@react-native-community/cli-platforms-ios/autolinking.rb]
  |
  v
  [react-native/scripts/react_native_pods.rb]
  |
  |-+ def use_react_native!()
  | + all ./cocoapods/* libraries for codegen
  | |
  | v
  | [@react-native/core-cli-utils/autolinking/ios/link_native_modules.rb]
  | |-+ def link_native_modules!()
  |
  + def list_native_modules!()
  + def autolink_native_modules!()
  |
  v
  [legacy: native_modules.rb]
  |-+ def use_native_modules!()

We need all of the methods for codegen to work.
  • Loading branch information
blakef authored and cipolleschi committed Jun 12, 2024
1 parent 7072cd6 commit d58acb8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions template/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
"@react-native-community/cli-platform-ios/autolinking.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip

Expand All @@ -15,7 +15,7 @@ if linkage != nil
end

target 'HelloWorld' do
config = use_native_modules!
config = autolink_native_modules!

use_react_native!(
:path => config[:reactNativePath],
Expand Down

0 comments on commit d58acb8

Please sign in to comment.