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

Sandbox: Avoid redundant extra dependencies #29023

Closed

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Sep 1, 2024

Closes N/A

What I did

Avoid redundant extra dependencies

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make 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/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.3 MB 77.3 MB 0 B 0.49 0%
initSize 162 MB 162 MB 0 B 0.64 0%
diffSize 85 MB 85 MB 0 B 0.68 0%
buildSize 7.58 MB 7.58 MB 0 B 1.5 0%
buildSbAddonsSize 1.67 MB 1.67 MB 0 B 1.53 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.34 MB 2.34 MB 0 B 1.22 0%
buildSbPreviewSize 352 kB 352 kB 0 B 1 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.55 MB 4.55 MB 0 B 1.53 0%
buildPreviewSize 3.02 MB 3.02 MB 0 B 1 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 6.8s 22s 15.1s 1.55 🔺68.8%
generateTime 19.7s 22.4s 2.6s 0.92 11.8%
initTime 16.8s 18s 1.2s 0.49 6.9%
buildTime 11.9s 11.5s -396ms -0.1 -3.4%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.1s 8.5s 2.4s 1.84 🔺28.2%
devManagerResponsive 3.9s 5.4s 1.4s 1.71 🔺27.5%
devManagerHeaderVisible 693ms 988ms 295ms 1.12 29.9%
devManagerIndexVisible 725ms 989ms 264ms 0.83 26.7%
devStoryVisibleUncached 1s 1.1s 52ms -0.77 4.6%
devStoryVisible 724ms 1s 302ms 1.07 29.4%
devAutodocsVisible 621ms 843ms 222ms 1.18 26.3%
devMDXVisible 621ms 827ms 206ms 0.94 24.9%
buildManagerHeaderVisible 736ms 832ms 96ms 0.73 11.5%
buildManagerIndexVisible 767ms 1s 289ms 2.53 🔺27.4%
buildStoryVisible 768ms 1s 290ms 2.56 🔺27.4%
buildAutodocsVisible 603ms 886ms 283ms 1.73 🔺31.9%
buildMDXVisible 594ms 911ms 317ms 3.34 🔺34.8%

Greptile Summary

This PR optimizes the handling of extra dependencies in the sandbox creation process by introducing a Set to store unique dependencies, avoiding duplicates.

  • Introduced extraDeps Set in scripts/tasks/sandbox.ts to prevent redundant dependencies
  • Used Set's add method for individual additions and spread operator for initial population
  • Converted Set back to array before passing to addExtraDependencies function
  • Improved efficiency by eliminating duplicate entries in extra dependencies list
  • Simplified code structure for better readability and maintainability

@valentinpalkovic valentinpalkovic self-assigned this Sep 1, 2024
@valentinpalkovic valentinpalkovic added build Internal-facing build tooling & test updates ci:normal labels Sep 1, 2024
@valentinpalkovic valentinpalkovic marked this pull request as ready for review September 1, 2024 10:27
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

LGTM

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

nx-cloud bot commented Sep 1, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 4aed549. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@valentinpalkovic valentinpalkovic force-pushed the valentin/filter-extra-deps-for-sandboxes branch from 330c94d to 8eb7695 Compare September 10, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Internal-facing build tooling & test updates ci:normal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants