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

Nextjs-Vite: Re-export vite-plugin-storybook-nextjs #29012

Merged
merged 2 commits into from
Sep 2, 2024

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Aug 30, 2024

Closes N/A

What I did

I have re-exported vite-plugin-storybook-nextjs from @storybook/experimental-nextjs-vite

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 pull request has been released as version 0.0.0-pr-29012-sha-f9454736. Try it out in a new sandbox by running npx storybook@0.0.0-pr-29012-sha-f9454736 sandbox or in an existing project with npx storybook@0.0.0-pr-29012-sha-f9454736 upgrade.

More information
Published version 0.0.0-pr-29012-sha-f9454736
Triggered by @valentinpalkovic
Repository storybookjs/storybook
Branch valentin/re-export-next-js-vite-plugin
Commit f9454736
Datetime Mon Sep 2 08:17:58 UTC 2024 (1725265078)
Workflow run 10663427790

To request a new release of this pull request, mention the @storybookjs/core team.

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

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 76.5 MB 76.5 MB 0 B 1.01 0%
initSize 161 MB 161 MB 0 B 0.31 0%
diffSize 84.7 MB 84.7 MB 0 B 0.3 0%
buildSize 7.48 MB 7.48 MB 0 B 0.35 0%
buildSbAddonsSize 1.62 MB 1.62 MB 0 B 0.9 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.31 MB 2.31 MB 0 B 0.33 0%
buildSbPreviewSize 352 kB 352 kB 0 B - 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.47 MB 4.47 MB 0 B 0.34 0%
buildPreviewSize 3.01 MB 3.01 MB 0 B 0.36 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 7s 8.7s 1.6s -1.08 18.5%
generateTime 19.9s 21.5s 1.6s -0.1 7.6%
initTime 21.5s 18s -3s -560ms -0.07 -19.7%
buildTime 10.6s 12.1s 1.4s -0.27 11.8%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.5s 6.9s 403ms -0.2 5.8%
devManagerResponsive 4s 4.3s 276ms -0.44 6.4%
devManagerHeaderVisible 752ms 690ms -62ms -0.96 -9%
devManagerIndexVisible 789ms 725ms -64ms -1 -8.8%
devStoryVisibleUncached 1.3s 867ms -491ms -1.07 -56.6%
devStoryVisible 791ms 726ms -65ms -0.98 -9%
devAutodocsVisible 683ms 644ms -39ms -0.82 -6.1%
devMDXVisible 639ms 651ms 12ms -0.61 1.8%
buildManagerHeaderVisible 703ms 670ms -33ms -0.76 -4.9%
buildManagerIndexVisible 709ms 671ms -38ms -0.86 -5.7%
buildStoryVisible 740ms 745ms 5ms -0.65 0.7%
buildAutodocsVisible 628ms 608ms -20ms -1.05 -3.3%
buildMDXVisible 694ms 631ms -63ms -0.55 -10%

Greptile Summary

This PR re-exports the vite-plugin-storybook-nextjs from @storybook/experimental-nextjs-vite, simplifying the setup process for Next.js users with Vite in Storybook projects.

  • Added code/frameworks/experimental-nextjs-vite/src/vite-plugin/index.ts to re-export the plugin as storybookNextJsPlugin
  • Updated code/frameworks/experimental-nextjs-vite/package.json to include the plugin as a dependency
  • Modified code/addons/vitest/src/postinstall.ts to use the re-exported plugin for Next.js configuration
  • Removed vite-plugin-storybook-nextjs from extra dependencies in code/lib/cli-storybook/src/sandbox-templates.ts
  • Updated documentation in docs/api/portable-stories/portable-stories-vitest.mdx to reflect the new import path

@valentinpalkovic valentinpalkovic added feature request nextjs ci:daily Run the CI jobs that normally run in the daily job. labels Aug 30, 2024
Copy link

nx-cloud bot commented Aug 30, 2024

☁️ Nx Cloud Report

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

@@ -0,0 +1,3 @@
import vitePluginStorybookNextJs from 'vite-plugin-storybook-nextjs';
Copy link
Member

Choose a reason for hiding this comment

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

I assume in the future we also want to move the contents of the package into the monorepo?

@valentinpalkovic valentinpalkovic force-pushed the valentin/re-export-next-js-vite-plugin branch from a2601ad to 295bf1d Compare September 1, 2024 10:06
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

🙌

@valentinpalkovic valentinpalkovic force-pushed the valentin/re-export-next-js-vite-plugin branch from 295bf1d to dea51a7 Compare September 2, 2024 06:59
@valentinpalkovic valentinpalkovic marked this pull request as ready for review September 2, 2024 08:46
@valentinpalkovic valentinpalkovic merged commit 56b28c0 into next Sep 2, 2024
108 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/re-export-next-js-vite-plugin branch September 2, 2024 08:46
@github-actions github-actions bot mentioned this pull request Sep 2, 2024
9 tasks
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.

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

Comment on lines +6 to +7
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

style: Consider removing the @ts-ignore and properly typing the module declaration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:daily Run the CI jobs that normally run in the daily job. feature request nextjs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants