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

Next.js 10 #188

Closed
samuelcastro opened this issue Oct 27, 2020 · 11 comments · Fixed by #189, #190, #191 or #192
Closed

Next.js 10 #188

samuelcastro opened this issue Oct 27, 2020 · 11 comments · Fixed by #189, #190, #191 or #192
Assignees
Labels
enhancement New feature or request

Comments

@samuelcastro
Copy link
Contributor

samuelcastro commented Oct 27, 2020

What's the plan to get NRN up to Next.js 10? https://nextjs.org/blog/next-10

There are a lot of new features:

  • Built-in Image Component and Automatic Image Optimization
  • Internationalized Routing
  • Next.js Analytics
  • React 17 Support
  • getStaticProps / getServerSideProps Fast Refresh
  • Fast Refresh for MDX
  • Importing CSS from Third Party React Components
  • Automatic Resolving of href
  • @next/codemod CLI
  • Blocking Fallback for getStaticPaths

What's been done:

What's left to do:

@Vadorequest
Copy link
Member

The plan it to get there ASAP.
As far as I could tell, there is no regression. So it should be a smooth update.

The only major difference is that I need to replace our custom i18n routing with the native one. There might be functional regressions there so this needs to be tested thoroughly.

And use/showcase the Image component too. This is the most exciting part of the update IMHO, as we already have i18n support, and perfs analytics for free (through Amplitude).

@Vadorequest Vadorequest added the enhancement New feature or request label Oct 28, 2020
@Vadorequest Vadorequest self-assigned this Oct 28, 2020
@samuelcastro
Copy link
Contributor Author

samuelcastro commented Oct 28, 2020

Well Amplitude is not quite free right? I think we should embrace Next.js Analytics as well.

And we might need to get rid of GraphCMSAsset in favor of the native Image component, or maybe just incorporate the Image within GraphCMSAsset.

And update all i18n routes utilities in favor of the new automatic resolving of href.

I'm super excited about it. :)

@Vadorequest
Copy link
Member

Vadorequest commented Oct 28, 2020

Amplitude is free until 10 million events a month. So, it's not too bad either. (and more effective if you need to consolidate stats from several sites)

Definitely gonna replace GraphCMSAsset and AirtableAsset with Image, not sure if I'll wrap the Image yet (to deal with custom business rules) or replace them altogether yet.

I hope I can do all those things within the end of the week-end.

@Vadorequest Vadorequest linked a pull request Oct 29, 2020 that will close this issue
@Vadorequest
Copy link
Member

One preset has been upgraded to Next.js 10.

I encountered a few issues, and there are non-backward compatible changes to take care of, but nothing really complicated once you understand the underlying issues.

#189

I'm going to make a PR for the other preset.

@Vadorequest Vadorequest linked a pull request Oct 30, 2020 that will close this issue
@Vadorequest
Copy link
Member

The other preset has been upgraded to Next.js 10.

#190

Note that in order to make is easy to cherry-pick/rebase those changes, I've only done what's required for the upgrade to function normally. There is still a lot of work to be done to benefit from the actual features, but those will be done in separated commits/PRs.

@Vadorequest
Copy link
Member

FA icons have been refactored into a distinct file.

@samuelcastro
Copy link
Contributor Author

samuelcastro commented Oct 30, 2020

There is still a lot of work to be done to benefit from the actual features, but those will be done in separated commits/PRs.

Could you specify what this work means? Refactor GraphCMSAsset to use Image or something?

@Vadorequest
Copy link
Member

Yeah, this and i18n, I18nLink, etc.

There is one regression with the native i18n though, see vercel/next.js#17078 (comment)

@samuelcastro
Copy link
Contributor Author

Ok, it'd be great to create issues for each single feature that needs to be implemented, to keep things more organized and easy to track.

@Vadorequest
Copy link
Member

True. I first thought I'd be able to quickly change the NRN implementation about i18n routing and asset/image, but I've met some drawbacks and changed my mind.

I'm closing this, NRN has been upgraded to Next.js 10 successfully, and both presets have been upgraded.

Further upgrades will be done in distinct PRs.

@samuelcastro
Copy link
Contributor Author

What about automatic resolving of href?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment