Ability to skip autolinking for dependency for specific ios target
See original GitHub issueDescribe the Feature
We use the same codebase for different apps in appstore, so we have different targets in pod file. For some of the apps we need to remove specific dependencies (for instance, we can’t use firebase admob library in target that is aiming for kids due to appstore policy).
Currently in react-native.config.js
I can disable autolinking only for specific platfrom, but it would be good to be able to skip dependency for specific pod targets as well
Possible Implementations
I can imagine that it could be a specific property in react-native.config.js
in dependency configuration where I can putt targets that should be excluded from autolinking
module.exports = {
assets: ['res/fonts'],
dependencies: {
'react-native-code-push': {
platforms: {
ios: {
excludeFor: ['Target1'],
},
android: null,
web: null,
}
}
}
}
I think in ../node_modules/@react-native-community/cli-platform-ios/native_modules
it could be possible to get this property for dependency and skip installation if current target is listed
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (4 by maintainers)
Top GitHub Comments
I ended up patching
native_modules.rb
to takepackages_to_skip
inuse_native_modules!
, so I can do this in my Podfile:here is the content of my
patches/@react-native-community+cli-platform-ios+4.13.0.patch
fileIn my opinion, which is very strong when it comes to options/configuration 😅, auto-linking should be as simple as it can be without the need for configuration. Any further customisation should be done entirely through normal CocoaPods [or Gradle] means.
The reason I feel this way is that I think it ends up hurting the user if we try to abstract away things that are already well covered by the amount of docs/issues/stackoverflow/blogs that exist for the underlying tool–in this case CocoaPods. Instead we would have to write and maintain new rn-cli specific documentation, meaning maintainers need to do more work and end-users have less chance of finding the right solution; which is a lose-lose situation.
In short, I think auto-linking should:
Thus, I don’t think we should add this feature, furthermore I believe we should remove the ability to exclude pods for specific platforms. It would also be good to outline the above design in the auto-linking doc.