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

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

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

tobiasdiez
Copy link
Contributor

@tobiasdiez tobiasdiez commented Sep 22, 2024

Closes nuxt-modules/storybook#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:

  • 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.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.

  • Added 'jsdoc-type-pratt-parser' to include array in code/builders/builder-vite/src/optimizeDeps.ts
  • Temporary solution until the package is converted to ESM
  • Addresses potential issues with Unicode character class escapes in React Native environments
  • Follows up on PR Core: Do not prebundle jsdoc-type-pratt-parser #29134, which removed prebundling of jsdoc-type-pratt-parser

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 22, 2024

☁️ Nx Cloud Report

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

@kasperpeulen kasperpeulen merged commit caa4ff3 into storybookjs:next Sep 24, 2024
63 of 70 checks passed
@github-actions github-actions bot mentioned this pull request Sep 24, 2024
21 tasks
@tobiasdiez tobiasdiez deleted the optimize-dep branch September 25, 2024 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants