impress-2020/pages
Matchu 2887d952de Fix /outfits/new init + add more SSR
Whew, setting up a cute GraphQL SSR system! I feel like it strikes a good balance of not having actually too many moving parts, though it's still a bit extensive for the problem we're solving 😅

Anyway, by doing SSR at _all_, we solve the problem where Next's "Automatic Static Optimization" was causing problems by setting the outfit state to the default at the start of the page load.

So I figured, why not try to SSR things _good_?

Now, when you navigate to the /outfits/new page, Next.js will go get the necessary GraphQL data to show the image before even putting the page into view. This makes the image show up all snappy-like! (when images.neopets.com is behaving :p)

We could do this with the stuff in the items panel too, but it's a tiny bit more annoying in the code right now, so I'm just gonna not worry about it and see how this performs in practice!

This change _doesn't_ include making the images actually show up before JS loads in, I assume because our JS code tries to validate that the images have loaded before fading them in on the page. Idk if we want to do something smarter there for the SSR case, to try to get them loading in faster!
2022-09-15 02:46:14 -07:00
..
api Use latest ~owls NC trade values API 2022-09-04 01:35:05 -07:00
internal [WIP] Refactor to renderWithLayout function 2022-09-14 22:50:56 -07:00
items [WIP] Migrate item trade pages to Next.js routing 2022-09-14 22:56:45 -07:00
outfits Fix /outfits/new init + add more SSR 2022-09-15 02:46:14 -07:00
support Migrate /support/petAppearances to Next.js routing 2022-09-14 19:46:57 -07:00
user/[userId]/lists [WIP] Migrate single-list page to Next.js routing 2022-09-14 23:18:13 -07:00
_app.tsx Fix /outfits/new init + add more SSR 2022-09-15 02:46:14 -07:00
_document.tsx Simplify references to PUBLIC_URL 2022-09-14 18:44:43 -07:00
conversion.tsx [WIP] Migrate the conversion page 2022-09-14 19:20:49 -07:00
index.tsx Migrate home page to Next.js routing 2022-09-15 00:43:05 -07:00
modeling.tsx [WIP] Migrate /modeling to Next.js routing 2022-09-14 19:52:10 -07:00
privacy.tsx [WIP] Move Privacy Policy onto its own Next.js page 2022-09-14 19:16:26 -07:00
your-outfits.tsx [WIP] Migrate /your-outfits to Next.js routing 2022-09-14 21:55:03 -07:00