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

feat(ssr): prevent initial network request #1106

Merged
merged 3 commits into from
Jan 31, 2022
Merged

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Jan 31, 2022

Same as #1090, but for Vue InstantSearch v3

fixes #1066
fixes #1062
closes algolia/instantsearch#5002

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 31, 2022

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 19d0791:

Sandbox Source
vue-instantsearch-e-commerce Configuration

@Haroenv Haroenv marked this pull request as ready for review January 31, 2022 15:01
@Haroenv Haroenv requested review from a team, dhayab and sarahdayan and removed request for a team January 31, 2022 15:01
@Haroenv Haroenv force-pushed the feat/v3-prevent-initial-request branch from c269cd8 to 19d0791 Compare January 31, 2022 15:40
})
),
scopedResults: parent.getScopedResults(),
parent,
Copy link
Member

Choose a reason for hiding this comment

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

Any reason why we used not to pass parent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

only index used it, and before this PR, index was manually init/rendered in __forceWidget, meaning it didn't really do anything :)


it('accepts non-stringified results', () => {
describe('hydrate', () => {
it('sets _initialResults', () => {
Copy link
Member

Choose a reason for hiding this comment

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

I see there was a conversation to discard this test here, but it wasn't removed in the end. Any reason not to? Anything that it tests that isn't covered elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's indeed testing some InstantSearch internals, but the main reason it stayed is that Vue InstantSearch is extending InstantSearch with a couple methods, which could in theory cause hydrate not to work correctly anymore

@Haroenv Haroenv merged commit 9285325 into v3 Jan 31, 2022
@Haroenv Haroenv deleted the feat/v3-prevent-initial-request branch January 31, 2022 15:51
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.

3 participants