Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

Upgrade frontend to Next.js 13.x #319

Closed ferostabio closed 1 year ago

ferostabio commented 1 year ago

I always noticed that we have a FOUT issue (that the default font appears for a bit before switching to our font), so the whole screen changes size. Known issue.

Didn't want to spend much time on it, but I saw that in next 13.x they added a new submodule to preload fonts that work particularly well with Google Fonts, as the one we're using.

I quickly upgraded to 13, solved a few problems, and changed the way we load fonts. There's no FOUT anymore, and it seems everything looks good. Again, I spent only a couple of minutes trying this, so it could be just a starting point, but the impact is significant!

@brozorec care to have a look?

brozorec commented 1 year ago

hey @ferostar ok for me :+1: Would you also update "package.json" with the new version of next and also add @next/font (CI fails because it doesn't find this module)?

github-actions[bot] commented 1 year ago

Please test this PR on: https://v2-staging-319-dot-fuji-306908.ey.r.appspot.com

ferostabio commented 1 year ago

@brozorec just realized something went missing in the UI after upgrading, I'll let you know once I'm done

ferostabio commented 1 year ago

@brozorec turns out there's at least one issue between Next 13 and web3-onboard, going to see if I can quickly solve it. Otherwise, I'll leave until after the MVP.

ferostabio commented 1 year ago

Tried all solutions provided so far:

It doesn't work. Only setting swcMinify to false does. But by doing so we lose its performance improvements.