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

Upgrade to Next.js 14 Best Practices #272

Closed
wei opened this issue Apr 12, 2024 · 7 comments
Closed

Upgrade to Next.js 14 Best Practices #272

wei opened this issue Apr 12, 2024 · 7 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@wei
Copy link
Owner

wei commented Apr 12, 2024

In addition to just bumping the version like in #268, let's also update the project structure to the latest recommended by Next.js (App directory). Let's also explore the use of server components (if applicable).

@wei wei added good first issue Good for newcomers help wanted Extra attention is needed labels Apr 12, 2024
jeevikasirwani added a commit to jeevikasirwani/socialify that referenced this issue Apr 12, 2024
@KemingHe
Copy link
Collaborator

Hello, @wei. Happy to assist you with migrating to using App dir. Good news is that NextJS supports both at the same time so we can do incremental moves. Let me know how you'd like to proceed. I'm very familiar with the process.

Hear from you soon.

@wei
Copy link
Owner Author

wei commented Apr 28, 2024

Hello, @wei. Happy to assist you with migrating to using App dir. Good news is that NextJS supports both at the same time so we can do incremental moves. Let me know how you'd like to proceed. I'm very familiar with the process.

Hear from you soon.

Hey hey @KemingHe awesome! That'd bea lot of help ❤️. Assigning to you for now 😁

KemingHe added a commit to KemingHe/contrib-socialify that referenced this issue May 6, 2024
Add multi-line, detailed description
@KemingHe
Copy link
Collaborator

KemingHe commented May 6, 2024

In addition to just bumping the version like in #268, let's also update the project structure to the latest recommended by Next.js (App directory). Let's also explore the use of server components (if applicable).

Hello @wei, I suggest we split this issue into two sub tasks:

  • Bump to Next.js ver.14
  • Bump from Page Router to App Rounter

This way, updates are more incremental, and less pressure on the devs to get everything right first and only time. Let me know what you think. ❤️

@wei
Copy link
Owner Author

wei commented May 6, 2024

Sure, I will review and merge dependabot's #289 for the version bump since it's backwards compatible.

@wei
Copy link
Owner Author

wei commented May 6, 2024

Upgrade to Next.js 14 in #289 has been complete. Pending research on whether App directory, server components, or any other Next 14 features make sense in our project.

@wei wei changed the title Upgrade to Next.js 14 Upgrade to Next.js 14 Best Practices May 6, 2024
@KemingHe
Copy link
Collaborator

KemingHe commented May 6, 2024

Honestly, Page Router is fine for Next.js 14, I assume it will take at least 1~2 year until they sunset it. The upside App Router brings to the project are:

  1. Eliminates manual routing, structure/flexibility tradeoff (though more beginner-friendly),
  2. Centralized src, api, components code management, easier to refactor, especially with aliasing,

and that's about it. The client/server declaration can just be hard-coded into each page.

All in all, if you want new features over slightly better and future-proofing code, I recommend shelving this util nearing Next ver 15 release.

Let me know what you think: @wei

@wei
Copy link
Owner Author

wei commented May 6, 2024

Thanks for the insight. Sounds like a plan. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: Done
Development

No branches or pull requests

2 participants