Skip to content

Use Hydrogen predictive search - #519

Merged
laugharn merged 2 commits into
release/2026-08-23-hydrogenfrom
feat/hydrogen-predictive-search
Aug 23, 2026
Merged

laugharn merged 2 commits into
release/2026-08-23-hydrogenfrom
feat/hydrogen-predictive-search

Conversation

@laugharn

Copy link
Copy Markdown
Collaborator

Summary

  • replace the custom predictive-search debounce and server action with Hydrogen's predictive-search provider and store
  • register Hydrogen's /api/predictive-search handler with custom fragments that preserve the existing search UI data
  • keep predictive queries outside Cache Components so the navbar remains in the static shell
  • remove the superseded Shopify operation/transform and document the new request path

Cache Components

Predictive input and results live in Hydrogen's hydrated client store. Keystrokes call the dedicated GET endpoint, so search terms never become page cache keys and do not introduce a request-time boundary into the navbar.

Verification

  • ./node_modules/.bin/oxlint components/nav/index.tsx components/nav/search-client.tsx components/nav/search-modal.tsx hooks/use-predictive-search.ts lib/search/action.ts lib/search/server.ts proxy.ts — passed, 0 warnings/errors
  • ./node_modules/.bin/oxfmt --check components/nav/index.tsx components/nav/search-client.tsx components/nav/search-modal.tsx hooks/use-predictive-search.ts lib/search/action.ts lib/search/server.ts proxy.ts — passed
  • ./node_modules/.bin/tsc --noEmit — passed
  • pnpm build — passed; Next.js compiled successfully and generated 32/32 static pages

@vercel

vercel Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
shop-docs Ready Ready Preview, v0 Aug 23, 2026 4:30pm
shop-template Ready Ready Preview, v0 Aug 23, 2026 4:30pm

@laugharn
laugharn changed the base branch from main to release/2026-08-23-hydrogen August 23, 2026 17:10
@laugharn
laugharn merged commit 9f9a4f5 into release/2026-08-23-hydrogen Aug 23, 2026
7 checks passed
@laugharn
laugharn deleted the feat/hydrogen-predictive-search branch September 18, 2026 21:56

This branch was successfully deployed

2 active deployments
Preview – shop-docs — 6b398558 Deployed Aug 23, 2026 by vercel[bot]
Preview – shop-template — 6b398558 Deployed Aug 23, 2026 by vercel[bot]
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