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

chore(deps): upgrade nextjs 15 #540

Closed
wants to merge 4 commits into from
Closed

Conversation

duyet
Copy link
Owner

@duyet duyet commented Oct 30, 2024

Summary by Sourcery

Refactor components to improve data handling and structure by using Promise-based destructuring for params and restructuring the responsibilities list in the ExperienceItem component. Remove the swcMinify option from the Next.js configuration.

Enhancements:

  • Refactor the responsibilities list in the ExperienceItem component to use an array of objects with id and item properties for better structure and key management.
  • Update the handling of params in various components to use Promise-based destructuring, improving asynchronous data handling.

Chores:

  • Remove the swcMinify option from the Next.js configuration file.

Copy link
Contributor

sourcery-ai bot commented Oct 30, 2024

Reviewer's Guide by Sourcery

This PR upgrades Next.js to version 15 and includes several changes to adapt the codebase to the new version's requirements. The main changes involve handling async params in page components, updating component types, and adjusting configuration settings.

Updated class diagram for PostsByCategory component

classDiagram
    class Params {
        category: string
    }

    class PostsByCategoryProps {
        params: Promise<Params>
    }

    class PostsByCategory {
        +PostsByCategoryProps props
        +render(): React.ReactNode
    }

    PostsByCategory --> PostsByCategoryProps
    PostsByCategoryProps --> Params
    note for PostsByCategoryProps "Updated params to be a Promise of Params"
Loading

File-Level Changes

Change Details Files
Updated page components to handle async params
  • Changed params type from direct object to Promise
  • Added await for params resolution in component functions
  • Updated type definitions to reflect async params
apps/blog/app/category/[category]/page.tsx
apps/blog/app/tag/[tag]/page.tsx
apps/blog/app/[year]/[month]/[slug]/page.tsx
apps/blog/app/[year]/page.tsx
apps/blog/app/series/[slug]/page.tsx
Enhanced experience component type safety
  • Added id property to responsibility items
  • Updated responsibility type from array of strings/nodes to array of objects with id and item properties
  • Modified key prop usage in responsibility list rendering
apps/cv/app/page.tsx
apps/cv/components/experience.tsx
Updated Next.js configuration and hydration handling
  • Removed swcMinify configuration option
  • Added suppressHydrationWarning to root html elements
  • Relocated revalidate settings to appropriate page components
apps/blog/next.config.js
apps/insights/app/layout.tsx
apps/cv/app/layout.tsx
apps/insights/app/blog/page.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

vercel bot commented Oct 30, 2024

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

Name Status Preview Comments Updated (UTC)
blog 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 30, 2024 3:09pm
cv 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 30, 2024 3:09pm
insights 🔄 Building (Inspect) Visit Preview 💬 Add feedback Oct 30, 2024 3:09pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant