Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

feat(indexId): rely on indexId rather than indexName in SSR [PART-4] #1842

Merged
merged 6 commits into from
Jan 4, 2019

Conversation

samouss
Copy link
Collaborator

@samouss samouss commented Dec 28, 2018

Summary

This is the fourth part of the work to support multi-index search on the same index. The PR updates how the search parameters are computes inside createInstantSearchServer. We now rely on the indexId rather than indexName.

Changes

  • createInstantSearchServer: the value returned by findResultsState have now an indexId to be able to reconstruct the result on the client side. Previously we were relying on the indexName
    we can't anymore because the same index can be used multiple times.

Result

single-index

multi-index

@samouss samouss requested a review from a team December 28, 2018 13:47
@samouss samouss changed the title feat(indexId): rely on indexId inside SSR [PART-4] feat(indexId): rely on indexId rather than indexName in SSR [PART-4] Dec 28, 2018
@algobot
Copy link
Contributor

algobot commented Dec 28, 2018

Deploy preview for react-instantsearch ready!

Built with commit 4a48f8c

https://deploy-preview-1842--react-instantsearch.netlify.com

@tkrugg
Copy link
Contributor

tkrugg commented Jan 3, 2019

On your GIF you can see a query triggered after the first render. I would suppose it's unneeded on SSR. Is it hard/impossible to prevent?

@samouss samouss force-pushed the feat/part-3-refactor-manager branch from 96d0c86 to 1546723 Compare January 3, 2019 14:22
@samouss
Copy link
Collaborator Author

samouss commented Jan 3, 2019

On your GIF you can see a query triggered after the first render. I would suppose it's unneeded on SSR. Is it hard/impossible to prevent?

It's already the behaviour we have currently. It's a bit outside of the scope of this PR but yes it's possible to avoid the network request. We don't took the time to make it invisible yet. We already have the response so we could hydrate the client cache to avoid the network request.

* feat(indexId): rename getIndex -> getIndexId [PART-6] (#1851)
@samouss samouss merged commit aeb1dbe into feat/part-3-refactor-manager Jan 4, 2019
@samouss samouss deleted the feat/part-4-ssr branch January 4, 2019 08:29
samouss added a commit that referenced this pull request Jan 4, 2019
* feat(indexId): rely on indexId rather than indexName in SSR [PART-4] (#1842)

* feat(indexId): refactor createInstantSearchServer [PART-5] (#1843)

* feat(indexId): rename getIndex -> getIndexId [PART-6] (#1851)
samouss added a commit that referenced this pull request Jan 4, 2019
* feat(indexId): refactor createInstantSearchManager [PART-3] (#1840)

* feat(indexId): rely on indexId rather than indexName in SSR [PART-4] (#1842)

* feat(indexId): refactor createInstantSearchServer [PART-5] (#1843)

* feat(indexId): rename getIndex -> getIndexId [PART-6] (#1851)
samouss added a commit that referenced this pull request Jan 4, 2019
* feat(indexId): rely on indexId rather than indexName [PART-2] (#1835)

* feat(indexId): refactor createInstantSearchManager [PART-3] (#1840)

* feat(indexId): rely on indexId rather than indexName in SSR [PART-4] (#1842)

* feat(indexId): refactor createInstantSearchServer [PART-5] (#1843)

* feat(indexId): rename getIndex -> getIndexId [PART-6] (#1851)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants