Skip to content

Remove unused pliny SearchProvider and algolia CSS imports#101

Merged
GordonBeeming merged 3 commits intomainfrom
copilot/fix-100
Aug 11, 2025
Merged

Remove unused pliny SearchProvider and algolia CSS imports#101
GordonBeeming merged 3 commits intomainfrom
copilot/fix-100

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Aug 10, 2025

After conducting a thorough audit of the blog's dependencies, I discovered that while all npm packages in package.json are actually being used, there were unused imports and provider wrappers that could be removed to clean up the codebase.

What was removed:

1. Unused pliny SearchProvider wrapper

  • Removed SearchProvider component wrapper from src/app/layout.tsx
  • Removed unused import { SearchProvider, SearchConfig } from 'pliny/search'
  • The blog already uses a custom search implementation via SearchButton.tsx + ListLayoutGrid.tsx

2. Unused algolia.css import

  • Removed import 'pliny/search/algolia.css' from src/app/layout.tsx
  • Algolia search is not configured or used in the project

3. Updated search configuration

  • Updated data/siteMetadata.js to document the actual custom search implementation
  • Disabled unused search.json generation in contentlayer.config.ts

Key findings:

The original issue mentioned kbar as an example of unused dependencies, but kbar is actually a transitive dependency through the pliny package, which is heavily used throughout the codebase for analytics, comments, and content utilities. The real issue was that the pliny SearchProvider was being imported and wrapped around the app but provided no functional value since the blog implements its own custom search.

Custom search implementation works via:

  • Header search button navigates to /blog?q=...
  • Blog page performs client-side filtering by title, content, and tags

Results:

  • Cleaner build output - No more SearchProvider warnings during build
  • Slightly smaller bundle - Removed unused imports
  • 100% functionality preserved - All search features work perfectly
  • No visual regressions - All pages render identically

Visual verification:

Before/After Comparison Status
Home Page ✅ No changes
Search Functionality ✅ Working perfectly
Search Results ✅ Filtering works

The custom search implementation remains fully functional while removing the unused pliny search infrastructure.

Fixes #100.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Aug 10, 2025

@GordonBeeming 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot AI and others added 2 commits August 10, 2025 21:56
Co-authored-by: GordonBeeming <5680199+GordonBeeming@users.noreply.github.com>
Co-authored-by: GordonBeeming <5680199+GordonBeeming@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor - Remove unused dependencies from the blog Remove unused pliny SearchProvider and algolia CSS imports Aug 10, 2025
Copilot AI requested a review from GordonBeeming August 10, 2025 22:10
@GordonBeeming GordonBeeming marked this pull request as ready for review August 11, 2025 06:49
Copilot AI review requested due to automatic review settings August 11, 2025 06:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes unused search provider imports and configurations from the blog codebase. The changes clean up unused pliny SearchProvider infrastructure while preserving the existing custom search functionality.

  • Removed unused pliny SearchProvider wrapper and algolia CSS import from the main layout
  • Updated search configuration comments to document the actual custom implementation being used
  • Added conditional logic to skip unused search.json generation

Reviewed Changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.

File Description
src/app/layout.tsx Removed unused SearchProvider wrapper and algolia CSS import
data/siteMetadata.js Updated search config with comments documenting custom implementation
contentlayer.config.ts Added conditional check and logging for search index generation
public/*.xml Generated RSS feed files (not core to the PR purpose)

Comment thread contentlayer.config.ts
Comment thread data/siteMetadata.js
@GordonBeeming GordonBeeming merged commit cf17b84 into main Aug 11, 2025
6 checks passed
@GordonBeeming GordonBeeming deleted the copilot/fix-100 branch August 11, 2025 08:04
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.

Refactor - Remove unused dependencies from the blog

3 participants