Skip to content

Conversation

@gladiuscode
Copy link
Owner

@gladiuscode gladiuscode commented May 11, 2025

Goal

This PR upgrades the project to react-native .79.2, ensuring compatibility with both the old and new architecture.

  • Ensure iOS compatibility with new arch
  • Ensure iOS compatibility with old arch
  • Ensure Android compatibility with new arch
  • Ensure Android compatibility with old arch
  • Ensure compatibility with newest Expo SDK

@gladiuscode gladiuscode self-assigned this May 11, 2025
@gladiuscode gladiuscode added the enhancement New feature or request label May 11, 2025
@gladiuscode gladiuscode marked this pull request as ready for review May 11, 2025 10:08
@gladiuscode gladiuscode force-pushed the feat/upgrade-example-app branch from 9d40fce to 4573942 Compare May 11, 2025 10:21
@gladiuscode
Copy link
Owner Author

gladiuscode commented May 11, 2025

I'm experiencing an issue with this update: I can't no longer build the android example app due to weird errors ranging from:

Cannot run command 'npx'
ninja build failed
autolinkingLibraries() command failed

I'll try to understand why this happens and how to fix it properly, maybe the create-react-native-library repo does offer a solution.

@gladiuscode
Copy link
Owner Author

I'm experiencing an issue with this update: I can't no longer build the android example app due to weird errors ranging from:

Cannot run command 'npx' ninja build failed autolinkingLibraries() command failed

I'll try to understand why this happens and how to fix it properly, maybe the create-react-native-library repo does offer a solution.

Alright, got it: we need to upgrade to the latest changes of create-react-native-library because the whole metro config and babel parsing has changed and they actually fixed this codegen error.

@gladiuscode
Copy link
Owner Author

Another issue arose: expo-module-scripts isn't yet compatible with eslint9, so we need to add a resolution for dependencies related to the new eslint setup. I'll keep track of this module and eventually remove them.

@gladiuscode
Copy link
Owner Author

Lastly, the expo plugin isn't being recognised anymore and throws a warning once you install the lib or it throws an error when you try to prebuild an app with it.

PluginError: Package "react-native-orientation-director" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin

Unexpected token 'typeof'
SyntaxError: Unexpected token 'typeof'

I have yet to understand why.

@gladiuscode
Copy link
Owner Author

gladiuscode commented May 11, 2025

Lastly, the expo plugin isn't being recognised anymore and throws a warning once you install the lib or it throws an error when you try to prebuild an app with it.

PluginError: Package "react-native-orientation-director" does not contain a valid config plugin.
Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin

Unexpected token 'typeof'
SyntaxError: Unexpected token 'typeof'

I have yet to understand why.

This issue is related to the latest changes in the package.json exports keyword and support from metro bundler.
Basically, now the npx expo install and npx expo prebuild commands skip the app.plugin.js entirely and try to read the plugin from the exports.default property, leading it to an esm module, therefore making it incompatible with the expo setup.

I'm not sure how to properly fix this one, since expo needs a commonjs while react-native has moved on to esm..

Taking a look at react-native-edge-to-edge, their package.json doesn't use the exports keyword, so that's why it works.

@gladiuscode
Copy link
Owner Author

Well, to fix this issue, we need to rollback the exports setup and still rely on the old way.
I've tested it on both expo and bare projects and it works. Kind a bummer tho...

@gladiuscode
Copy link
Owner Author

To share my findings with the community, I've opened a discussion in the create-react-native-library repository.
Here

Copy link
Owner Author

@gladiuscode gladiuscode left a comment

Choose a reason for hiding this comment

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

LGTM!

@gladiuscode gladiuscode merged commit 0e25040 into main May 11, 2025
@gladiuscode gladiuscode deleted the feat/upgrade-example-app branch May 11, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants