Repository navigation
Render the gallery on the server again, so search can see the templates - #429
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Fixes a regression I shipped an hour ago in #428.
Reading the filters with
useSearchParamsput the whole gallery behind a Suspense boundary, which bails out of prerendering. The served HTML then carried zero of the 22 cards: I counted them on production. Search is the second and fourth largest source of visitors after GitHub, so that page is exactly the one that must arrive complete.The filters are now read from the server's own
searchParamsand handed to the client as its starting state. The browser still owns them after that, and still writes them back to the URL.Measured on a production build: /templates serves 22 cards in the HTML, and /templates?for=SaaS&background=gradient serves 2, with the template names in the markup rather than only in a script. Driving it in Chrome after hydration behaves as before: Launch narrows to 1 and writes ?for=Launch, Clear filters restores 22, a shared link restores both chips and the A to Z order.
A test now fails if the gallery goes back to reading its filters in the browser, or grows a Suspense boundary again. vitest 682 of 682.