Skip to content

Conversation

@Haroenv
Copy link

@Haroenv Haroenv commented Jan 27, 2026

ref: #32

This is just a prototype to see what it takes to swap out the search for Algolia.

DONE:

  • set up search via algolia JS client
  • map the parameters to algolia parameters
  • map the response to the same one as npm registry
  • swap the query from debounced to non-debounced (it's faster)

TODO:

  • wire up the ALGOLIA flag to some global flags system
  • clean up types and mapping
  • highlighting

What do you think?

@vercel
Copy link

vercel bot commented Jan 27, 2026

@Haroenv is attempting to deploy a commit to the danielroe Team on Vercel.

A member of the Team first needs to authorize it.

return promise
}

const ALGOLIA_SEARCH = true
Copy link
Author

Choose a reason for hiding this comment

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

put in a proper global flags system

.then(({ results }) => {
const response = results[0] as SearchResponse<AlgoliaSearchResult>
return {
objects: response.hits.map<NpmSearchResult>(hit => ({
Copy link
Author

Choose a reason for hiding this comment

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

clean this mapping a bit, somewhat superfluous now.

searchInputRef.value?.focus()
})

const ALGOLIA = true
Copy link
Author

Choose a reason for hiding this comment

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

put in a proper global flags system

</button>
<!-- Hidden submit button for accessibility (form must have submit button per WCAG) -->
<button type="submit" class="sr-only">{{ t('search.button') }}</button>
<button type="submit" class="sr-only">
Copy link
Author

Choose a reason for hiding this comment

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

undo auto-formatting?

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