algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.73k stars 527 forks source link

fix(hits): rename the exposed "hits" to "items" #6212

Closed Haroenv closed 5 months ago

Haroenv commented 6 months ago

Summary

Replace the exposed hits with items for consistency with recommend, transformItems and other widgets that all return items.

hits of course still works for now, but items is also available from the connectors.

Result

As well as hits, items is also available from connectHits, connectInfiniteHits (connectGeoSearch already only had items)

There's no warning for using hits, as there's no way to have that in a way which doesn't warn for regular usage too.

For now, no change is done in ui-components, but I'm happy to do so if we're happy with the hypothetical breaking change for that package.

codesandbox-ci[bot] commented 6 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0cb7190f620cfcb38b9ffab86d07d401f1215514:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration
Haroenv commented 5 months ago

not that I saw @dhayab