algolia / algoliasearch-client-javascript

⚡️ A fully-featured and blazing-fast JavaScript API client to interact with Algolia.
https://www.algolia.com/doc/api-client/javascript/getting-started/
MIT License
1.33k stars 221 forks source link

fix(recommend): export recommend methods to use them in algoliasearch #1512

Closed dhayab closed 5 months ago

dhayab commented 5 months ago

In 8087b282, we import methods from @algolia/recommend into algoliasearch to give direct access to recommendations from the search client.

The CJS bundle for @algolia/recommend did not export the methods, only the recommend() method to set up a recommend client. This caused an issue in the v4.23.0 release of algoliasearch as it basically imported undefined methods, which prevented the correct instantiation of the search client.

This PR reexports all methods to ensure they are present when imported by algoliasearch.

It also tests the built algoliasearch bundles, inspired by what we have in InstantSearch.

Fixes #1511