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

feat(create-instantsearch-app): support Autocomplete in InstantSearch.js template #5857

Merged
merged 19 commits into from
Sep 25, 2023

Conversation

sarahdayan
Copy link
Member

@sarahdayan sarahdayan commented Sep 19, 2023

Summary

This introduces Autocomplete support in the InstantSearch.js template:

  • When selecting the InstantSearch.js template with a version that supports setIndexUiState, CISA asks whether or not you want to use an autocomplete as a search box.
    • If yes:
      • CISA asks for the Query Suggestions index name to use with Autocomplete.
      • CISA asks for the Autocomplete version to use.
    • If not, the process continues as it does now.

When using an autocomplete as a search box, you get an autocomplete with recent searches and suggested searches. For the sake of code simplicity, routing isn't enabled, state is in memory.

Demo

Capture d’écran 2023-09-25 à 09 38 36 Capture d’écran 2023-09-25 à 09 38 43 Capture d’écran 2023-09-25 à 09 39 15 Capture d’écran 2023-09-25 à 09 44 25

To test locally, clone the branch and run:

node path/to/instantsearch/packages/create-instantsearch-app/src/cli/index.js

FX-2618

@sarahdayan sarahdayan force-pushed the feat/cisa-template-autocomplete branch from 2f33f54 to 2ea6262 Compare September 19, 2023 16:00
@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 19, 2023

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 d084642:

Sandbox Source
InstantSearch.js Configuration
react-instantsearch-app Configuration
example-react-instantsearch-default-theme Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-vue-instantsearch-default-theme Configuration

@sarahdayan sarahdayan marked this pull request as ready for review September 21, 2023 12:57
packages/create-instantsearch-app/src/cli/index.js Outdated Show resolved Hide resolved
packages/create-instantsearch-app/src/cli/index.js Outdated Show resolved Hide resolved
Copy link
Member

@dhayab dhayab left a comment

Choose a reason for hiding this comment

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

Good for me! I've just noticed we could do some changes on an upcoming PR to the JS template:

  • choose to either keep CDN scripts or package dependencies (but not both)
  • replace all instantsearch.widgets.xxx calls with their shortened versions (as documented)

@sarahdayan
Copy link
Member Author

Good for me! I've just noticed we could do some changes on an upcoming PR to the JS template:

  • choose to either keep CDN scripts or package dependencies (but not both)
  • replace all instantsearch.widgets.xxx calls with their shortened versions (as documented)

@dhayab I believe the npm dependencies are necessary to provide types in global.d.ts.

For the shortened versions, we can do this in another PR that updates all templates, wdyt?

…js/src/app.js.hbs

Co-authored-by: Dhaya <154633+dhayab@users.noreply.github.com>
@sarahdayan sarahdayan enabled auto-merge (squash) September 25, 2023 09:17
@sarahdayan sarahdayan merged commit 4a27e5b into master Sep 25, 2023
@sarahdayan sarahdayan deleted the feat/cisa-template-autocomplete branch September 25, 2023 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants