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

Define which dependencies are shared among workspace projects #375

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

@isaacs
Copy link
Contributor

@isaacs isaacs commented May 5, 2021

References

@isaacs isaacs added the Agenda label May 5, 2021
@isaacs isaacs changed the title Change which dependencies are shared among workspace projects Define which dependencies are shared among workspace projects May 5, 2021
If `a` declares a dependency on `foo`, and `b` does _not_ declare that
dependency, then the code in `b` can call `require('foo')` and it will work
without any errors in development. But when `b` is published, and
subsequently installed as a standalone project, it fails to find the `foo`
dependency.
Copy link
Contributor

@ljharb ljharb May 5, 2021

we may want to explicitly declare it as a non-goal to address "if foo depends on c, a can require('c') even though it doesn't declare that dependency"?

2. A workspace that has a peer dependency should share the same instance of
that peer dependency with all other workspace projects, unless
explicitly marked for isolation.
Copy link
Contributor

@ljharb ljharb May 5, 2021

Suggested change
2. A workspace that has a peer dependency should share the same instance of
that peer dependency with all other workspace projects, unless
explicitly marked for isolation.
2. A workspace that has a peer dependency should share the same instance of
that peer dependency with all other workspace projects that declare that peer dependency, unless
explicitly marked for isolation.

3. A workspace should not be able to load any package that it does not have
an explicit dependency on, with the exception of dependencies declared
explicitly at a level higher than them in the directory tree.
Copy link
Contributor

@ljharb ljharb May 5, 2021

Suggested change
3. A workspace should not be able to load any package that it does not have
an explicit dependency on, with the exception of dependencies declared
explicitly at a level higher than them in the directory tree.
3. A workspace should not be able to load any package that it does not have
an explicit dependency on (direct, or possibly transitive), with the exception of dependencies declared
explicitly at a level higher than them in the directory tree.

@isaacs isaacs force-pushed the isaacs/workspace-dependency-sharing branch from 178001d to d02ad26 Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants