-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Base for new nextjs-vite-rsc framework #32411
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
base: next
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
69 files reviewed, 45 comments
|
||
export const RSC = async ({ label }: { label: string }) => <>RSC {label}</>; | ||
|
||
export const Nested = async ({ children }: any) => <>Nested {children}</>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Consider using a more specific type instead of any
for children prop. Could use React.ReactNode
for better type safety.
export const Nested = async ({ children }: any) => <>Nested {children}</>; | |
export const Nested = async ({ children }: { children: React.ReactNode }) => <>Nested {children}</>; |
@@ -0,0 +1,93 @@ | |||
Copyright 2020 The Rubik Filtered Project Authors (https://https://github.com/NaN-xyz/Rubik-Filtered) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: URL has duplicate 'https://' protocol - should be 'https://github.com/NaN-xyz/Rubik-Filtered'
Copyright 2020 The Rubik Filtered Project Authors (https://https://github.com/NaN-xyz/Rubik-Filtered) | |
Copyright 2020 The Rubik Filtered Project Authors (https://github.com/NaN-xyz/Rubik-Filtered) |
@@ -0,0 +1,54 @@ | |||
import type { Meta, StoryObj } from '@storybook/nextjs-vite'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Import should be from '@storybook/nextjs-vite-rsc' to match the new framework package being created, not '@storybook/nextjs-vite'
import type { Meta, StoryObj } from '@storybook/nextjs-vite'; | |
import type { Meta, StoryObj } from '@storybook/nextjs-vite-rsc'; |
* | ||
* ```jsx | ||
* // setup-file.js | ||
* import { setProjectAnnotations } from '@storybook/nextjs-vite'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Package name should be '@storybook/nextjs-vite-rsc' to match the actual framework name
* import { setProjectAnnotations } from '@storybook/nextjs-vite'; | |
* import { setProjectAnnotations } from '@storybook/nextjs-vite-rsc'; |
test: { | ||
// This is needed until Next will update to the React 19 beta: https://github.com/vercel/next.js/pull/65058 | ||
// In the React 19 beta ErrorBoundary errors (such as redirect) are only logged, and not thrown. | ||
// We will also suspress console.error logs for re the console.error logs for redirect in the next framework. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syntax: Typo in comment: 'suspress' should be 'suppress'
// We will also suspress console.error logs for re the console.error logs for redirect in the next framework. | |
// We will also suppress console.error logs for re the console.error logs for redirect in the next framework. |
import type { Meta, StoryObj } from '@storybook/nextjs-vite'; | ||
import { getRouter } from '@storybook/nextjs-vite/navigation.mock'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Import paths should reference '@storybook/nextjs-vite-rsc' instead of '@storybook/nextjs-vite' for the RSC framework
import type { Meta, StoryObj } from '@storybook/nextjs-vite'; | |
import { getRouter } from '@storybook/nextjs-vite/navigation.mock'; | |
import type { Meta, StoryObj } from '@storybook/nextjs-vite-rsc'; | |
import { getRouter } from '@storybook/nextjs-vite-rsc/navigation.mock'; |
{ | ||
exportEntries: ['./preset'], | ||
entryPoint: './src/preset.ts', | ||
dts: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Missing dts: false
for mock entries - mock modules in browser entries should have TypeScript declaration generation disabled to match the pattern used in the existing nextjs framework
@@ -0,0 +1,8 @@ | |||
{ | |||
"name": "nextjs-vite", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Project name should be 'nextjs-vite-rsc' to match the directory name and avoid conflicts with existing nextjs-vite framework
"name": "nextjs-vite", | |
"name": "nextjs-vite-rsc", |
const HeadManagerProvider: React.FC<PropsWithChildren> = ({ children }) => { | ||
const headManager: HeadManagerValue = useMemo(initHeadManager, []); | ||
headManager.getIsSsr = () => false; | ||
|
||
return <HeadManagerContext.Provider value={headManager}>{children}</HeadManagerContext.Provider>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: This implementation is identical to the existing nextjs-vite framework. Consider extracting this into a shared utility to reduce code duplication between the two frameworks.
@@ -0,0 +1,22 @@ | |||
import { fn } from 'storybook/test'; | |||
|
|||
// biome-ignore lint/suspicious/noExplicitAny: <explanation> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: incomplete biome-ignore comment lacks proper explanation
// biome-ignore lint/suspicious/noExplicitAny: <explanation> | |
// biome-ignore lint/suspicious/noExplicitAny: Callback function needs to accept any arguments and return any Promise for Next.js cache API compatibility |
Closes #
What I did
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
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal
,ci:merged
orci:daily
GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/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>
Greptile Summary
Updated On: 2025-09-04 12:19:23 UTC
This PR creates the foundational structure for a new
@storybook/nextjs-vite-rsc
framework that supports React Server Components (RSC) with Vite as the build tool. The implementation closely mirrors the existingnextjs-vite
framework but establishes a separate package to handle RSC-specific requirements.The changes include:
RSC.tsx
andNextHeader.tsx
that demonstrate server components, server actions, and async functionalityThe framework reuses significant portions of the existing
nextjs-vite
implementation while creating a distinct package path that allows for RSC-specific customizations. The template includes comprehensive examples demonstrating authentication flows, cookie/header management, and server component patterns that are essential for RSC development.Confidence score: 2/5