GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove dead code by marcleblanc2 · Pull Request #1997 · sourcegraph/docs

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Sep 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Problem

  • kbar (a ⌘K palette) was removed in Fix docs search with Algolia #110, but its config in src/data/search.ts and the contentlayer onSuccess hook stayed behind, writing a 725 KB public/search.json on every build that nothing fetches
  • src/utils/contentlayer.ts only existed to build that index
  • The video entry in MdxComponents.tsx never runs: MDX compiles an explicit <video> to a literal element, so components.video is never consulted (the rounded-xl class it set has never been applied)
  • A knip scan turned up more dead code nothing imports:
    • docsearch/icons/index.ts barrel and the AlgoliaLogo, NoResultsIcon, ControlKeyIcon, GoToExternalIcon icons only it re-exported (plus two commented-out usages and the searchByText translation that only fed AlgoliaLogo)
    • docsearch/types/useDocSearchKeyboardEvents.ts, a drifted copy of the sibling hook DocSearch.tsx actually imports
    • src/images/logos/aws/index.ts, generator output from before dev/generate-mermaid-icons.mjs switched to icons.generated.ts
    • latestVersion in src/data/versions.ts, exported since 📦 NEW: Add versioning #48 with no reader
    • Dependencies @iconify-json/logos, @iconify/types, and mdx (not MDX: a 2013 "generic documentation extractor", likely a typo-install of @mdx-js/mdx)
  • Absorbed from Cleanup unused dependencies and src files #1986 (closed in favour of this PR; the two collided on package.json, the lockfile, .gitignore, and src/utils/contentlayer.ts):
    • src/components/PreCode.tsx (empty; the real PreCode lives in PreCodeBlock.tsx), src/components/ResourceEstimator.tsx (older duplicate of resource-estimator/ResourceEstimator.tsx), src/components/DemoLayout.tsx (template leftover), src/components/TopBanner.tsx, src/components/icons/Globe.tsx, src/components/icons/BugIcon.tsx
    • Dependencies with no import in src/, dev/, or any config: @docsearch/react (only its CSS is vendored under src/components/search/docsearch/), @mdx-js/mdx (contentlayer2 pulls the same 3.1.1 transitively), date-fns, fast-glob, feed, prism-react-renderer, react-highlight-words + @types/react-highlight-words, react-syntax-highlighter, rehype-toc, simple-functional-loader, dotenv. Kept on purpose: shiki (peer of rehype-pretty-code) and sharp
    • .gitignore entries for public/changelog.rss and public/technical-changelog.rss: nothing generates them; the feed comes from sourcegraph.com and src/proxy.ts redirects the old paths

Change

Five commits, one per group above. 15 files deleted, 15 dependencies removed, +1 −1585 (880 of that lockfile).

Independent of #1977 (only shared line was the searchDocumentsPath comment in src/data/search.ts, gone here); whichever merges second gets a one-line rebase.

Verification

  • pnpm install --frozen-lockfile, npx tsc --noEmit clean, pnpm run lint at the 8-warning baseline, pnpm run build passes and no longer produces public/search.json
  • rg -i 'kbar|search\.json' finds nothing; rg finds no imports of any deleted file, export, or dependency
  • Rendered <video> markup on /docs/code-monitoring is byte-identical before and after (it never had the class)
  • Nobody fetches search.json: the new Algolia indexer (Revamp docs search: product-keyed Algolia index, ranking fixes, denser modal #2009) reads .contentlayer/generated/Post, the old DocSearch crawler scraped HTML, and Cloudflare analytics for sourcegraph.com show ~150 sampled requests to /docs/search.json in the last 30 days, all with an empty referer, random geos and browser UAs, and no daily cadence: scanner noise, not a consumer

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vercel

vercel Bot commented Sep 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 23, 2026 11:02pm UTC

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Sep 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Open the Diff Tour for this PR in Sourcegraph

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Sep 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

⚠️ Spell check found 2 issue(s) in this PR

Only findings on lines added by this PR, and in its title and description, are shown.

Pull request description

  • line 3, column 3
    • kbar → knar
  • line 26, column 11
    • kbar → knar

Please correct the spelling, or add words which are correct to cspell-allow-list.txt.

Run npx cspell@10 --no-progress --dot '**/*' locally to check the full repository.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vercel
vercel Bot deployed to Preview September 17, 2026 09:59
View deployment
@marcleblanc2
marcleblanc2 requested a review from enriquegh September 17, 2026 10:22
@marcleblanc2
marcleblanc2 force-pushed the marc/chore/drop-kbar-search-index branch from 759b5e0 to e5be987 Compare September 18, 2026 04:27
@vercel
vercel Bot deployed to Preview September 18, 2026 04:29
View deployment
@marcleblanc2 marcleblanc2 changed the title Drop the kbar search index and the dead MDX video mapping Drop the kbar search index, dead MDX video mapping, and other dead code Sep 18, 2026
@vercel
vercel Bot deployed to Preview September 18, 2026 04:49
View deployment
@marcleblanc2 marcleblanc2 changed the title Drop the kbar search index, dead MDX video mapping, and other dead code Clean out dead code Sep 18, 2026
@marcleblanc2 marcleblanc2 changed the title Clean out dead code Remove dead code Sep 18, 2026
@marcleblanc2
marcleblanc2 force-pushed the marc/chore/drop-kbar-search-index branch from a781d29 to e7aa180 Compare September 18, 2026 05:05
@marcleblanc2
marcleblanc2 changed the base branch from main to marc/fix/mark-svg-base-path September 18, 2026 05:05
@vercel
vercel Bot deployed to Preview September 18, 2026 05:06
View deployment
@marcleblanc2 marcleblanc2 changed the title Remove dead code Drop dead code: kbar search index, MDX video mapping, unused components and dependencies Sep 18, 2026
@marcleblanc2 marcleblanc2 mentioned this pull request Sep 18, 2026
Cleanup unused dependencies and src files #1986
Closed
@vercel
vercel Bot deployed to Preview September 18, 2026 05:11
View deployment
@marcleblanc2 marcleblanc2 mentioned this pull request Sep 18, 2026
dev: diff a preview deployment against production #2011
Draft
enriquegh
enriquegh approved these changes Sep 18, 2026
View reviewed changes

@enriquegh enriquegh left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

very nice! so much dead code 💀

So much came from us moving from kbar to algolia then we had to bring in the docsearch component instead of importing it (I think we couldn't customize otherwise) and brought too much with it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@marcleblanc2
marcleblanc2 force-pushed the marc/fix/mark-svg-base-path branch from 6b9f3cb to dcdddd0 Compare September 18, 2026 21:23
@marcleblanc2
marcleblanc2 force-pushed the marc/chore/drop-kbar-search-index branch from 30bd7be to 44c94cc Compare September 23, 2026 22:18
@marcleblanc2
marcleblanc2 changed the base branch from marc/fix/mark-svg-base-path to main September 23, 2026 22:18
@vercel
vercel Bot deployed to Preview September 23, 2026 22:19
View deployment
@marcleblanc2 marcleblanc2 changed the title Drop dead code: kbar search index, MDX video mapping, unused components and dependencies Remove dead code Sep 23, 2026
@marcleblanc2
marcleblanc2 force-pushed the marc/chore/drop-kbar-search-index branch from 44c94cc to c50b5c7 Compare September 23, 2026 22:42
@vercel
vercel Bot deployed to Preview September 23, 2026 22:43
View deployment
@vercel
vercel Bot deployed to Preview September 23, 2026 22:49
View deployment
@marcleblanc2 marcleblanc2 mentioned this pull request Sep 23, 2026
Use latestVersion instead of versions[0] in VersionSelector #2031
Merged
@marcleblanc2
marcleblanc2 enabled auto-merge (squash) September 23, 2026 23:01
@marcleblanc2 @ampagent
chore: drop the kbar search index and the dead MDX video mapping
60bb085
kbar was removed in #110; the contentlayer onSuccess hook kept writing a
725 KB public/search.json that nothing fetched. src/utils/contentlayer.ts
only existed to build that index.

MDX compiles an explicit <video> to a literal element, so components.video
never ran; the rounded-xl class it set was never applied.

Co-authored-by: Amp <[email protected]>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0ae6a-1645-702a-a5ed-92f8b9bce33b
marcleblanc2 and others added 5 commits September 23, 2026 17:01
@marcleblanc2 @ampagent
chore: drop dead DocSearch icons, a stale hook duplicate, and unused …
017d077
…exports

knip flagged these and rg confirms nothing imports them:

- docsearch/icons/index.ts barrel, and the AlgoliaLogo, NoResultsIcon,
  ControlKeyIcon, GoToExternalIcon icons only it re-exported. The two
  commented-out usages in Footer.tsx and NoResultsScreen.tsx go with
  them, along with the searchByText translation that only fed AlgoliaLogo
- docsearch/types/useDocSearchKeyboardEvents.ts, a drifted copy of the
  sibling hook DocSearch.tsx actually imports
- src/images/logos/aws/index.ts, generator output from before
  dev/generate-mermaid-icons.mjs switched to icons.generated.ts
- latestVersion in src/data/versions.ts, exported since #48 with no reader

Amp-Thread-ID: https://ampcode.com/threads/T-01a0ae6a-1645-702a-a5ed-92f8b9bce33b
Co-authored-by: Amp <[email protected]>
@marcleblanc2 @ampagent
chore: drop three unused dependencies
af84186
- @iconify-json/logos and @iconify/types: nothing in src/, dev/, or any
  config references them; Mermaid icon packs come from
  src/images/logos/*/icons.generated.ts
- mdx: not MDX at all, a 2013 "generic documentation extractor", most
  likely a typo-install of @mdx-js/mdx. Nothing imports it

Amp-Thread-ID: https://ampcode.com/threads/T-01a0ae6a-1645-702a-a5ed-92f8b9bce33b
Co-authored-by: Amp <[email protected]>
@marcleblanc2 @ampagent
Remove dependencies nothing imports and stale RSS .gitignore entries
007197e
None of these packages are imported by src/, dev/, or any config file:
@docsearch/react (only its CSS is vendored), @mdx-js/mdx, date-fns,
fast-glob, feed, prism-react-renderer, react-highlight-words and its
@types, react-syntax-highlighter, rehype-toc, simple-functional-loader,
dotenv.

public/changelog.rss and public/technical-changelog.rss are no longer
generated here: the feed is served from sourcegraph.com (see
src/data/constants.ts) and src/proxy.ts redirects to it.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0ad56-bd79-73ce-bc8e-a5405d0c11f2
Co-authored-by: Amp <[email protected]>
@marcleblanc2 @ampagent
Remove components nothing imports and the unused draft filter
198793f
PreCode.tsx was empty; ResourceEstimator.tsx was an older copy of
resource-estimator/ResourceEstimator.tsx, which MdxComponents imports;
DemoLayout, TopBanner, Globe and BugIcon have no importers.

allCoreContent filtered on a `draft` frontmatter field that
contentlayer.config.ts does not declare and no page sets, so the
production and development branches did the same thing.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0ad56-bd79-73ce-bc8e-a5405d0c11f2
Co-authored-by: Amp <[email protected]>
@marcleblanc2 @ampagent
Keep the latestVersion export
a956aac
Amp-Thread-ID: https://ampcode.com/threads/T-01a0d074-2111-762a-b494-c20730dae82b
Co-authored-by: Amp <[email protected]>
@marcleblanc2
marcleblanc2 force-pushed the marc/chore/drop-kbar-search-index branch from 29ba699 to a956aac Compare September 23, 2026 23:01
@vercel
vercel Bot deployed to Preview September 23, 2026 23:02
View deployment
@marcleblanc2
marcleblanc2 merged commit 7382402 into main Sep 23, 2026
6 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@marcleblanc2
marcleblanc2 deleted the marc/chore/drop-kbar-search-index branch September 23, 2026 23:02
marcleblanc2 added a commit that referenced this pull request Sep 23, 2026
@marcleblanc2 @ampagent
Use latestVersion instead of versions[0] in VersionSelector (#2031)
aa52176
`src/data/versions.ts` already exports `latestVersion = versions[0]`;
this replaces the four hand-written `versions[0]` references in
`src/components/VersionSelector.tsx` with it, so the latest-version
logic has one home.

No behaviour change. `npx tsc --noEmit` and `pnpm run lint` are clean
for the changed file.

Follow-up to #1997, which keeps the `latestVersion` export.

Co-authored-by: Amp <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — a956aac1 Deployed Sep 23, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@enriquegh enriquegh enriquegh approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@marcleblanc2 @enriquegh
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.