impress-2020/src/app
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
..
cached-data Build cached zones, stop querying on server 2020-08-19 17:50:05 -07:00
components [WIP] Migrate /items/search to Next.js routing 2022-09-14 22:44:48 -07:00
images Update HomePage news 2022-08-17 16:22:46 -07:00
ItemPage [WIP] Add lint exceptions for <img> tags 2021-11-02 00:55:21 -07:00
WardrobePage Fix /outfits/new init + add more SSR 2022-09-15 02:46:14 -07:00
apolloClient.js Fix /outfits/new init + add more SSR 2022-09-15 02:46:14 -07:00
ConversionPage.js Only wait for auth on queries that need it 2021-01-21 14:57:21 -08:00
GlobalFooter.js Migrate /items/[itemId] to Next routing 2022-09-14 22:26:59 -07:00
GlobalHeader.js Migrate home page to Next.js routing 2022-09-15 00:43:05 -07:00
HomePage.js Migrate home page to Next.js routing 2022-09-15 00:43:05 -07:00
InternalAssetImagePage.js [WIP] Migrate /internal/assetImage to Next routing 2022-09-14 19:27:48 -07:00
ItemPage.js Migrate /items/[itemId] to Next routing 2022-09-14 22:26:59 -07:00
ItemPageDrawer.js update chakra imports 2020-12-25 09:08:33 -08:00
ItemPageLayout.js Migrate /items/[itemId] to Next routing 2022-09-14 22:26:59 -07:00
ItemSearchPage.js Add search toolbar to item page 2021-09-30 20:04:50 -07:00
ItemTradesPage.js [WIP] Migrate item trade pages to Next.js routing 2022-09-14 22:56:45 -07:00
ModelingPage.js [WIP] Fix eslint for Next.js 2021-11-01 22:07:46 -07:00
PageLayout.js Add general error message for wardrobe crashes 2021-05-05 00:22:28 -07:00
PrivacyPolicyPage.js Privacy policy copy tweak 2021-01-18 06:44:07 -08:00
SupportPetAppearancesPage.js Migrate /support/petAppearances to Next.js routing 2022-09-14 19:46:57 -07:00
UserItemListPage.js [WIP] Migrate single-list page to Next.js routing 2022-09-14 23:18:13 -07:00
UserItemListsIndexPage.js [WIP] Migrate trade lists page to Next.js routing 2022-09-14 23:04:58 -07:00
UserOutfitsPage.js [WIP] Migrate /your-outfits to Next.js routing 2022-09-14 21:55:03 -07:00
util.js [WIP] Remove localStorage SSR error 2022-09-14 22:35:33 -07:00