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

Allow sub-dependencies to be native modules #1609

Closed
ngregory-rbi opened this issue May 17, 2022 · 1 comment
Closed

Allow sub-dependencies to be native modules #1609

ngregory-rbi opened this issue May 17, 2022 · 1 comment

Comments

@ngregory-rbi
Copy link

ngregory-rbi commented May 17, 2022

Describe the Feature

I am currently on a project that is inheriting the native modules and components from another React Native project. Due to constraints, we cannot simply fork the other project and have been forced to re-declare the native modules required for the components we are importing into our own package.json. I have since found a solution that involves installing the other project as a dependency in our package.json and then using patch-package to modify the config loader to look into the other project's package.json. I would love for there to be first-class support for these kinds of situations.

Possible Implementations

Modifying loadConfig

This is what my current solution does. It adds an additional call to findDependecies after this and passes in the other project's root directory. Of course for this to be a feature for this package, a more generic function should be made. It could be configurable in the config file to only traverse sub-dependencies through certain packages. Alternatively to a new function, findDependencies could be altered to support this traversal (or be wrapped and replaced by the traversal function).

User config file based on config command

This would require little to no changes in the code of this package. This is what I was attempting to do but ultimately failed at due to complications which appear will be addressed soon in upcoming versions. I tried to programmatically run react-native config in the other project and then return the dependencies from the output in a react-native.config.js file in this project's root. Unfortunately, the config file from disk is being passed through a validator which does not appear to be in step with the output of the config command, as the config command can display a null value for podFile, while the validator disallows it. This does appear to be fixed in #1537, so perhaps once that is included in a mainline version of this package, I will be able to use this method without the validator complaining.

Related Issues

#1537 fixes validator issues I was experiencing when trying to build a solution to this on my end

@github-actions
Copy link

There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant