feat(widgets): add server-side prefetch for weather and RSS feed

Prefetch weather and RSS feed data during SSR so widgets render with
content on first paint instead of showing loading states.
This commit is contained in:
Thomas Camlong committed 2026-05-22 11:38:02 +02:00
1 parent 10cedbd906
commit 108b488250
3 files changed
+55

No files matched your search

+4
View File
@@ -11,6 +11,8 @@ import prefetchForApps from "./app/prefetch";
import prefetchForBookmarks from "./bookmarks/prefetch";
import type { Prefetch, WidgetOptionsRecordOf } from "./definition";
import type { inferOptionsFromCreator } from "./options";
import prefetchRssFeedsAsync from "./rssFeed/prefetch";
import prefetchWeatherAsync from "./weather/prefetch";
const cachedGetServerSettingsAsync = cache(getServerSettingsAsync);
@@ -19,6 +21,8 @@ const prefetchCallbacks: Partial<{
}> = {
bookmarks: prefetchForBookmarks,
app: prefetchForApps,
weather: prefetchWeatherAsync,
rssFeed: prefetchRssFeedsAsync,
};
export const prefetchForKindAsync = async <TKind extends WidgetKind>(