Skip to content

Verify ~48 non-component orphans (hooks, lib, utils) surfaced by the #82 graph #90

Description

@TortoiseWolfe

Follow-up to #82. That sweep deleted 24 dead component directories; the same module-graph analysis surfaced ~48 non-component modules that appear unreachable from any app entry point.

This is a lead, not a delete manifest. Only a sample was individually confirmed. Verify each before removing anything — #82 itself was wrong in both directions until the graph was rebuilt properly.

Method to reproduce

BFS over static from '…', import(…) and require(…) edges, rooted at the 51 app-router entry files (page.tsx/layout.tsx/route.ts/not-found/error/sitemap/manifest) plus src/middleware.ts and src/pages/_document.tsx. Barrels are ordinary nodes, so a barrel only keeps a symbol alive if the barrel is itself reachable. Tests, stories, __tests__/, src/tests/ and src/mocks/ are never roots.

Candidates

Hooks (17)useApplicationRealtime, useCodeBlockPreferences, useConversationRealtime, useConversationRealtimeSync, useEmployerRealtimeSync, useEscapeKey, useFormValidation, useMetroAreas, useOfflineStatus, useOnlineStatus, useResumeDownload, useSharedCompaniesInBounds, useTeamMembers, useTileProviders, useVisibilityChange, useWindowResize, useWorkerProfileForEmployer

*already deleted in #82 as exclusive dependencies of deleted components

Worth noting: useOnlineStatus is the FR-006 consolidation hook, and both it and two of the three hooks it was written to replace are unreachable. Also — useWindowResize and useVisibilityChange are the two hydration hazards flagged in #88; if they are dead, that issue's urgency drops accordingly.

src/lib/ (27) — including all four src/lib/seo/* (content, keywords, readability, technical, zero importers anywhere), map/marker-builders.ts, map/index.ts, map/tile-provider-service.ts, messaging/decrypt-message.ts, messaging/decryption-cache.ts, auth/protected-route.tsx, auth/oauth-state.ts, supabase/server.ts, routes/route-export.ts, companies/index.ts, companies/seed-service.ts, companies/company-identity.ts, analytics/index.tsx, validation/index.ts

src/utils/ (3)codeblock-utils.ts, map-colors.ts, performance.ts

Verify carefully

Two entries deserve a second look before anyone deletes them:

Suggested approach

Confirm in small batches with a build between each, exactly as #82 was done — the production build is the real check, since a missed importer fails compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions