storybookjs / storybook

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

Nextjs-Vite: Add Next.js 15 support #29640

Closed yannbf closed 2 days ago

yannbf commented 4 days ago

Closes #

What I did

This PR adds Next.js 15 support to the nextjs-vite framework. This requires changes in the vite-plugin-next repo which are accounted for in https://github.com/storybookjs/vite-plugin-storybook-nextjs/pull/27

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

More information | | | | --- | --- | | **Published version** | [`0.0.0-pr-29640-sha-e762e5df`](https://npmjs.com/package/storybook/v/0.0.0-pr-29640-sha-e762e5df) | | **Triggered by** | @yannbf | | **Repository** | [storybookjs/storybook](https://github.com/storybookjs/storybook) | | **Branch** | [`yann/next-15-support-vite`](https://github.com/storybookjs/storybook/tree/yann/next-15-support-vite) | | **Commit** | [`e762e5df`](https://github.com/storybookjs/storybook/commit/e762e5dfc503fd87301cf2459324e155b1d02343) | | **Datetime** | Tue Nov 19 15:56:35 UTC 2024 (`1732031795`) | | **Workflow run** | [11916826559](https://github.com/storybookjs/storybook/actions/runs/11916826559) | To request a new release of this pull request, mention the `@storybookjs/core` team. _core team members can create a new canary release [here](https://github.com/storybookjs/storybook/actions/workflows/canary-release-pr.yml) or locally with `gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=29640`_
name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 78.4 MB 78.4 MB 0 B 0.28 0%
initSize 144 MB 144 MB -169 kB 0.2 -0.1%
diffSize 65.3 MB 65.2 MB -169 kB -0.2 -0.3%
buildSize 7.03 MB 6.88 MB -156 kB -0.18 -2.3%
buildSbAddonsSize 1.51 MB 1.51 MB 0 B - 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.06 MB 1.9 MB -156 kB -0.23 -8.2%
buildSbPreviewSize 271 kB 271 kB 0 B - 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.04 MB 3.88 MB -156 kB -0.23 -4%
buildPreviewSize 3 MB 3 MB -148 B 0.9 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 25.8s 26.1s 247ms 1.31 0.9%
generateTime 22.9s 19.5s -3s -349ms -0.53 -17.1%
initTime 14.9s 13.4s -1s -480ms -0.87 -11%
buildTime 8s 9s 1s 0.11 11.5%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.8s 6.1s -725ms 0.87 -11.7%
devManagerResponsive 4s 3.6s -455ms 0.3 -12.5%
devManagerHeaderVisible 608ms 559ms -49ms 0.1 -8.8%
devManagerIndexVisible 702ms 592ms -110ms -0.34 -18.6%
devStoryVisibleUncached 1.1s 960ms -214ms -0.11 -22.3%
devStoryVisible 647ms 591ms -56ms -0.21 -9.5%
devAutodocsVisible 502ms 482ms -20ms -0.34 -4.1%
devMDXVisible 548ms 488ms -60ms -0.13 -12.3%
buildManagerHeaderVisible 611ms 543ms -68ms -0.22 -12.5%
buildManagerIndexVisible 628ms 554ms -74ms -0.31 -13.4%
buildStoryVisible 613ms 538ms -75ms -0.27 -13.9%
buildAutodocsVisible 601ms 457ms -144ms -0.39 -31.5%
buildMDXVisible 493ms 413ms -80ms -0.51 -19.4%

Greptile Summary

Added support for Next.js 15 in Storybook's experimental Next.js Vite framework, with key updates to package dependencies, compatibility layers, and template stories.

nx-cloud[bot] commented 4 days ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 6a1bbc47aeda37b398d249a16580e8f8f964ace1. 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/JVHnATG0hm?utm_source=pull-request&utm_medium=comment)

Sent with 💌 from NxCloud.

storybook-pr-benchmarking[bot] commented 4 days ago

Package Benchmarks

Commit: 6a1bbc4, ran on 19 November 2024 at 18:56:46 UTC

The following packages have significant changes to their size or dependencies:

@storybook/core

Before After Difference
Dependency count 46 46 0
Self size 19.24 MB 19.08 MB 🎉 -169 KB 🎉
Dependency size 14.29 MB 14.29 MB 0 B
Bundle Size Analyzer Link Link

@storybook/experimental-nextjs-vite

Before After Difference
Dependency count 87 87 0
Self size 230 KB 231 KB 🚨 +161 B 🚨
Dependency size 31.03 MB 31.30 MB 🚨 +269 KB 🚨
Bundle Size Analyzer Link Link

storybook

Before After Difference
Dependency count 47 47 0
Self size 22 KB 22 KB 0 B
Dependency size 33.54 MB 33.37 MB 🎉 -169 KB 🎉
Bundle Size Analyzer Link Link

sb

Before After Difference
Dependency count 48 48 0
Self size 1 KB 1 KB 0 B
Dependency size 33.56 MB 33.39 MB 🎉 -169 KB 🎉
Bundle Size Analyzer Link Link

@storybook/cli

Before After Difference
Dependency count 390 390 0
Self size 483 KB 483 KB 🎉 -282 B 🎉
Dependency size 74.60 MB 74.43 MB 🎉 -172 KB 🎉
Bundle Size Analyzer Link Link

@storybook/codemod

Before After Difference
Dependency count 270 270 0
Self size 612 KB 612 KB 0 B
Dependency size 64.60 MB 64.43 MB 🎉 -169 KB 🎉
Bundle Size Analyzer Link Link

create-storybook

Before After Difference
Dependency count 105 105 0
Self size 1.11 MB 1.11 MB 🎉 -3 KB 🎉
Dependency size 42.54 MB 42.37 MB 🎉 -169 KB 🎉
Bundle Size Analyzer Link Link