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

fix(vue-instantsearch): compute initial state from helper instead of results #5403

Merged
merged 1 commit into from
Jan 2, 2023

Conversation

dhayab
Copy link
Member

@dhayab dhayab commented Jan 2, 2023

Summary

Currently, for SSR, we compute initialResults on the server using the helper results. This is used for initial rendering as well as for hydration. Because nested indices inherit from their parent, they are set with a merged state which prevent correct inheritance behavior later on, when interacting with InstantSearch client-side.

This PR instead relies on the index's helper "request" state, which isn't merged and allows expected behavior.

CR-2516
fixes #5383

@dhayab dhayab added the Library: Vue InstantSearch Issues in vue-instantsearch label Jan 2, 2023
@@ -13,6 +13,7 @@
"dependencies": {
"algoliasearch": "4.14.3",
"cross-env": "^5.2.0",
"css-loader": "^4.3.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this line, the example doesn't run (probably due to it being in a monorepo now). I set the version to one that is already in yarn.lock.

@dhayab dhayab requested review from a team, sarahdayan, aymeric-giraudet and Haroenv and removed request for a team January 2, 2023 15:48
Copy link
Contributor

@Haroenv Haroenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this option was discussed in algolia/vue-instantsearch#764 too, but it's correct like this. Thanks!

@dhayab dhayab merged commit b03e7e3 into master Jan 2, 2023
@dhayab dhayab deleted the fix/vue-instantsearch-ssr-initialresults branch January 2, 2023 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Library: Vue InstantSearch Issues in vue-instantsearch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple indexes on Nuxt SSR fails to hydrate fully
2 participants