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

Build: Remove JS templates in sandboxes generation/testing #29833

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

yannbf
Copy link
Member

@yannbf yannbf commented Dec 6, 2024

Closes #

What I did

Our sandbox structure is getting quite large, so this PR proposes getting rid of the JS sandboxes as much as we can (some are left there), so all of the sandboxes that had TS/JS versions, will now only be TS.

This PR also replaces the generation and usage of CRA with a react-webpack sandbox instead, given that CRA is incredibly outdated by now.

This will decrease testing surface but I believe it won't penalize us much because of the features we test in Storybook. Also there is an upside of CI costs which will definitely go down by a lot because the sandbox count will be much lower

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-storybook/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.7 MB 77.7 MB -4.28 kB -3.73 0%
initSize 130 MB 130 MB 14.7 kB -1.2 0%
diffSize 52.4 MB 52.5 MB 19 kB 1.94 0%
buildSize 6.75 MB 6.75 MB 0 B -0.65 0%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B - 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.86 MB 1.86 MB 0 B 1.33 0%
buildSbPreviewSize 0 B 0 B 0 B -0.65 -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.57 MB 3.57 MB 0 B -0.65 0%
buildPreviewSize 3.19 MB 3.19 MB 0 B 0.65 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 7.5s 709ms -0.96 9.4%
generateTime 25.5s 20.7s -4s -799ms 0.02 -23.2%
initTime 15.9s 14.6s -1s -270ms 0.5 -8.6%
buildTime 8.1s 8.5s 451ms -0.55 5.3%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 5.4s 4.4s -974ms -1.3 🔰-22%
devManagerResponsive 3.8s 3.2s -588ms -1.09 -17.9%
devManagerHeaderVisible 555ms 605ms 50ms 0.4 8.3%
devManagerIndexVisible 629ms 680ms 51ms 0.34 7.5%
devStoryVisibleUncached 1.9s 1s -855ms -3.23 🔰-79.5%
devStoryVisible 627ms 679ms 52ms 0.37 7.7%
devAutodocsVisible 408ms 494ms 86ms -0.49 17.4%
devMDXVisible 562ms 519ms -43ms -0.04 -8.3%
buildManagerHeaderVisible 549ms 616ms 67ms 0.53 10.9%
buildManagerIndexVisible 622ms 706ms 84ms 0.7 11.9%
buildStoryVisible 498ms 569ms 71ms 0.41 12.5%
buildAutodocsVisible 440ms 516ms 76ms 1.05 14.7%
buildMDXVisible 404ms 458ms 54ms 0.49 11.8%

Greptile Summary

Here's my concise review of the changes:

Reduces CI testing surface by removing duplicate JavaScript templates in favor of TypeScript-only templates, significantly decreasing the number of sandbox tests while maintaining core functionality coverage.

  • Reduced parallelism in CircleCI from 14 to 9 jobs for test-runner and e2e testing
  • Removed JS templates for React, Vue, Lit, Svelte, HTML, and Preact frameworks where TS equivalents exist
  • Retained essential JS-only templates like vue-cli/default-js and html-webpack/default
  • Removed inDevelopment flags from stable templates to reflect production readiness
  • Updated skipTasks configurations to align with new template structure

@yannbf yannbf added the build Internal-facing build tooling & test updates label Dec 6, 2024
@yannbf yannbf self-assigned this Dec 6, 2024
@yannbf yannbf force-pushed the yann/remove-js-sandboxes branch from adce2ec to 887f9aa Compare December 6, 2024 12:47
@yannbf yannbf added the ci:daily Run the CI jobs that normally run in the daily job. label Dec 6, 2024
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.

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

'react-vite/prerelease-ts',
'react-webpack/prerelease-ts',
'vue3-vite/default-js',
'vue-cli/default-js',
Copy link
Contributor

Choose a reason for hiding this comment

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

style: vue-cli/default-js is kept while other JS templates are removed - consider migrating this to TypeScript for consistency

Copy link

nx-cloud bot commented Dec 6, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit acaca1f. 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.

@yannbf yannbf force-pushed the yann/remove-js-sandboxes branch from 887f9aa to acaca1f Compare December 6, 2024 12:49
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:daily Run the CI jobs that normally run in the daily job.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant