Skip to content

fix: pass storeDir to createClient to fix resolution skipping#10502

Merged
zkochan merged 1 commit intomainfrom
bcheng/pass-store-dir-when-creating-client
Jan 22, 2026
Merged

fix: pass storeDir to createClient to fix resolution skipping#10502
zkochan merged 1 commit intomainfrom
bcheng/pass-store-dir-when-creating-client

Conversation

@gluxon
Copy link
Copy Markdown
Member

@gluxon gluxon commented Jan 22, 2026

Prior discussion: #10409 (comment)

When running pnpm install with minor changes to a package.json file, I'm seeing a performance regression due storeDir being undefined below. This causes peekManifestFromStore to never be initialized.

if (storeDir) {
peekManifestFromStore = async (peekOpts) => {

I tested this PR and passing through storeDir here fixes the performance issue!

@zkochan
Copy link
Copy Markdown
Member

zkochan commented Jan 22, 2026

Ready for review?

I actually wanted to make storeDir required. That would have caught the issue. But it required too many changes

@gluxon
Copy link
Copy Markdown
Member Author

gluxon commented Jan 22, 2026

I'll mark as ready for review!

Was deciding whether it was worth adding a changelog and tests. I think the answer to both is no since the original commit hasn't been released yet and tests would need to be E2E. I see unit tests didn't catch this originally since storeDir is passed directly.

@gluxon gluxon marked this pull request as ready for review January 22, 2026 22:48
@gluxon gluxon requested a review from zkochan as a code owner January 22, 2026 22:48
Copilot AI review requested due to automatic review settings January 22, 2026 22:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a performance regression in pnpm install by ensuring the storeDir option is properly passed to the client creation function. This prevents resolution skipping from being bypassed due to an uninitialized peekManifestFromStore function.

Changes:

  • Added storeDir parameter to the client configuration in createNewStoreController

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gluxon
Copy link
Copy Markdown
Member Author

gluxon commented Jan 22, 2026

I actually wanted to make storeDir required. That would have caught the issue. But it required too many changes

Yeah, that makes sense on both fronts.

@zkochan
Copy link
Copy Markdown
Member

zkochan commented Jan 22, 2026

We should add some performance regression tests but we need a big project like the one you are using. Looks like the project I use is not massive enough.

@zkochan zkochan merged commit d85ea8d into main Jan 22, 2026
13 of 15 checks passed
@zkochan zkochan deleted the bcheng/pass-store-dir-when-creating-client branch January 22, 2026 22:51
@gluxon
Copy link
Copy Markdown
Member Author

gluxon commented Jan 22, 2026

Agree — I feel bad that it's not possible for you to test pnpm against this proprietary repo. I can look into creating a public copy of it without source code, but similar package.json files and names obfuscated.

@zkochan
Copy link
Copy Markdown
Member

zkochan commented Jan 22, 2026

There is one open-source package that is very big: @teambit/bit

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

Successfully merging this pull request may close these issues.

3 participants