Add opt-in optimization for static workspace patterns in 'project.setupWorkspaces'#6941
Open
jordanoverbye wants to merge 2 commits intoyarnpkg:masterfrom
Open
Add opt-in optimization for static workspace patterns in 'project.setupWorkspaces'#6941jordanoverbye wants to merge 2 commits intoyarnpkg:masterfrom
jordanoverbye wants to merge 2 commits intoyarnpkg:masterfrom
Conversation
9394d37 to
48fa100
Compare
jordanoverbye
commented
Oct 14, 2025
|
|
||
| expect(manifest.resolutions).toEqual({ | ||
| [`no-deps@npm:1.0.0`]: expect.stringMatching(/^patch:no-deps/), | ||
| [`no-deps@npm:1.0.0`]: expect.stringMatching(/^patch:no-deps/), |
Author
There was a problem hiding this comment.
This change was auto-generated when running yarn test:lint --fix
Without this change, I get the following error in CI:
/home/runner/work/berry/berry/packages/acceptance-tests/pkg-tests-specs/sources/commands/patchCommit.test.ts
Error: 117:1 error Expected indentation of 10 spaces but found 8 @stylistic/indent
jordanoverbye
commented
Oct 14, 2025
| }), | ||
| ); | ||
|
|
||
| test( |
Author
There was a problem hiding this comment.
The two tests that I've added here are duplicates of tests that already exist in this file, however these new tests have the enableWorkspacePatternAnalysis configuration turned on.
48fa100 to
4533276
Compare
4533276 to
8d1d7ae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's the problem this PR addresses?
All workspace patterns — including static paths like
packages/foo/bar— are passed tofast-globfor resolution, even though they might not contain glob syntax which adds unnecessary overhead.I work in a large monorepo with over 5,000 workspaces where
project.setupWorkspaces()takes 920ms on average. The changes in this PR has reduced this setup time in our repo by about 21% (920ms => 719ms).How did you fix it?
Introduced an opt-in
enableWorkspacePatternAnalysisconfiguration option. When enabled, workspace patterns are split into static patterns (resolved directly) and dynamic patterns (resolved viafast-glob).Defaults to
falseto preserve exisiting behaviour and this primarily benefits projects with mostly static workspace patterns.Checklist