-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(index): support adding index widget with initial UI state (#4359)
1. when hydrating (server or client) we add widgets, these shouldn't search yet, until started since every added widget calls scheduleSearch if init has happened, this used to do a search, even before start was called, and thus with not yet the correct state 2. make sure local ui state keeps "not yet mounted" widgets on change e.g. initialUiState contains a few widgets, if you mount those one by one, after init on its index, each widget would cause a change event on the helper, which used to erase non-valid state, since it starts from an empty ui state. This is now fixed by using the previous local ui state as base, but a special provision for isPageReset 3. prevent mutation in escapeHits It's okay to do results.hits = ... inside connectHits, since that overrides just the value on SearchResults, however if we mutate within the inner hits, we are actually mutating _rawResults, which isn't what we want to achieve for server side rendering, since _rawResults gets serialised. Further changes are just minor for tests
- Loading branch information
Showing
6 changed files
with
208 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters