Skip to content

feat(thermidor)!: remove ComposedInterface and simplify facade resolution#8024

Open
jfcere-coveo wants to merge 8 commits into
mainfrom
thermidor-remove-composed-interface
Open

feat(thermidor)!: remove ComposedInterface and simplify facade resolution#8024
jfcere-coveo wants to merge 8 commits into
mainfrom
thermidor-remove-composed-interface

Conversation

@jfcere-coveo

@jfcere-coveo jfcere-coveo commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Remove the ComposedInterface abstraction entirely from @coveo/thermidor and simplify the facade resolution layer.

Changes

Deleted files

  • src/internal/interfaces/compose.ts
  • src/public/interfaces/compose.ts
  • src/public/interfaces/compose.test.ts
  • src/internal/utils/get-handle-internals.ts

Removed types and exports

  • ComposedInterface<T>, ComposedInterfaceImpl, getComposedInternals
  • EndpointStateScope
  • getHandleInternals, HandleInternals
  • FacadeResolverFactory
  • EngineTrackedInterface (replaced by InterfaceHandle)

Simplified getInterfaceInternals

  • Widened signature from BaseInterface<T> to InterfaceHandle
  • Added instanceof BaseInterface runtime guard (throws on invalid handles)
  • Made InterfaceInternals non-generic

Flattened facade resolution

  • Removed the double-curry (engine) => (iface) => thunk pattern
  • Removed engine parameter entirely — resolvers derive it from getInterfaceInternals(iface)
  • Final FacadeResolver signature: (iface: InterfaceHandle) => EndpointThunk
  • Flattened facade cache from WeakMap<InterfaceHandle, Map<…>> to Map<Facades[T], EndpointThunk>

Simplified resolveFacade

  • Renamed from resolveFacades (plural) to resolveFacade (singular)
  • Returns a single EndpointThunk instead of an array (composition was the only reason for the array)
  • Controllers use this.#thunk directly instead of mapping over this.#thunks

Updated all call sites

  • All thunk factories (createSearchEndpointThunk, createCommerceSearchEndpointThunk, createQuerySuggestThunk, createCommerceSuggestionsThunk) now take only iface: InterfaceHandle
  • All getHandleInternals(...) calls replaced with getInterfaceInternals(...)
  • Controllers, public actions, feature modules, engine — all updated

Documentation

  • Adjusted ADR-002, ADR-004, ADR-005, ADR-007 to remove all ComposedInterface references
  • Updated docs/why.md, docs/glossary.md, generative-interface docs, and architecture annexes

@changeset-bot

changeset-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0faaf98

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@svcsnykcoveo

svcsnykcoveo commented Jul 17, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes a breaking simplification to @coveo/thermidor by removing the ComposedInterface abstraction and flattening facade resolution so controllers/actions resolve a single thunk directly from an interface handle.

Changes:

  • Removed the public/internal composeInterfaces / ComposedInterface implementation and related tests/exports.
  • Simplified facade resolution from resolveFacades(...): EndpointThunk[] to resolveFacade(...): EndpointThunk, and updated controllers/actions/thunks accordingly.
  • Updated Thermidor documentation/ADRs to remove composition references and describe the new facade-resolution model.

Reviewed changes

Copilot reviewed 88 out of 88 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/thermidor/src/public/interfaces/compose.ts Removed public composition API (deleted).
packages/thermidor/src/public/interfaces/compose.test.ts Removed composition tests (deleted).
packages/thermidor/src/internal/interfaces/compose.ts Removed internal composed interface implementation (deleted).
packages/thermidor/src/internal/utils/get-handle-internals.ts Removed handle internals helper (deleted).
packages/thermidor/src/public/controllers/search-box/search-box-controller.ts Use single resolved facade thunk; submit returns single result.
packages/thermidor/src/public/controllers/result-list/result-list-controller.ts Swap to getInterfaceInternals usage.
packages/thermidor/src/public/controllers/result-list/result-list-controller.test.ts Remove getHandleInternals usage in tests.
packages/thermidor/src/public/controllers/product-list/product-list-controller.ts Swap to getInterfaceInternals usage.
packages/thermidor/src/public/controllers/pagination/pagination-controller.ts Use single thunk instead of iterating an array.
packages/thermidor/src/public/controllers/converse/converse-controller.ts Use getInterfaceInternals once for engine/stateId.
packages/thermidor/src/public/controllers/controllers-integration.test.ts Remove composed-interface integration scenarios.
packages/thermidor/src/public/controllers/cart/cart-controller.ts Swap to getInterfaceInternals usage.
packages/thermidor/src/public/controllers/cart/cart-controller.test.ts Remove getHandleInternals usage in tests.
packages/thermidor/src/public/actions/search-parameters/search-parameters-actions.ts Swap to getInterfaceInternals usage.
packages/thermidor/src/public/actions/search-box/search-box-state-getter.ts Swap to getInterfaceInternals usage.
packages/thermidor/src/public/actions/search-box/search-box-actions.ts Resolve one thunk and dispatch once.
packages/thermidor/src/public/actions/cart/cart-actions.ts Swap to getInterfaceInternals usage.
packages/thermidor/src/internal/utils/interface-types.ts Remove composition-related types; simplify resolver type.
packages/thermidor/src/internal/utils/interface-types.test-d.ts Remove composed-interface type-level assertions.
packages/thermidor/src/internal/utils/index.ts Stop exporting handle/composition utilities; update exported types.
packages/thermidor/src/internal/utils/base-interface.ts Flatten facade cache + resolver signature; add runtime guard.
packages/thermidor/src/internal/utils/base-interface.test.ts Update tests for new resolveFacade behavior and guard.
packages/thermidor/src/internal/interfaces/search.ts Provide FacadeResolver record instead of factories.
packages/thermidor/src/internal/interfaces/index.ts Stop exporting composed interface symbols/types.
packages/thermidor/src/internal/interfaces/generative.ts Switch to FacadeResolver and simplify noop facade resolver.
packages/thermidor/src/internal/interfaces/commerce.ts Provide FacadeResolver record instead of factories.
packages/thermidor/src/internal/features/triggers/triggers-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/triggers/triggers-actions.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/sort/sort-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/sort/sort-selectors.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/sort/sort-actions.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/search-parameters/search-parameters-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/search-parameters/search-parameters-selectors.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/search-parameters/search-parameters-actions.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/search-box/search-box-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/search-box/search-box-selectors.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/search-box/search-box-actions.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/result-list/result-list-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/result-list/result-list-selectors.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/result-list/result-list-actions.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/query-correction/query-correction-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/query-correction/query-correction-actions.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/product-list/product-list-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/product-list/product-list-selectors.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/product-list/product-list-actions.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/pagination/pagination-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/pagination/pagination-selectors.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/pagination/pagination-actions.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/generative/generative-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/generative/generative-selectors.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/generative/generative-hydration.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/generative/generative-hydration.test.ts Update test to use getInterfaceInternals.
packages/thermidor/src/internal/features/generative/generative-actions.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/facets/facets-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/facets/facets-selectors.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/facets/facets-actions.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/cart/cart-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/cart/cart-selectors.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/features/cart/cart-actions.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/engine/index.ts Remove EngineTrackedInterface export.
packages/thermidor/src/internal/engine/engine.ts Track InterfaceHandle directly; use getInterfaceInternals.
packages/thermidor/src/internal/api/search/search-thunk.ts Thunk factory now takes only iface.
packages/thermidor/src/internal/api/search/search-thunk.test.ts Update tests/mocks for new thunk factory signature.
packages/thermidor/src/internal/api/search/search-thunk-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/api/search/search-request-selector.ts Selector now scoped by iface directly.
packages/thermidor/src/internal/api/search/search-request-selector.test.ts Update tests for new selector signature.
packages/thermidor/src/internal/api/search/search-facade.ts Resolver now takes iface directly.
packages/thermidor/src/internal/api/query-suggest/query-suggest-thunk.ts Thunk factory now takes only iface.
packages/thermidor/src/internal/api/query-suggest/query-suggest-facade.ts Resolver now takes iface directly.
packages/thermidor/src/internal/api/commerce-search/commerce-search-thunk.ts Thunk factory now takes only iface.
packages/thermidor/src/internal/api/commerce-search/commerce-search-thunk.test.ts Update tests/mocks for new thunk factory signature.
packages/thermidor/src/internal/api/commerce-search/commerce-search-thunk-slice.ts Use getInterfaceInternals for cache/stateId.
packages/thermidor/src/internal/api/commerce-search/commerce-search-request-selector.ts Selector now scoped by iface directly.
packages/thermidor/src/internal/api/commerce-search/commerce-search-facade.ts Resolver now takes iface directly.
packages/thermidor/src/internal/api/commerce-query-suggest/commerce-query-suggest-thunk.ts Thunk factory now takes only iface.
packages/thermidor/src/internal/api/commerce-query-suggest/commerce-query-suggest-facade.ts Resolver now takes iface directly.
packages/thermidor/src/index.ts Stop exporting composition API from package entrypoint.
packages/thermidor/docs/why.md Remove composition framing from overview doc.
packages/thermidor/docs/internal/adr/ADR-007-ssr-snapshot-api.md Remove composed-interface mentions in SSR ADR.
packages/thermidor/docs/internal/adr/ADR-007-annex-ssr-implementation-details.md Remove compose-related API surface from annex.
packages/thermidor/docs/internal/adr/ADR-006-annex-a-proposed-structure.md Remove compose.ts from proposed tree.
packages/thermidor/docs/internal/adr/ADR-005-public-facing-abstractions.mermaid Remove composed interface node/edges.
packages/thermidor/docs/internal/adr/ADR-005-public-facing-abstractions.md Remove composed-interface concept from ADR text/examples.
packages/thermidor/docs/internal/adr/ADR-004-lazy-facade-resolvers.md Update ADR to describe new resolver shape.
packages/thermidor/docs/internal/adr/ADR-002-multi-interface-engine.md Update ADR to describe multi-interface without composition.
packages/thermidor/docs/glossary.md Update glossary entries around facade resolution.
packages/thermidor/docs/generative-interface.md Update KIND description.
packages/thermidor/docs/architecture.md Update architecture doc to reflect single-thunk dispatch.
Comments suppressed due to low confidence (1)

packages/thermidor/docs/glossary.md:245

  • The referenced file path/link points to src/core/..., but this package’s sources are under src/internal/... (and src/core does not exist). These links will be broken for readers.
**File**: [`src/core/interface/utils/interface-types.ts`](../src/core/interface/utils/interface-types.ts)

Comment thread packages/thermidor/src/internal/utils/base-interface.ts
Comment thread packages/thermidor/docs/architecture.md Outdated
Comment thread packages/thermidor/docs/architecture.md Outdated
Comment thread packages/thermidor/docs/architecture.md Outdated
Comment thread packages/thermidor/src/index.ts
Comment thread packages/thermidor/docs/glossary.md Outdated
@pkg-pr-new

pkg-pr-new Bot commented Jul 17, 2026

Copy link
Copy Markdown
@coveo/atomic

npm i https://pkg.pr.new/@coveo/atomic@8024

@coveo/atomic-hosted-page

npm i https://pkg.pr.new/@coveo/atomic-hosted-page@8024

@coveo/atomic-legacy

npm i https://pkg.pr.new/@coveo/atomic-legacy@8024

@coveo/atomic-react

npm i https://pkg.pr.new/@coveo/atomic-react@8024

@coveo/auth

npm i https://pkg.pr.new/@coveo/auth@8024

@coveo/bueno

npm i https://pkg.pr.new/@coveo/bueno@8024

@coveo/create-atomic

npm i https://pkg.pr.new/@coveo/create-atomic@8024

@coveo/create-atomic-component

npm i https://pkg.pr.new/@coveo/create-atomic-component@8024

@coveo/create-atomic-component-project

npm i https://pkg.pr.new/@coveo/create-atomic-component-project@8024

@coveo/create-atomic-result-component

npm i https://pkg.pr.new/@coveo/create-atomic-result-component@8024

@coveo/create-atomic-rollup-plugin

npm i https://pkg.pr.new/@coveo/create-atomic-rollup-plugin@8024

@coveo/headless

npm i https://pkg.pr.new/@coveo/headless@8024

@coveo/headless-react

npm i https://pkg.pr.new/@coveo/headless-react@8024

@coveo/relay

npm i https://pkg.pr.new/@coveo/relay@8024

@coveo/shopify

npm i https://pkg.pr.new/@coveo/shopify@8024

commit: 0faaf98

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants