infinitered / react-native-mlkit

The definitive MLKit wrapper for React Native and Expo
https://docs.infinite.red/react-native-mlkit/
187 stars 13 forks source link

Upgrade to Expo 51 #149

Closed trevor-coleman closed 5 months ago

trevor-coleman commented 5 months ago

There were a couple issues blocking this that I had to resolve:

  1. The MLKit image labeling dependencies were pinned, when they shouldn't be
  2. Expo changed the logger API so I had to replace let logger = Logger() with let logger = Logger(logHandlers: [createOSLogHandler(category: Logger.EXPO_LOG_CATEGORY)])
  3. Used expo-build-settings to set the minimumDeploymentTarget and compileSDKVersion in app.json
  4. Bumped expo version in tsconfig package
  5. Deleted yarn.lock and resinstalled.
  6. Replaced expo-modules scripts with custom scripts that check for Turbo. Messy but I'll circle back later to clean it up.
  7. Unpinned Pods versions to allow Cocoapods to resolve the dependencies as needed

To test:

changeset-bot[bot] commented 5 months ago

🦋 Changeset detected

Latest commit: 89d937c948b31b8954251ac82e8736fa427c9a8b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages | Name | Type | | ------------------------------------------------ | ----- | | @infinitered/react-native-mlkit-document-scanner | Major | | @infinitered/react-native-mlkit-object-detection | Major | | @infinitered/react-native-mlkit-face-detection | Major | | @infinitered/react-native-mlkit-image-labeling | Major | | @infinitered/react-native-mlkit-core | Major | | example-app | Major |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

trevor-coleman commented 5 months ago

This looks pretty straightforward, how do these version pins work on android. For example you lifted the one on iOS for image labeling, but build.gradle contains

implementation 'com.google.mlkit:image-labeling:17.0.7'
implementation 'com.google.mlkit:image-labeling-custom:17.0.1'

Do we have work to do there as well?

I updated all packages to the platform specific equivalent of ^17.0.0 (or whatever the major version was)

Figured it was safer than floating everything.

trevor-coleman commented 5 months ago

I updated all packages to the platform specific equivalent of ^17.0.0 (or whatever the major version was)

This caused problems with cocoapods, so I unpinned that side. The android side seems to do better with the versioning.

trevor-coleman commented 5 months ago

Updated with separate build scripts for CI.

#build with '--watch' and use the Turbo UI
yarn build

# just build, no watching
yarn build:ci