GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||
GeezerVison is showing github.com — Fix docs search with Algolia by enriquegh · Pull Request #110 · sourcegraph/docs Conversation
|
There was an error while loading. Please reload this page.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* Add search UX improvements * CSS improvements * TS issues fixed * pnpm issue * pnpm add @algolia/client-search
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
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
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
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
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
## Problem - kbar (a ⌘K palette) was removed in #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 #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 #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 (#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 --------- Co-authored-by: Amp <[email protected]>
54311711
Deployed
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.