fix: :bug: Fix SSR prefetch by adding HydrationBoundary and stable cursor
Changes
data-table-filters/src/app/infinite/
- Fixed prefetchInfiniteQuery usage by wrapping the table in
<HydrationBoundary>. Otherwise prefetching will not occur. - Added
staleTimewith non-zero value to thedataOptionsto prevent immediate refetching. - Fixed Client component to accept server-parsed search params as props to avoid re-parsing on the client and timestamp mismatches.
- Fixed
initialPageParamin query options to usesearch.cursor.getTime()instead ofnew Date().getTime()to ensure the pageParam matches between server prefetch and client hydration. - Added
loading.tsxandSkeletoncomponent for better loading states during navigation (following the pattern from default table).
data-table-filters/src/app/light/
- Added
staleTimewith non-zero value to thedataOptionsto prevent immediate refetching. - Wrapped the table in
<HydrationBoundary>for proper hydration.
data-table-filters/src/app/default/
Refactored to be consistent with the infinite scroll example, with async data fetching via the API route and non-zero staleTime for prefetching to not immediately refetch.
- Refactored the
DataTableinto it's ownClientcomponent for consistency with the infinite scroll example. - Refactored the data to be async and fetch via the API route.
- Created
dataOptionsto fetch the data via the API route with non-zerostaleTimefor prefetching to not immediately refetch. - Removed
React.Suspensein favour of Next.jsloading.tsxAlex Sidorenko "Navigation feels slow in Next.js". - Wrapped the table in a
HydrationBoundaryotherwise prefetching will not occur.
@gruckion is attempting to deploy a commit to the OpenStatus Team on Vercel.
A member of the Team first needs to authorize it.
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| data-table-filters | Preview | Comment | Sep 21, 2025 6:39pm |
The time range selectors don't work.
On the default page:
- Selecting a single date gives you a range in the URL that's
{midnightUTCForThatDay}-{midnighUTCForThatDay}, it should probably be{midnightUTCForThatDay}-{23:59UTCForThatDay} - The data shows log points for today (2025-09-21), but selecting from the 20th to the 22nd doesn't include them.
On the infinite page, the selection works from the tooltip, but now when dragging from the bars on top of the table.
On the default page:
- Selecting a single date gives you a range in the URL that's
{midnightUTCForThatDay}-{midnighUTCForThatDay}, it should probably be{midnightUTCForThatDay}-{23:59UTCForThatDay}- The data shows log points for today (2025-09-21), but selecting from the 20th to the 22nd doesn't include them.
On the infinite page, the selection works from the tooltip, but now when dragging from the bars on top of the table.
potentially non-related issues to the code changes 😅 - at least selecting a single data doesn't seem to work on prod