Repository navigation
perf(mainweb): prefetch the remaining portal page reads on the server - #584
Merged
Merged
Conversation
Contributor
Author
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
Author
|
Visit the preview URL for this PR (updated for commit 5a1db8b): https://hacklytics2027--pr-584-251a4qcn.web.app (expires Sat, 14 Nov 2026 01:43:18 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c48ba34db61581e25fe2978355160b5eefe0e83f |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fifteen signed-in portal pages still fetched their first data in the browser after the page loaded, adding one or two round trips before content appeared. This prefetches those reads on the server through
PrefetchedPage, as #580 and #582 did for the other pages, so the data ships with the HTML.page.tsxwas a client component (admin analytics, initiatives, projects, resumes, staff, subteams; scan; club scan; hackathon check-in) are split: the client code moves byte-for-byte to a sibling*Page.tsx, andpage.tsxbecomes a thin server wrapper./hacklyticsprefetch the next-step strip's reads (submission window, my submission, judging itinerary, results) only whennextStepQueriesenables them for the user's registration. The shared logic is inlib/next-step-reads.server.ts.useQueryinput, so react-query finds the data in its cache. A read the user isn't allowed to make is skipped, and the client fetches it as before.Testing
Production builds of
devand this branch were run side by side against the local Docker test database (seeded users), with 100 ms of network latency emulated:/leadfor a non-leader still refetches, because the server read returns FORBIDDEN; a leader gets the data prefetched.next buildpass.