Skip to content

Modernize Next.js code#89

Merged
mre merged 3 commits into
mainfrom
phase2/cleanup-old-code
Feb 19, 2026
Merged

Modernize Next.js code#89
mre merged 3 commits into
mainfrom
phase2/cleanup-old-code

Conversation

@mre

@mre mre commented Feb 19, 2026

Copy link
Copy Markdown
Member

This pull request primarily removes unused or deprecated code related to data fetching (React Query) and refactors several components for improved type safety and code clarity. It also updates the usage of the Link component to align with Next.js best practices and introduces a new shared type definition for tag filtering.

These changes collectively modernize the codebase, improve maintainability, and remove obsolete logic.

mre added 3 commits February 19, 2026 01:25
Removed:
- context/SearchProvider.tsx (replaced by ToolsProvider)
- components/tools/queries/ (React Query hooks no longer needed)
- components/tools/listPage/ListPageComponent/ (replaced by StaticListPageComponent)
- components/homepage/queries/ (homepage uses repository pattern)
- components/blog/queries/ (blog uses direct file access)
- components/tools/listPage/ToolsSidebar/FilterCard/utils.ts (inlined in components)

API Routes Removed:
- pages/api/tools.ts
- pages/api/paginated-tools.ts
- pages/api/tags/[type].ts
- pages/api/tool/[toolId].ts
- pages/api/mostViewed.ts
- pages/api/popularLanguages.ts

Utils-api Removed:
- cache.ts (no longer using file cache)
- filters.ts (filtering in ToolsFilter class)
- tools.ts (replaced by ToolsRepository)
- toolsWithVotes.ts (replaced by ToolsRepository.withVotes)
- tags.ts (replaced by TagsRepository)
- mostViewedTools.ts (replaced by StatsRepository)
- popularLanguageStats.ts (replaced by StatsRepository)
- toolStats.ts (replaced by StatsRepository)
- stars.ts (not used)
- github.ts (not used)
- urls.ts (not used)

Updated:
- blog.ts: Removed cache dependency, use direct file access
- screenshot.ts: Removed cache dependency, use in-memory cache
- query.ts: Removed SearchProvider types, proper TypeScript
- pages/languages/index.tsx: Use StatsRepository
- pages/tag/[slug].tsx: Remove SearchProvider wrapper
- pages/tool/[slug].tsx: Remove SearchProvider wrapper
Remove passHref from Link components and add filter types

- Remove unnecessary passHref prop from all Link components
- Add FilterKey, FiltersState, and OnFilterChange types for tag filters
- Refactor filter state and callbacks in tag page and sidebar to use new
  types
@mre mre merged commit 3482c59 into main Feb 19, 2026
2 checks passed
@mre mre deleted the phase2/cleanup-old-code branch February 19, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant