algoliasearch-client-javascript
algoliasearch-client-javascript copied to clipboard
multipleQueries should be in lite client
Hello,
We are using the search features and want to use the lite client, however, the multipleQueries
method is not available in it while it is still a search feature.
How can we use the search lite client to optimize our bundle size, could the multipleQueries
be added in it and how ?
Thanks in advance
Related issues: https://github.com/algolia/algoliasearch-client-javascript/issues/1421
It seems it is present in algoliasearch-lite.esm.browser.js
, but the typing is wrong.
Fun fact, the light version in algoliasearch/lite
is exporting the non lite version.
Only import possible is import algoliasearch from 'algoliasearch/dist/algoliasearch-lite.esm.browser.js'
and not only the typing is wrongly type for the lite version, but also it is poorly configured to allow this import.
the method search
exists, which is preferred over multipleQueries
, does that solve your use case before the typings would be updated?
Hello, no we have to patch-package in order to solve our use case because:
- Typing for lite vesrion is wrong, the lite version include multipleQueries but not it's typing
-
lite.js
export wrong version (non lite) - browser field use umd imports while our react-native is web ios and android, and can use ESM which is more optimized (it will be minified by webpack, and it doesn't include the UMD unecessary synthax)
This is our PR: https://github.com/pass-culture/pass-culture-app-native/pull/3523
We haven't found another way to do so for all iOS Android and Web.
It was possible to fix the web only using Webpack resolve.alias
configuration, because UMD file is bigger than ESM when builded, but this didn't solve the issue for the native app.
I suggest to keep the issue open until this matter is resolved.