-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Remove unnecessary "use client" from pure data/utility modules #1153
Copy link
Copy link
Open
Labels
Description
Description
Several modules have "use client" but only export constants, types, or pure functions with no hooks, event handlers, or browser APIs. This unnecessarily ties them to the client bundle.
Files to change
1. surfsense_web/components/assistant-ui/connector-popup/utils/connector-document-mapping.ts (line 1)
Exports only a Record<string, string> constant and a pure function. No hooks or browser APIs.
Fix: Remove "use client".
2. surfsense_web/app/docs/sidebar-separator.tsx (line 1)
Purely presentational component with no hooks, state, or event handlers:
export function SidebarSeparator({ item }: { item: Separator }) {
return <p className="..."> {item.icon} {item.name} </p>;
}Fix: Remove "use client" (verify item.icon is serializable in Fumadocs context).
3. surfsense_web/app/dashboard/[search_space_id]/logs/loading.tsx (line 1)
Loading skeleton uses Framer Motion but only for entrance animation. Could use Tailwind's animate-pulse instead.
Fix: Replace motion.* with plain elements + Skeleton (matching new-chat/loading.tsx pattern) and remove "use client".
Acceptance criteria
- Listed files work correctly without
"use client" - No hooks or browser API usage in these files
next buildsucceeds
Reactions are currently unavailable