Build: Lower the number of parallel dts bundle generation at prod#33866
Conversation
7aa06a3 to
57db076
Compare
dts bundle generation at prod
|
View your CI Pipeline Execution ↗ for commit 9f221dc
☁️ Nx Cloud last updated this comment at |
📝 WalkthroughWalkthroughThe build script for DTS (declaration file) generation has been modified to reduce the concurrency limit for parallel TypeScript declaration processing from 10 to 5 child processes. A minor formatting adjustment to an else-if condition was also made. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes ✨ Finishing Touches
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/build/utils/generate-types.ts (1)
20-24:⚠️ Potential issue | 🟡 MinorStale comment: value mismatch between comment and code.
The comment on lines 22-23 states the limit is 3 ("by trial and error, 3 seems to be the sweet spot"), but the code sets
limit(5). Please update the comment to reflect the actual value.📝 Proposed fix
// Spawn each entry in it's own separate process, because they are slow & synchronous // ...this way we do not bog down the main process/esbuild and can run them in parallel - // we limit the number of concurrent processes to 3, because we don't want to overload the host machine - // by trial and error, 3 seems to be the sweet spot between perf and consistency + // we limit the number of concurrent processes to 5, because we don't want to overload the host machine + // by trial and error, 5 seems to be the sweet spot between perf and consistency const limited = limit(5);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/build/utils/generate-types.ts` around lines 20 - 24, Update the stale inline comment above the concurrency limiter to match the actual value used: change the sentence that says "by trial and error, 3 seems to be the sweet spot" to reference 5 (or otherwise state "5" as the configured concurrency), so the comment correctly describes the variable assignment where limited is created with limit(5); ensure the comment around limited/limit(5) is consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@scripts/build/utils/generate-types.ts`:
- Around line 20-24: Update the stale inline comment above the concurrency
limiter to match the actual value used: change the sentence that says "by trial
and error, 3 seems to be the sweet spot" to reference 5 (or otherwise state "5"
as the configured concurrency), so the comment correctly describes the variable
assignment where limited is created with limit(5); ensure the comment around
limited/limit(5) is consistent.
Package BenchmarksCommit: The following packages have significant changes to their size or dependencies:
|
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 94 | 92 | 🎉 -2 🎉 |
| Self size | 1.12 MB | 1.12 MB | 🚨 +36 B 🚨 |
| Dependency size | 23.51 MB | 22.34 MB | 🎉 -1.17 MB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-native-web-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 126 | 124 | 🎉 -2 🎉 |
| Self size | 30 KB | 30 KB | 0 B |
| Dependency size | 24.80 MB | 23.62 MB | 🎉 -1.17 MB 🎉 |
| Bundle Size Analyzer | Link | Link |
@storybook/react-vite
| Before | After | Difference | |
|---|---|---|---|
| Dependency count | 84 | 82 | 🎉 -2 🎉 |
| Self size | 35 KB | 35 KB | 🎉 -18 B 🎉 |
| Dependency size | 21.29 MB | 20.12 MB | 🎉 -1.17 MB 🎉 |
| Bundle Size Analyzer | Link | Link |
Closes #
What I did
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
Caution
This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>Summary by CodeRabbit