Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linking expo package when Expo autolinking is not used #26932

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

tsapeta
Copy link
Member

@tsapeta tsapeta commented Feb 5, 2024

Why

This react-native.config.js is a nice way to prevent expo package being linked when Expo modules are not set. However, this is not perfect, especially that we now support out of tree platforms (i.e. the config doesn't handle macOS right now).

Currently, running pod install in a react-native-macos project that has expo in dependencies but doesn't have the setup for Expo autolinking would fail because it's unable to find pod specification for ExpoModulesCore (which cannot be linked by React Native Community CLI).

How

When use_expo_modules! is not defined, don't include the dependency on ExpoModulesCore and print appropriate warning instead.

Sadly, this doesn't fix the problem when autolinking is imported but use_expo_modules! is not used. I'm not sure if we can do something with that, but this solution seems to be better than nothing.

Test Plan

  • npx react-native init
  • npm install expo
  • npx react-native-macos-init doesn't fail on pod install step and shows the warning that instructs me to set up Expo modules

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Feb 5, 2024
@tsapeta tsapeta force-pushed the @tsapeta/warn-about-missing-autolinking branch from 9da7f1c to 85a3c16 Compare February 5, 2024 14:01
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Feb 5, 2024
@tsapeta tsapeta marked this pull request as ready for review February 5, 2024 14:51
packages/expo/Expo.podspec Outdated Show resolved Hide resolved
packages/expo/Expo.podspec Outdated Show resolved Hide resolved
Co-authored-by: Brent Vatne <brentvatne@gmail.com>
@tsapeta tsapeta merged commit be9a0c1 into main Feb 5, 2024
1 check passed
@tsapeta tsapeta deleted the @tsapeta/warn-about-missing-autolinking branch February 5, 2024 21:05
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint changed bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants