storybookjs / storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation
https://storybook.js.org
MIT License
84.08k stars 9.25k forks source link

Vite: Add jsdoc-type-pratt-parser to `optimizeDeps` #29179

Closed tobiasdiez closed 3 days ago

tobiasdiez commented 5 days ago

Closes https://github.com/nuxt-modules/storybook/issues/776.

What I did

With #29134, jsdoc-type-pratt-parser is no longer bundled. However, it is a CJS-only module so should be declared in optimizeDeps.

Checklist for Contributors

Testing

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

Manual testing

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

Documentation

Checklist for Maintainers

🦋 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.5 MB 77.5 MB 100 B 3.74 0%
initSize 162 MB 162 MB -1.7 kB 0.38 0%
diffSize 85 MB 85 MB -1.8 kB -0.46 0%
buildSize 7.57 MB 7.57 MB 0 B -0.42 0%
buildSbAddonsSize 1.66 MB 1.66 MB 0 B -0.42 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.34 MB 2.34 MB 0 B - 0%
buildSbPreviewSize 352 kB 352 kB 0 B - 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.55 MB 4.55 MB 0 B -0.42 0%
buildPreviewSize 3.02 MB 3.02 MB 0 B -0.42 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 17.5s 6.2s -11s -241ms -1.18 -178.8%
generateTime 22.8s 20.7s -2s -144ms 0.22 -10.3%
initTime 14.6s 15.4s 885ms -0.49 5.7%
buildTime 9.9s 9.6s -324ms -1.54 -3.4%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.6s 7.4s 816ms 0.59 11%
devManagerResponsive 4.4s 4.8s 426ms 0.59 8.8%
devManagerHeaderVisible 782ms 858ms 76ms 0.78 8.9%
devManagerIndexVisible 817ms 891ms 74ms 0.64 8.3%
devStoryVisibleUncached 1.3s 1.4s 150ms 0.33 10.1%
devStoryVisible 816ms 892ms 76ms 0.65 8.5%
devAutodocsVisible 632ms 698ms 66ms -0.57 9.5%
devMDXVisible 666ms 756ms 90ms 0.41 11.9%
buildManagerHeaderVisible 716ms 737ms 21ms -0.56 2.8%
buildManagerIndexVisible 722ms 740ms 18ms -0.72 2.4%
buildStoryVisible 782ms 777ms -5ms -0.71 -0.6%
buildAutodocsVisible 664ms 645ms -19ms -0.89 -2.9%
buildMDXVisible 652ms 672ms 20ms -0.36 3%

Greptile Summary

This change adds 'jsdoc-type-pratt-parser' to Vite's optimizeDeps configuration in Storybook's builder-vite, addressing compatibility issues with CJS-only modules.

nx-cloud[bot] commented 5 days ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit d43564ecb4b946018c9d77fb167ec59210a15359. 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 - [`nx run-many -t build --parallel=3`](https://cloud.nx.app/runs/nDcnMHru6T?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.