Skip to content

chore: add support for macos platform key in autolinking config#2995

Merged
Saadnajmi merged 1 commit into
microsoft:mainfrom
gabrieldonadel:@gabrieldonadel/expo-autolinking
Jun 26, 2026
Merged

chore: add support for macos platform key in autolinking config#2995
Saadnajmi merged 1 commit into
microsoft:mainfrom
gabrieldonadel:@gabrieldonadel/expo-autolinking

Conversation

@gabrieldonadel

Copy link
Copy Markdown

Summary:

The CocoaPods autolinking script hard-codes the ios platform key when reading the react-native config JSON, which assumes the upstream config provider always emits its project root and per-package config under ios. For proper out-of-tree platform support, autolinking should honor --platform macos and read package["platforms"]["macos"], otherwise config["project"]["ios"] is nil and pod install crashes.

Test Plan:

  • pod install in a react-native-macos test app driven by Expo's CLI (expo-modules-autolinking with --platform macos) completes without the nil:NilClass error on config["project"]["ios"].
  • pod install in a react-native-macos test app driven by @react-native-community/cli (which emits ios keys) still resolves the same set of pods as before.
  • Autolinked modules that only declare platforms.ios in their react-native.config.js still appear in Found N modules for target ....

@gabrieldonadel gabrieldonadel requested a review from a team as a code owner June 24, 2026 17:35

@shirakaba shirakaba left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an improvement, just a forward-facing question from me.

Comment thread packages/react-native/scripts/cocoapods/autolinking.rb
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Jun 25, 2026
This is currently unused by `react-native-macos` but will be used in the
future: microsoft/react-native-macos#2995
@Saadnajmi Saadnajmi merged commit 82618f5 into microsoft:main Jun 26, 2026
31 checks passed
tido64 added a commit to microsoft/react-native-test-app that referenced this pull request Jun 26, 2026
This is currently unused by `react-native-macos` but will be used in the
future: microsoft/react-native-macos#2995
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants