Skip to content

feat(vue): port FilterSuggestions#7033

Draft
aymeric-giraudet wants to merge 1 commit into
chore/port-widget-vue-recommendfrom
chore/port-widget-vue-filter-suggestions
Draft

feat(vue): port FilterSuggestions#7033
aymeric-giraudet wants to merge 1 commit into
chore/port-widget-vue-recommendfrom
chore/port-widget-vue-filter-suggestions

Conversation

@aymeric-giraudet
Copy link
Copy Markdown
Member

Stacked on top of #7032.

Summary

Adds `AisFilterSuggestions`, a render-function component that delegates to `createFilterSuggestionsComponent` from `instantsearch-ui-components`. Unlike the five recommendation widgets in the previous PR, `connectFilterSuggestions` exposes its own `isLoading` flag in its render state, so this widget doesn't need `createRecommendMixin`.

The Vue test setup uses the flushing `act` helper recommended in `testing.md` so the fetch-based connector has time to settle. Reuses the per-test `skippedTests` keys introduced in #7030 for the two cases Vue cannot match:

  • `templates` (React/JS pass function-valued component props).
  • `throws without agentId` (Vue's `created` hook swallows the connector's synchronous throw).

Test plan

  • `npx jest packages/vue-instantsearch/src/tests/common-widgets.test.js --testNamePattern="FilterSuggestions" --no-coverage` — 4 passing, 4 skipped (`throws without agentId` + 3 `templates`) on Vue 2.
  • Same suite on Vue 3 (via `scripts/prepare-vue3.js`) — same result.
  • `npx jest packages/react-instantsearch/src/tests/common-widgets.test.tsx packages/instantsearch.js/src/tests/common-widgets.test.tsx --testNamePattern="FilterSuggestions" --no-coverage` — React and JS still green after the per-flavor params changes.

Adds `AisFilterSuggestions`, a render-function component that delegates
to `createFilterSuggestionsComponent` from `instantsearch-ui-components`.
Unlike the recommendation widgets, `connectFilterSuggestions` exposes
its own `isLoading` state — so this widget doesn't need
`createRecommendMixin`.

Wires up the Vue test setup with a flushing `act` to give the
fetch-based connector time to settle, and reuses the per-test
`skippedTests` keys introduced earlier (`templates`,
`throws without agentId`) for the two scenarios Vue cannot match:
the React/JS test cases pass function-valued component props, and
Vue's `created` hook swallows the connector's synchronous throw.

Depends on the Vue compat fixes, test-infra refactor, and Vue
recommend port in the PRs stacked under this one.
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 65 complexity · 41 duplication

Metric Results
Complexity 65
Duplication 41

View in Codacy

TIP This summary will be updated as you push new changes.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 13, 2026

More templates

algoliasearch-helper

npm i https://pkg.pr.new/algolia/instantsearch/algoliasearch-helper@7033

instantsearch-ui-components

npm i https://pkg.pr.new/algolia/instantsearch/instantsearch-ui-components@7033

instantsearch.css

npm i https://pkg.pr.new/algolia/instantsearch/instantsearch.css@7033

instantsearch.js

npm i https://pkg.pr.new/algolia/instantsearch/instantsearch.js@7033

react-instantsearch

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch@7033

react-instantsearch-core

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch-core@7033

react-instantsearch-nextjs

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch-nextjs@7033

react-instantsearch-router-nextjs

npm i https://pkg.pr.new/algolia/instantsearch/react-instantsearch-router-nextjs@7033

vue-instantsearch

npm i https://pkg.pr.new/algolia/instantsearch/vue-instantsearch@7033

commit: b8d4f1f

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.

1 participant