Skip to content

feat: add feeds widgets for JS, React, and Vue#6969

Open
e-krebs wants to merge 7 commits intofeat/composition-multifeed-layer2-connectorfrom
feat/composition-multifeed-layer3-widgets
Open

feat: add feeds widgets for JS, React, and Vue#6969
e-krebs wants to merge 7 commits intofeat/composition-multifeed-layer2-connectorfrom
feat/composition-multifeed-layer3-widgets

Conversation

@e-krebs
Copy link
Copy Markdown
Contributor

@e-krebs e-krebs commented Apr 13, 2026

Summary

Layer 3 of the Multifeed Composition Support (RFC). Stacked on feat/composition-multifeed-layer2-connector (PR #6964).

Adds user-facing feeds widgets for all three flavors. Each widget owns FeedContainer lifecycle (create, register, remove, reorder) — the connector only computes feedIDs.

InstantSearch.js

  • feeds() widget with per-feed DOM containers, widget scoping, and DOM reordering
  • Exported from both main and UMD entrypoints

React InstantSearch

  • <Feeds> component with per-feed IndexContext.Provider scoping
  • useFeeds hook wrapping connectFeeds via useConnector
  • FeedContainer creation + registration fused in render body for SSR compat

Vue InstantSearch

  • <ais-feeds> component with per-feed AisFeedProvider (provide/inject)
  • Container reconciliation in watcher (side-effect-free render)

Shared patterns across all flavors

  • Deferred removal with coalesced single timer
  • Unmount/dispose merges active + pending containers for clean teardown

Test plan

  • 11 JS widget unit tests + 1 integration test
  • 5 React unit tests + 2 integration tests (real InstantSearch + SSR)
  • 5 Vue unit tests + 1 integration test
  • Export parity test updated
  • TypeScript: yarn run type-check:v3 and yarn run type-check:v4
  • Lint: yarn lint:changed
  • CI green

🤖 Generated with Claude Code

@codacy-production
Copy link
Copy Markdown

codacy-production bot commented Apr 13, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 251 complexity · 53 duplication

Metric Results
Complexity 251
Duplication 53

View in Codacy

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

e-krebs and others added 2 commits April 13, 2026 17:58
Add `feeds()` widget that creates per-feed DOM containers and manages
FeedContainer lifecycle. Each feed gets a scoped `<div class="ais-Feeds-feed">`
and its own FeedContainer registered with the parent index.

- DOM creation, reuse, reorder, and cleanup per feed
- Deferred removal with coalesced timer (matches connectDynamicWidgets pattern)
- Dispose merges active + pending containers for clean teardown
- Exported from both main and UMD entrypoints
- 11 unit tests + 1 integration test with real search lifecycle

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add `<Feeds>` component that creates per-feed `IndexContext.Provider` scopes,
and `useFeeds` hook wrapping `connectFeeds` via `useConnector`.

- FeedContainer creation + registration fused in render body for SSR compat
- Deferred removal with coalesced timer (single ref pattern from useWidget)
- Unmount cleanup merges active + pending containers
- 5 unit tests + 2 integration tests (real InstantSearch + SSR)
- Exported from react-instantsearch-core

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@e-krebs e-krebs force-pushed the feat/composition-multifeed-layer3-widgets branch from 0bdc7d6 to 29a3827 Compare April 13, 2026 16:12
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 13, 2026

More templates

algoliasearch-helper

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

instantsearch-ui-components

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

instantsearch.css

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

instantsearch.js

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

react-instantsearch

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

react-instantsearch-core

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

react-instantsearch-nextjs

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

react-instantsearch-router-nextjs

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

vue-instantsearch

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

commit: b7bce4c

@e-krebs e-krebs force-pushed the feat/composition-multifeed-layer3-widgets branch 2 times, most recently from 7d52e70 to 1fd7ba0 Compare April 14, 2026 08:00
e-krebs and others added 3 commits April 14, 2026 10:55
Add `<ais-feeds>` component with per-feed `AisFeedProvider` scoping via
Vue's provide/inject for `$_ais_getParentIndex`.

- Container reconciliation in watcher (side-effect-free render)
- Deferred removal with coalesced timer (single timer pattern)
- Unmount cleanup merges active + pending containers
- 5 unit tests + 1 integration test with real InstantSearch
- Exported as AisFeeds from vue-instantsearch
- Updated mock and index tests for compositionID support

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…type safety

FeedContainer.render() ignores the argument internally but IndexWidget type
requires it. Pass renderOptionsRef to satisfy TypeScript.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@e-krebs e-krebs force-pushed the feat/composition-multifeed-layer3-widgets branch from 1fd7ba0 to eff4746 Compare April 14, 2026 08:56
@e-krebs e-krebs marked this pull request as ready for review April 14, 2026 09:07
@e-krebs e-krebs requested review from a team, FabienMotte and aymeric-giraudet and removed request for a team April 14, 2026 09:07
e-krebs and others added 2 commits April 14, 2026 11:55
@algolia/composition doesn't exist under algoliasearch v4.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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