Skip to content

Conversation

@dhayab
Copy link
Member

@dhayab dhayab commented Oct 20, 2025

This PR (re-)introduces the autocomplete() widget, with similar features to Algolia's standalone Autocomplete library.

It includes a refactoring of the React implementation to extract the prop getters into a shared module and match the draft JS design in #6745.

FX-3548

@dhayab dhayab marked this pull request as draft October 20, 2025 17:49
@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 20, 2025

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

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration

@dhayab dhayab marked this pull request as ready for review October 23, 2025 07:57
Copy link
Contributor

@shaejaz shaejaz left a comment

Choose a reason for hiding this comment

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

looks good, just a minor comment.

import {
connectAutocomplete,
connectSearchBox,
} from '../../connectors/index.umd';
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this import correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it prevents us from importing the chat, so rollup can properly bundle the UMD package.

Comment on lines +33 to +41
type CreateAutocompletePropGettersParams = {
useEffect: (effect: () => void, inputs?: readonly unknown[]) => void;
useId: () => string;
useMemo: <TType>(factory: () => TType, inputs: readonly unknown[]) => TType;
useRef: <TType>(initialValue: TType | null) => { current: TType | null };
useState: <TType>(
initialState: TType
) => [TType, (newState: TType) => unknown];
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I think in a future PR, we could move these into a shared file. I believe there are some parts of the chat widgets that could use this approach.

@dhayab dhayab merged commit 59f8fbf into master Oct 28, 2025
14 checks passed
@dhayab dhayab deleted the feat/autocomplete-js-widget branch October 28, 2025 09:49
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.

3 participants