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

Rethink "strict" feature #1008

Closed
KSXGitHub opened this issue Jan 23, 2018 · 3 comments
Closed

Rethink "strict" feature #1008

KSXGitHub opened this issue Jan 23, 2018 · 3 comments

Comments

@KSXGitHub
Copy link
Contributor

KSXGitHub commented Jan 23, 2018

One of the features that pnpm provides is "strictness":

Strict. A package can access only dependencies that are specified in its package.json.

It is helpful for developers to not require() packages that doesn't exist in package.json.
The thing is, when a package that developer uses but isn't in charge (such as jest) requires things that don't exist in their package.json, the package won't work.

One known workaround is using hook but this solution is rather complicated.

Hence, I think that strict installation is only useful at top level (folder that we edit, usually contains .git and package.json) but not at dependencies level (sub-folders of node_modules or ~/.pnpm-store).

Related issue: #1007

@zkochan
Copy link
Member

zkochan commented Jan 23, 2018

Strictness is just a nice bonus of pnpm's design. This strictness + the unique node_modules structure are the secrets of pnpm's speed.

Flat node_modules is not a feature of npm/yarn, it is a side effect of their installation algorithm. We are not going to introduce complexity to pnpm to fix bugs that should be fixed by the ecosystem.

@zkochan zkochan closed this as completed Jan 23, 2018
@zkochan
Copy link
Member

zkochan commented Jan 23, 2018

We can consider this after/if we implement #1001

That would be not earlier than pnpm@2

@zkochan
Copy link
Member

zkochan commented Sep 7, 2019

I think we can do this in version 4 with the new restricted hoisting feature: #1998

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

No branches or pull requests

2 participants