Repository navigation
Conversation
Contributor
|
Held: the template route drops the request body-size limit and reverts the string amounts and UUID ids from #1840. Please rebase onto the latest default branch, address this, and make sure CI passes, then it can be merged. |
Contributor
|
Thanks for the templates gallery work. We can't merge this yet, for these reasons:
Please rebase on the latest main, build the repository layer on top of the current route (string amounts, UUID ids, body-size limit intact), and make sure CI passes. |
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.
Closes #1691
Summary
Converts
/templatesfrom a fully client-rendered page with client-sideuseEffectdata fetching into a React Server Component (RSC) with streamed Suspense and route-level loading/error states. Interactive filtering, debounced search, and URL parameter syncing are isolated in a lightweight client island (TemplatesBrowser).Key Changes
app/lib/repositories/templates.tsexposinglistTemplates()andcreateTemplate()using in-memory store andSEED_TEMPLATES.app/api/streams/template/route.tsto consume the repository directly with no HTTP self-call.app/templates/page.tsxis now an async Server Component exportingmetadataandrevalidate = 60, directly awaitinglistTemplates()and streaming content inside<Suspense fallback={<TemplateGridSkeleton />}>.app/templates/TemplatesBrowser.tsx("use client") preserving category filters, keyboard arrow/Home/End navigation, debounced search, URL parameter syncing, and stream creation redirection.app/templates/loading.tsx: Route-level loading state rendering skeleton grid witharia-busy="true".app/templates/error.tsx: Route-level error boundary withPageErrorandreset().app/templates/TemplateSkeletons.tsx: Reusable template skeletons.app/lib/repositories/templates.test.tsapp/templates/page.test.tsxapp/templates/TemplatesBrowser.test.tsxRoute Size (First Load JS)
/templates)Lighthouse Mobile Performance Comparison
Verification
npx jest app/templates app/lib/repositories/templates app/api/streams/template: All suites pass.npx eslint "app/templates/**/*.{ts,tsx}" "app/lib/repositories/templates*.ts" "app/api/streams/template/**/*.{ts,tsx}": 0 errors, 0 warnings.