feat: Add discover to tanstack start - #763
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c70ecbf55
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <SearchFeedContent | ||
| LinkComponent={DiscoverFeedLink} | ||
| locale={locale} | ||
| params={DISCOVER_FEED_PARAMS} |
There was a problem hiding this comment.
Route pagination through the validated Discover fetcher
When a visitor loads another page, SearchFeedContent supplies its own query function for the shared cache key, so the request no longer passes through assertDiscoverFeedResponse. A 400 or 429 is therefore parsed and cached as a SearchFeedPage; the subsequent pageInfo access can break the feed instead of leaving the previous pages intact and reporting a query error. Keep pagination on discoverFeedQueryOptions' validated fetcher or add equivalent status validation to the shared component.
Useful? React with 👍 / 👎.
| }), | ||
| }) | ||
|
|
||
| function DiscoverRoute() { |
There was a problem hiding this comment.
Define DiscoverRoute as an arrow component
Convert this newly added component to an arrow function; the repository explicitly requires arrow functions for components.
AGENTS.md reference: AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
|
|
||
| return ( | ||
| <RouteMessages namespaces={DISCOVER_NAMESPACES}> | ||
| <main className="container mx-auto flex max-w-3xl flex-col gap-6 p-4"> |
There was a problem hiding this comment.
Separate padding from the gap layout
This new container combines gap-6 with p-4 and mx-auto on the same element, contrary to the repository rule prohibiting margin or padding from being mixed with gap. Move the outer spacing to a wrapper while retaining the flex gap on this container.
AGENTS.md reference: AGENTS.md:L51-L51
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 716ba64663
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Temporary, for the length of the migration: the origin serving the routes | ||
| // this app does not own yet. `components/migration-link.tsx` reads it in the | ||
| // browser, so it has to be inlined like the others. See `src/lib/legacy-app.ts`. | ||
| 'NEXT_PUBLIC_LEGACY_WEB_URL', |
There was a problem hiding this comment.
Keep the legacy origin identical across hydration
When a production artifact is built once and NEXT_PUBLIC_LEGACY_WEB_URL is supplied or changed only at container runtime, this client definition retains the build-time value while legacyWebOrigin() reads the live value during SSR. The same MigrationLink can therefore render an absolute legacy URL on the server but a relative or stale URL after hydration, producing a hydration mismatch and causing subsequent client renders to send unmigrated result links to the TanStack origin and 404. Either inject this value into the browser at runtime or require the server to use the same build-time value.
Useful? React with 👍 / 👎.
Improving Documentation
pnpm lint:fixto fix formatting issues before opening the PR.Description
What?
Why?