Skip to content

chore(deps): upgrade next.js to v15 #551

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

chore(deps): upgrade next.js to v15 #551

wants to merge 2 commits into from

Conversation

junhyoung-ryu
Copy link
Collaborator

@junhyoung-ryu junhyoung-ryu commented May 9, 2025

PR Type

Enhancement


Description

  • Upgrade Next.js to v15 and React to v19

  • Refactor pages into async server + client components

  • Await params and searchParams in routes

  • Update cookie/header utilities to async calls


Changes walkthrough 📝

Relevant files
Enhancement
14 files
page.tsx
Refactor streams page into async server component               
+8/-479 
MyStreamsClient.tsx
Extract `MyStreams` logic into client component                   
+486/-0 
page.tsx
Convert stream page to async server wrapper                           
+6/-168 
StreamClient.tsx
Create client component for stream form                                   
+175/-0 
page.tsx
Refactor playground page to server/client split                   
+13/-56 
PlaygroundClient.tsx
Add client component for playground UI                                     
+57/-0   
route.ts
Await `params.id` in clip API handlers                                     
+8/-7     
page.tsx
Await `searchParams` in create page                                           
+6/-6     
page.tsx
Await `slug` in embed clips page                                                 
+8/-4     
route.ts
Await `streamkey` in proxy route handlers                               
+9/-6     
page.tsx
Await `params` and `searchParams` in pipeline page             
+6/-10   
actions.ts
Make `cookies()` calls async with await                                   
+3/-3     
auth.ts
Await `headers()` and `cookies()` in auth util                     
+2/-2     
page.tsx
Convert embed page to await `slug`                                             
+2/-2     
Dependencies
1 files
package.json
Bump `next`, `react`, and related deps                                     
+4/-4     
Additional files
2 files
auth.ts +0/-1     
pnpm-lock.yaml +2150/-1195

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copy link

    vercel bot commented May 9, 2025

    The latest updates on your projects. Learn more about Vercel for Git ↗︎

    Name Status Preview Comments Updated (UTC)
    pipelines-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 9, 2025 1:21am

    Copy link

    github-actions bot commented May 9, 2025

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Missing Import

    The code uses await cookies() but there is no import of cookies from "next/headers". Without importing cookies, these calls will fail at runtime.

    export const getSourceClipIdFromCookies = async () => {
      return (await cookies()).get(SOURCE_CLIP_ID_COOKIE_NAME)?.value;
    };
    
    export const setSourceClipIdToCookies = async (clipId: string) => {
      (await cookies()).set(SOURCE_CLIP_ID_COOKIE_NAME, clipId, {
        path: "/",
        expires: new Date(Date.now() + SOURCE_CLIP_ID_COOKIE_EXPIRATION_IN_MS),
      });
    };
    
    export const deleteSourceClipIdFromCookies = async () => {
      (await cookies()).delete(SOURCE_CLIP_ID_COOKIE_NAME);
    };
    Missing Import

    The implementation calls await headers() and await cookies() without importing headers or cookies from "next/headers". These utilities must be imported to work correctly.

    const headersList = await headers();
    const accessToken = headersList.get("Authorization")?.replace(/^Bearer /, "");
    
    const cookieStore = await cookies();
    const privyCookie = cookieStore.get("privy-token");
    Props Shape Mismatch

    The searchParams prop is typed and awaited as Promise<{ searchParams: any }>, which results in a nested object ({ searchParams: {...} }). This may not match the expected shape in MyStreamsClient and could lead to undefined values.

    import MyStreamsClient from "./MyStreamsClient";
    
    export default async function MyStreams({
      searchParams,
    }: {
      searchParams: Promise<{ searchParams: any }>;
    }) {
      return <MyStreamsClient searchParams={await searchParams} />;
    }

    Copy link

    github-actions bot commented May 9, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Align React peer versions

    Update the peer React versions inside this lock entry to consistently use React
    v19.1.0 for both react and react-dom, preventing mismatched peer dependency
    conflicts. Adjust the inner version markers accordingly.

    pnpm-lock.yaml [11427]

    Suggestion importance[1-10]: 5

    __

    Why: The entry at @floating-ui/[email protected] still references React v18.3.1, and updating it to v19.1.0 ensures consistent peer deps and prevents mismatch.

    Low
    Fix HeadlessUI peer deps

    Ensure the HeadlessUI lock entry’s peer specs are upgraded to React v19.1.0 for both
    react and react-dom to maintain consistency and avoid runtime errors. Replace the
    nested version references with 19.1.0.

    pnpm-lock.yaml [11514]

    Suggestion importance[1-10]: 5

    __

    Why: The @headlessui/[email protected] lock entry uses React v18.3.1, so bumping to v19.1.0 aligns its peer deps and avoids potential version conflicts.

    Low
    Remove await from cookies call

    Remove the unnecessary await before cookies() since cookies() returns synchronously
    in the server context. This prevents wrapping a synchronous API in a Promise and
    avoids potential runtime errors.

    apps/app/components/daydream/Clipping/actions.ts [9-11]

     export const getSourceClipIdFromCookies = async () => {
    -  return (await cookies()).get(SOURCE_CLIP_ID_COOKIE_NAME)?.value;
    +  return cookies().get(SOURCE_CLIP_ID_COOKIE_NAME)?.value;
     };
    Suggestion importance[1-10]: 4

    __

    Why: The cookies() helper in Next.js is synchronous, so removing the unnecessary await simplifies the code with minimal impact.

    Low
    Remove await from headers and cookies

    Drop the await when calling headers() and cookies() because these functions are
    synchronous helpers in Next.js server components. Using them without await ensures
    correct behavior and avoids wrapping non-Promise values.

    apps/app/lib/auth.ts [11-14]

    -const headersList = await headers();
    -const cookieStore = await cookies();
    +const headersList = headers();
    +const cookieStore = cookies();
    Suggestion importance[1-10]: 4

    __

    Why: Both headers() and cookies() return synchronously in server components, so dropping the await cleans up the code without altering functionality.

    Low

    @thomshutt
    Copy link
    Contributor

    Nice! Once this is ready, let's try and test and deploy it standalone (i.e immediately after another deploy) in case it has any side effects

    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