-
Notifications
You must be signed in to change notification settings - Fork 329
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
Requests not batched when using UMD via <script>
tags
#893
Comments
I wonder if this is because the plugins have their own state that's shared with -js if bundled? |
Plugins behave like our InstantSearch middlewares, and we process all sources at once in |
it looks like when using the UMD build, each bundle contains its own declaration of .execute method, |
@tkrugg Excellent finding! The goal of this branch is to group Algolia requests per client before dispatching them. For example, if you have three sources using Technically, you could have two requesters using the same client, but with two different Note that this problem is only theoretical for now. Removing the check doesn't break any test, and I don't believe there's any other reason. If we want to stay cautious, we can identify the function differently (e.g., add a private cc @Haroenv |
Description
When loading Autocomplete and Autocomplete plugins via
<script>
tags, it seems that requests to Algolia aren't being batched like they should be. For example, when you have one source ingetSources
and you're using the Query Suggestions plugin, you get two separate requests to Algolia instead of a multi-query.Reproduction
Preview →
Steps
Expected behavior
When using ESM imports, requests are batched as expected (see example).
It should work regardless of what imports you're using and how you import them.
Environment
The text was updated successfully, but these errors were encountered: