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

yarn workspaces is not compatible with bazel-managed deps #12736

Closed
alexeagle opened this issue Oct 24, 2018 · 6 comments
Closed

yarn workspaces is not compatible with bazel-managed deps #12736

alexeagle opened this issue Oct 24, 2018 · 6 comments

Comments

@alexeagle
Copy link
Contributor

yarn workspaces lays out node_modules in several directories, nested with your source code. It relies on node module resolution semantics of looking for a node_modules in parent directories when a dependency isnt' resolved

Bazel-managed dependencies are in a single node_modules directory that's outside the source code.

We could have multiple bazel-managed node_modules, but would still need each of these to be a complete copy of deps needed for a given binary to run.

@alexeagle alexeagle added the needs: discussion On the agenda for team meeting to determine next steps label Oct 24, 2018
@clydin
Copy link
Member

clydin commented Oct 24, 2018

Another viable dependency management method for monorepos is to run npm/yarn/pnpm individually for each package and the root of the monorepo. This would also cause issues with Bazel.

@alexeagle
Copy link
Contributor Author

Plan: advertise that yarn workspaces doesn't work.
The same use case can be achieved by having multiple independent package.json files.
Maybe we need some tooling to convert from one to the other.

@alexeagle
Copy link
Contributor Author

Actually, having Bazel lay out its managed dependencies into multiple node_modules directories that live in your sources could work.

@alexeagle
Copy link
Contributor Author

@kyliau could you update the developer doc to explain a bit how contributors and people on the team should treat the package.json file now that we are in a mixed mode?

@clydin I think we could discuss not using yarn workspaces. Given our current setup, a third-party dep has to go in two places, so we already broke the one thing we know of that yarn workspaces was helping with.

@irengrig this is where we really need Bazel to lay out dependencies inside the project folder, FYI

@hansl hansl added state: blocked and removed needs: discussion On the agenda for team meeting to determine next steps labels Dec 20, 2018
@clydin
Copy link
Member

clydin commented May 27, 2020

workspace support is being tracked/discussed here: bazel-contrib/rules_nodejs#266

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants