I'm currently using Algolia's Instant Search
It works well but it requires to external javascript librairies. One is Hoogan.JS and the other one is Algolia's Search JS file.
My website heavily depends on SEO and I'm constantly monitoring Google's PageSpeed tool.
It's important for me to not go under 85 and in order to do so I need to load my JS files asynchronously.
The issue is that when I do it, I'm getting undefined AlgoliaSearch or Hoogan because my code is always being loaded before either one of those files.
I don't really know how to load them ASYNC but specify an order. From what I understand it's not really possible.
Sadly, it seems like you have no control on the order async JS files it will get executed.
Solution 1
The best solution I would have to offer you would be to concatenate the JS files in the right order, and load only one asynchronously.
Solution 2
Have a look at Head.js. However, this seems to be discontinued as the last commit goes back to 2013.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With