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 15 #373

Closed
wei opened this issue Oct 23, 2024 · 17 comments
Closed

Upgrade to Next.js 15 #373

wei opened this issue Oct 23, 2024 · 17 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@wei
Copy link
Owner

wei commented Oct 23, 2024

https://nextjs.org/docs/app/building-your-application/upgrading/version-15

@wei wei added good first issue Good for newcomers help wanted Extra attention is needed labels Oct 23, 2024
@wei wei added this to Socialify Oct 23, 2024
@github-project-automation github-project-automation bot moved this to To do in Socialify Oct 23, 2024
@shubhamkhan
Copy link

Hi @wei, /assign me this, I am interested to upgrade.

@wei wei assigned shubhamkhan and unassigned shubhamkhan Oct 25, 2024
@wei wei linked a pull request Oct 25, 2024 that will close this issue
@wei wei assigned wei and shubhamkhan and unassigned wei Nov 23, 2024
@KemingHe
Copy link
Collaborator

KemingHe commented Dec 12, 2024

Hi, I'll be happy to deliver this in the next few days. Getting a branch going on my fork right now... Edit: separated comments for clarity

@wei wei assigned wei and KemingHe and unassigned wei Dec 12, 2024
@wei wei moved this from To do to In progress in Socialify Dec 12, 2024
@KemingHe
Copy link
Collaborator

@wei I understood as you'd like to upgrade to 15 first and then do the page router > app router migration?

Doing it in this order might cause unexpected issues, from the docs I've read so far; but I can first try and let you know.

@wei
Copy link
Owner Author

wei commented Dec 12, 2024

@KemingHe We can migrate in one go, no need to separate.

@KemingHe
Copy link
Collaborator

@KemingHe We can migrate in one go, no need to separate.

It's actually 3 separate migrations:

  • Next 14 to 15
  • React 18 to 19
  • Page router to app router

and only the last one is confirmed stable. Should I keep the page router when doing the first two steps (they are bundled together by NextJS)? What's your recommendation?

@wei
Copy link
Owner Author

wei commented Dec 12, 2024

only the last one is confirmed stable

Can you explain what you mean? I believe Next 15 and React 19 are both stable now. I'll let you decide the best workflow~

@KemingHe
Copy link
Collaborator

I see, okay. I will try a couple different ways and let you know then.


This is what I was referring to:

Ref https://nextjs.org/docs/app/building-your-application/upgrading/version-15

Good to know:

If you see a peer dependencies warning, you may need to update react and react-dom to the suggested versions, or you use the --force or --legacy-peer-deps flag to ignore the warning. This won't be necessary once both Next.js 15 and React 19 are stable.

and we are instructed to use react@rc react-dom@rc (release candidate) instead of react@latest, meaning it's unstable.

@wei
Copy link
Owner Author

wei commented Dec 12, 2024

Sounds good, React 19 just turned stable so they probably need to update their docs.

I just noticed https://nextjs.org/docs/messages/no-stylesheets-in-head-component please also fix as part of the upgrade if you don't mind or I can do a separate PR as well.

@KemingHe
Copy link
Collaborator

I just noticed https://nextjs.org/docs/messages/no-stylesheets-in-head-component please also fix as part of the upgrade if you don't mind or I can do a separate PR as well.

No worries, this is already part of the page router > app router upgrade like you mentioned.

On it right now.

@KemingHe
Copy link
Collaborator

Hi @wei , I've been making great progress on the page > app router migration so far. All static elements (metadata, 404, landing page, header, footer...) plus unit tests are done.

Would you like me to add API endpoint testing while I'm at it? (This will roughly double the delivery time but a must-have to ensure api consistency.)

Any recommendations you'd like me to be aware of?

@KemingHe
Copy link
Collaborator

Additional context: NextJS 14+ app router calls for complete API refactor, so that's why even if the api behaviors are fine (Playwright), I want a future-proof way of making sure they are internally consistent.

@wei
Copy link
Owner Author

wei commented Dec 13, 2024

That's fantastic!

Let's add api testing in a separate pr after this one.

Can you create an issue with your proposal of how you plan to implement api testing? I've used nock before but open to other options.

@KemingHe
Copy link
Collaborator

Hello @wei , I think it'd be really helpful to the page > app router migration if we could talk through the architecture of Socialify over Zoom. What's your top 3 most available time slots in the next few days? I'm very flexible.

Hear from you soon!

@KemingHe
Copy link
Collaborator

Awesome news: API migration confirmed working, AND the simplest way to add testing is to use Playwright to expect match snapshot, since the endpoints mostly return images.

Very close to full site migration to app router. Still would appreciate a Zoom meeting to speed things up.

@wei
Copy link
Owner Author

wei commented Dec 14, 2024

Excellent, let's coordinate over dm

@KemingHe
Copy link
Collaborator

Talk to you soon in LinkedIn. 🌻

@wei
Copy link
Owner Author

wei commented Dec 19, 2024

Resolved in #450 🚀

@wei wei closed this as completed Dec 19, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Socialify Dec 19, 2024
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

Successfully merging a pull request may close this issue.

3 participants