-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add opt-in optimization for static workspace patterns in 'project.setupWorkspaces' #6941
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
Add opt-in optimization for static workspace patterns in 'project.setupWorkspaces' #6941
Conversation
9394d37 to
48fa100
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
Uh oh!
There was an error while loading. Please reload this page.
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