Modernize Next.js code#89
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Linkcomponent 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.