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

Next.js-Vite: Streamline Next.js dir option #28995

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

valentinpalkovic
Copy link
Contributor

@valentinpalkovic valentinpalkovic commented Aug 28, 2024

Closes #

What I did

I have streamlined the Next.js config dir configuration for the Next.js Vite framework.

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 76.4 MB 76.4 MB 0 B -0.01 0%
initSize 161 MB 161 MB -386 B -0.54 0%
diffSize 84.8 MB 84.8 MB -386 B -0.54 0%
buildSize 7.48 MB 7.48 MB 0 B 1.36 0%
buildSbAddonsSize 1.62 MB 1.62 MB 0 B 0.33 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.31 MB 2.31 MB 0 B 1.36 0%
buildSbPreviewSize 352 kB 352 kB 0 B 0.33 0%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.47 MB 4.47 MB 0 B 1.36 0%
buildPreviewSize 3.01 MB 3.01 MB 0 B 1.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 6.7s 15.2s 8.4s 0.11 55.6%
generateTime 19.2s 23.3s 4.1s 0.57 17.7%
initTime 16.1s 19.1s 3s 1.53 🔺15.9%
buildTime 11s 11.4s 335ms -0.81 2.9%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6s 8.2s 2.1s 0.79 26.3%
devManagerResponsive 3.9s 5.2s 1.3s 0.76 25.1%
devManagerHeaderVisible 1s 914ms -162ms 0.64 -17.7%
devManagerIndexVisible 1.1s 956ms -159ms 0.64 -16.6%
devStoryVisibleUncached 1.3s 1.8s 521ms 0.62 28.1%
devStoryVisible 1.1s 957ms -159ms 0.64 -16.6%
devAutodocsVisible 608ms 856ms 248ms 1.05 29%
devMDXVisible 692ms 823ms 131ms 0.62 15.9%
buildManagerHeaderVisible 656ms 943ms 287ms 1.71 🔺30.4%
buildManagerIndexVisible 662ms 946ms 284ms 1.59 🔺30%
buildStoryVisible 692ms 986ms 294ms 1.34 🔺29.8%
buildAutodocsVisible 668ms 907ms 239ms 3.15 🔺26.4%
buildMDXVisible 586ms 730ms 144ms 0.22 19.7%

Greptile Summary

This PR streamlines the Next.js configuration for the experimental Next.js Vite framework in Storybook, simplifying the setup process and aligning it more closely with Next.js conventions.

  • Replaced nextAppDir with nextConfigPath in viteFinal function in code/frameworks/experimental-nextjs-vite/src/preset.ts
  • Updated FrameworkOptions type in code/frameworks/experimental-nextjs-vite/src/types.ts to include nextConfigPath instead of nextAppDir
  • Modified viteFinal function to use nextConfigPath for determining the Next.js configuration directory
  • Improved import statements and type usage in preset.ts for better code organization
  • Potential backwards compatibility concerns due to the change from nextAppDir to nextConfigPath

Copy link

nx-cloud bot commented Aug 28, 2024

☁️ Nx Cloud Report

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

Sent with 💌 from NxCloud.

@valentinpalkovic valentinpalkovic marked this pull request as ready for review August 29, 2024 07:36
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

@@ -1,4 +1,6 @@
// https://storybook.js.org/docs/react/addons/writing-presets
import path from 'node:path';
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 using import path from 'path' for consistency with other imports

@valentinpalkovic valentinpalkovic merged commit f82fdf9 into next Aug 30, 2024
66 of 71 checks passed
@valentinpalkovic valentinpalkovic deleted the valentin/nextjs-streamline-nextjs-dir-option branch August 30, 2024 11:11
@github-actions github-actions bot mentioned this pull request Aug 30, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants