-
Notifications
You must be signed in to change notification settings - Fork 930
feat: make the react native package name passable #2729
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
base: main
Are you sure you want to change the base?
feat: make the react native package name passable #2729
Conversation
|
Nit on naming, I wonder if it's better to have something like --platform or --out-of-tree-platform and maintain a mapping somewhere (there's only a handful of us and that's what react native test app does?) |
Yeah - the I know it's not like a React Native platform is born every week (it's perhaps more like every other week 🙈😄), but it would be nice for someone to take advantage and rely on the CLI as they're building out the new platform, without having to rely on the CLI to merge a PR to update the lookup object. I'd be happy to change this to a lookup in an object if that seems more appropriate 👍 |
|
The test failures seem unrelated 🤔 |
|
@Saadnajmi what's the reason you need to set the
Would like to use this as a discussion for a better API before we commit to complicate this even further. |
This is mostly driven by Kraen, who needed this to get some CLI stuff working for macOS. Happy to discus a better API :) |
Summary
In the current version of the React Native Community template, the
reactNativePathis passed as:pathargument for theuse_react_nativecall.react_native_post_installcall.An out-of-tree platform like
react-native-macoscannot reuse this pattern, as it needs to pass it's own package path and the value ofreactNativePathin the output of theconfigcommand points to React Native Core's path.Merging this PR will add a new optional
--react-native-package-nameoption, which the out-of-tree platform can pass when linking native modules to resolve their own package, instead of"react-native".Test Plan
I added a unit test for the new behavior and I manually verified the
--react-native-package-namewas passed correctly through to theloadConfigfunctions intoresolveReactNativePath.Checklist
react-nativecheckout (instructions).