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

multipleQueries should be in lite client #1424

Open
kopax-polyconseil opened this issue Sep 7, 2022 · 4 comments
Open

multipleQueries should be in lite client #1424

kopax-polyconseil opened this issue Sep 7, 2022 · 4 comments

Comments

@kopax-polyconseil
Copy link

kopax-polyconseil commented Sep 7, 2022

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: #1421

@kopax-polyconseil
Copy link
Author

It seems it is present in algoliasearch-lite.esm.browser.js , but the typing is wrong.

@kopax-polyconseil
Copy link
Author

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.

@Haroenv
Copy link
Contributor

Haroenv commented Sep 8, 2022

the method search exists, which is preferred over multipleQueries, does that solve your use case before the typings would be updated?

@kopax-polyconseil
Copy link
Author

kopax-polyconseil commented Sep 8, 2022

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: pass-culture/pass-culture-app-native#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.

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

No branches or pull requests

2 participants