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

Improve Dependency Management in React Native Monorepo #8018

Open
1 task done
datrhi opened this issue Apr 26, 2024 · 0 comments
Open
1 task done

Improve Dependency Management in React Native Monorepo #8018

datrhi opened this issue Apr 26, 2024 · 0 comments

Comments

@datrhi
Copy link
Contributor

datrhi commented Apr 26, 2024

Contribution

Describe the user story

As a developer working with a monorepo containing approximately 20 React Native projects,

Because react-native scripts and bundler assumed the dependent modules reside under the application's node_modules folder during installation and runtime,

With yarn I use nohoist config

{ "nohoist": ["**/*"] }

With pnpm I use shamefully-hoist but it only symlink direct dependencies of each project (workspace),

Describe the solution you'd like

I want an option to symlink all depth level (both direct and non-direct dependencies) to project (workspace) level node_modules.

Describe the drawbacks of your solution

Installation time will be increased when this options was set because it will be find all depth dependencies and symlink them all to project (workspace) level node_modules

Describe alternatives you've considered

Because react-native scripts and bundler assumed the native dependent modules reside under the application's node_modules folder during installation and runtime

So I collect error after bundle about the native dependencies and push them all to optionalDependencies of target workspace package.json. That make them to be direct dependencies. Then it could be symlinked to target workspace level node_modules.

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