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

Migrate to nextjs 15 #1036

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Migrate to nextjs 15 #1036

wants to merge 12 commits into from

Conversation

rin-st
Copy link
Member

@rin-st rin-st commented Jan 17, 2025

Next 15 what's new and migration guides here

codemods used:

react:
main migration codemod
types-react-codemod

nextjs:
async request api

Plus changed the next config file

Note: After updating deps, compile times for se-2 homepage were crazy 60-100 seconds, but then the problem eventually disappeared. Currently compile times in dev mode for me is like 8-13sec. Hopefully, for you it will work fine from the start


Things I thought about but decided it's not worth it


TODOs after migration to next15

  1. Update SRE extensions
  1. Update Eslint to v9 and all related packages, finally

Fixes #1033

@damianmarti
Copy link
Member

Thanks @rin-st I will take a look and test.

Maybe some of the extensions have to be updated too, mainly if they use a page param, right?

Copy link
Member

@damianmarti damianmarti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good and it seems do not have any missing migration stuff.

Tested and it's working fine.

The first time the compilation took me about 16 seconds and next one about 8 seconds, so it doesn't be an issue there.

I'm getting a deprecation warning after the compilation is done:

✓ Compiled / in 8.1s (7831 modules)
(node:142505) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

Thanks!!

Copy link
Collaborator

@Pabl0cks Pabl0cks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Been testing it on Windows and LGTM! Nice job @rin-st!!🙌

Had a problem when tried to yarn build but it worked well after deleting my .next folder

Copy link
Collaborator

@technophile-04 technophile-04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rin-st! Working great! did some testing and seems great to me! Just added a small comment https://github.com/scaffold-eth/scaffold-eth-2/pull/1036/files#r1926345215 but happy to merge it 🙌


Lol NextJs showing error overlay now for all types of error seems a bit strange, in previous version it was only showing it for "Unhandled error".

Especially the error of Grammarly/colorzilla extension:

Error image

Screenshot 2025-01-23 at 9 58 33 AM

Rauch response on it: https://x.com/rauchg/status/1871268516508381412

Similarly when chain is not started it show the error overlay, lol we can't do anything about since nextjs plans to do it that way.

I was researching about this error overlay seems like they are improving this error overlays a lot checkout their changelog the "[DevOverlay]" seem good, probably they will release that in 15.2.x version but looks nice.

@rin-st
Copy link
Member Author

rin-st commented Jan 23, 2025

Thanks for reviews !

I'm getting a deprecation warning after the compilation is done:

✓ Compiled / in 8.1s (7831 modules)
(node:142505) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

Thanks!!

Strange, I don't get that error

Lol NextJs showing error overlay now for all types of error seems a bit strange, in previous version it was only showing it for "Unhandled error".
Especially the error of Grammarly/colorzilla extension:

Oh yes, forgot to mention it. I don't like it too but dont know for now how to fix this

I was researching about this error overlay seems like they are improving this error overlays a lot checkout their changelog the "[DevOverlay]" seem good, probably they will release that in 15.2.x version but looks nice.

Probably we need to wait until 15.2 then because for now it shows red error button for every contract error, even when there is a catch block for that error 🤷‍♂️

@rin-st
Copy link
Member Author

rin-st commented Jan 23, 2025

lol I figured this out. It shows error button for every console.error. So I changed console.error to console.warn and red button disappeared. If you'll find a better way to fix that please lmk

@technophile-04
Copy link
Collaborator

Strange, I don't get that error

I think its shows up if you use latest node version?

Probably we need to wait until 15.2 then because for now it shows red error button for every contract error, even when there is a catch block for that error 🤷‍♂️

Ohh I think it won't be solved in 15. 2 as well, "I think" because (I wasn't able to find the changeset were they discussed) NextJs plan to move this way in future showing console.error in that overlay as well.

In 15.2 I think they are improving the styles of it a lot and making it more better.

lol I figured this out. It shows error button for every console.error. So I changed console.error to console.warn and red button disappeared. If you'll find a better way to fix that please lmk

Umm regarding this, probably I think we shouldn't change all console.error to console.warning, since its only show in dev environment its fine?

Maybe instead of converting all console.error to console.warning we only change the sensible ones? Like for example

Showing write contract error, we shouldn't give overlay (i.e console.error) because we are already showing toast and we could give full error in console with warn?

maybe we can wait for 15.2 @rin-st and see what say? if it improves? Because I see they are moving fast with 15.2 canary and probably release new version soon?

If the overlay is still their for console.error then we take the decision where to put console.war and where to use console.error?

@rin-st
Copy link
Member Author

rin-st commented Jan 27, 2025

maybe we can wait for 15.2 @rin-st and see what say? if it improves? Because I see they are moving fast with 15.2 canary and probably release new version soon?

If the overlay is still their for console.error then we take the decision where to put console.war and where to use console.error?

Yes, let's wait! Thanks!

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.

Migrate to Nextjs v15
4 participants