This is related to #580 and a PR fixing this should target the tanstack-db branch.
Problem
In src/components/entries/SuspendingEntryList.tsx:124-144, the component manually maps SortedEntryListItem[] to a new array of objects that strips _sortMs (and score/implicitScore):
const entries = useMemo(
() =>
stableEntries.map((entry) => ({
id: entry.id,
feedId: entry.feedId,
subscriptionId: entry.subscriptionId,
type: entry.type,
url: entry.url,
title: entry.title,
author: entry.author,
summary: entry.summary,
publishedAt: entry.publishedAt,
fetchedAt: entry.fetchedAt,
read: entry.read,
starred: entry.starred,
feedTitle: entry.feedTitle,
siteName: entry.siteName,
})),
[stableEntries]
);
This creates a new array of new objects on every stableEntries change. It also manually enumerates every field, which means it can silently get out of sync with the EntryListData type if fields are added/removed.
Suggestion
Since TypeScript has structural typing, extra properties on objects are generally fine when passed as props. stableEntries could likely be passed directly as externalEntries without the mapping, since EntryList only accesses the fields it needs.
If stripping the extra properties is intentional (to avoid passing unnecessary data to child components), consider using a type assertion or a simpler spread-and-omit pattern instead of manually listing every field.
This is related to #580 and a PR fixing this should target the
tanstack-dbbranch.Problem
In
src/components/entries/SuspendingEntryList.tsx:124-144, the component manually mapsSortedEntryListItem[]to a new array of objects that strips_sortMs(andscore/implicitScore):This creates a new array of new objects on every
stableEntrieschange. It also manually enumerates every field, which means it can silently get out of sync with theEntryListDatatype if fields are added/removed.Suggestion
Since TypeScript has structural typing, extra properties on objects are generally fine when passed as props.
stableEntriescould likely be passed directly asexternalEntrieswithout the mapping, sinceEntryListonly accesses the fields it needs.If stripping the extra properties is intentional (to avoid passing unnecessary data to child components), consider using a type assertion or a simpler spread-and-omit pattern instead of manually listing every field.