algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.68k stars 514 forks source link

poc: blocking middleware #6264

Closed dhayab closed 1 month ago

dhayab commented 3 months ago

this outlines a potential way for middlewares to block the first query of instantsearch, to allow it to run prerequisite tasks

codesandbox-ci[bot] commented 3 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 479b457e33785f71c061bd69c7f59753beb83845:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration
Haroenv commented 3 months ago

in React InstantSearch start is called immediately to ensure widgets can render with the fake results. Is that still possible here or not?

dhayab commented 3 months ago

in React InstantSearch start is called immediately to ensure widgets can render with the fake results. Is that still possible here or not?

~Good question, it should be, although in a quick test with the current changes, there are issues when rerendering later on, that should be further assessed.~

It should correctly handle a (fake) configuration-induced delay for React as well.

Haroenv commented 1 month ago

I think we don't have a use case for this anymore @dhayab ?

dhayab commented 1 month ago

Yes, I'll clean this up.