Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

dhayab
Copy link
Member

@dhayab dhayab commented Mar 26, 2024

In 8087b28, 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

@dhayab dhayab force-pushed the fix/recommend-methods-exports branch from db0ab1d to 6e7e587 Compare March 26, 2024 14:46
@dhayab dhayab requested review from a team and Haroenv March 26, 2024 14:49
Copy link
Member

@shortcuts shortcuts left a comment

Choose a reason for hiding this comment

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

nice thanks for jumping on it!

@dhayab dhayab merged commit 5fc5f4f into master Mar 26, 2024
5 of 8 checks passed
@dhayab dhayab deleted the fix/recommend-methods-exports branch March 26, 2024 15:09
renovate bot added a commit to simonknittel/sinister-incorporated that referenced this pull request Apr 4, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[algoliasearch](https://github.com/algolia/algoliasearch-client-javascript)
| [`4.22.1` ->
`4.23.2`](https://renovatebot.com/diffs/npm/algoliasearch/4.22.1/4.23.2)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/algoliasearch/4.23.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/algoliasearch/4.23.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/algoliasearch/4.22.1/4.23.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/algoliasearch/4.22.1/4.23.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>algolia/algoliasearch-client-javascript
(algoliasearch)</summary>

###
[`v4.23.2`](https://github.com/algolia/algoliasearch-client-javascript/blob/HEAD/CHANGELOG.md#v4232)

[Compare
Source](https://github.com/algolia/algoliasearch-client-javascript/compare/4.23.1...4.23.2)

- fix(recommend): only export default function
([#&#8203;1514](https://github.com/algolia/algoliasearch-client-javascript/issues/1514))
([4a04d8e](https://github.com/algolia/algoliasearch-client-javascript/commits/4a04d8e)),
closes
[#&#8203;1514](https://github.com/algolia/algoliasearch-client-javascript/issues/1514)

###
[`v4.23.1`](https://github.com/algolia/algoliasearch-client-javascript/blob/HEAD/CHANGELOG.md#v4231)

[Compare
Source](https://github.com/algolia/algoliasearch-client-javascript/compare/4.23.0...4.23.1)

- fix(recommend): export recommend methods to use them in algoliasearch
([#&#8203;1512](https://github.com/algolia/algoliasearch-client-javascript/issues/1512))
([5fc5f4f](http://algolia/algoliasearch-client-javascript/commits/5fc5f4f)),
closes
[#&#8203;1512](http://algolia/algoliasearch-client-javascript/issues/1512)

###
[`v4.23.0`](https://github.com/algolia/algoliasearch-client-javascript/blob/HEAD/CHANGELOG.md#v4230)

[Compare
Source](https://github.com/algolia/algoliasearch-client-javascript/compare/4.22.1...4.23.0)

- feat(search): fetch recommendations directly from algoliasearch
([#&#8203;1509](https://github.com/algolia/algoliasearch-client-javascript/issues/1509))
([8087b28](http://algolia/algoliasearch-client-javascript/commits/8087b28)),
closes
[#&#8203;1509](http://algolia/algoliasearch-client-javascript/issues/1509)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/simonknittel/sinister-incorporated).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoiZGV2ZWxvcCJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

methods[key] is not a function in 4.23.0
2 participants