-
Notifications
You must be signed in to change notification settings - Fork 529
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
feat(instantsearch): make root indexName optional #5590
Conversation
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 9653948:
|
requires algolia/algoliasearch-helper-js#938 Essentially this allows us to create neat non-inheriting indices like this with only three queries sent: ```jsx const App = ( <InstantSearch> <Index indexName="1" indexId="1a" /> <Index indexName="1" indexId="1b" /> <Index indexName="2" /> </InstantSearch> ); ``` Combined with algolia/react-instantsearch#3690 again, you could also create ```jsx // 🚨 this isn't possible yet const App = ( <InstantSearch> <Index indexName="1"> {/* other widgets, causing no results */} <NoResults> <Index indexName="1" parentIndexId={null}> {/* display stuff from a separate query, without interference of inheritance */} </Index> </NoResults> </Index> </InstantSearch> ); ```
45a73ff
to
315a589
Compare
@@ -33,7 +33,7 @@ | |||
"@types/google.maps": "^3.45.3", | |||
"@types/hogan.js": "^3.0.0", | |||
"@types/qs": "^6.5.3", | |||
"algoliasearch-helper": "^3.11.3", | |||
"algoliasearch-helper": "https://pkg.csb.dev/algolia/algoliasearch-helper-js/commit/6ca09d86/algoliasearch-helper", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and the other references will need to be changed once that version is released
requires algolia/algoliasearch-helper-js#938
Essentially this allows us to create neat non-inheriting indices like this with only three queries sent:
Combined with algolia/react-instantsearch#3690 again, you could also create
Summary
Allow for more flexible use cases to avoid inheritance of indices, like #5585 (comment), without custom code skipping the root index.
This does mean that if you forget the indexName, there's a new warning, and no rendering.
Result