Skip to content

[FEATURE] API to generate component listings#1318

Merged
s2b merged 1 commit intomainfrom
feature/componentSchema
Mar 3, 2026
Merged

[FEATURE] API to generate component listings#1318
s2b merged 1 commit intomainfrom
feature/componentSchema

Conversation

@s2b
Copy link
Copy Markdown
Contributor

@s2b s2b commented Feb 18, 2026

A new interface ComponentListProviderInterface is added to Fluid,
which allows component collections to not only resolve one specific
component, but also the reverse: When implemented,
getAvailableComponents() returns a list of all components that are
part of the collection. This can be useful for various developer tools,
such as styleguides, documentation generators as well as autocompletion.

This interface is now implemented by AbstractComponentCollection.
To avoid inconsistent results or a breaking change, one edge case
eeds to be avoided by using the reflection API: If a custom component
collection is based on AbstractComponentCollection, but uses a
different folder structure by overriding resolveTemplateName(), the
added default implementation would lead to inconsistent results.
Instead, an empty array is returned. Users that run into this edge case
need to provide a custom implementation for getAvailableComponents()
that matches their custom folder structure. This will change in Fluid 6,
where it will be assumed that users define both resolveTemplateName()
and getAvailableComponents() consistently if necessary.

@s2b s2b force-pushed the feature/componentSchema branch 2 times, most recently from d9c571b to 021c87f Compare February 18, 2026 18:29
@s2b s2b force-pushed the feature/componentSchema branch from 021c87f to 87b3b7a Compare February 26, 2026 16:03
A new interface `ComponentListProviderInterface` is added to Fluid,
which allows component collections to not only resolve one specific
component, but also the reverse: When implemented,
`getAvailableComponents()` returns a list of all components that are
part of the collection. This can be useful for various developer tools,
such as styleguides, documentation generators as well as autocompletion.

This interface is now implemented by `AbstractComponentCollection`.
To avoid inconsistent results or a breaking change, one edge case
eeds to be avoided by using the reflection API: If a custom component
collection is based on `AbstractComponentCollection`, but uses a
different folder structure by overriding `resolveTemplateName()`, the
added default implementation would lead to inconsistent results.
Instead, an empty array is returned. Users that run into this edge case
need to provide a custom implementation for `getAvailableComponents()`
that matches their custom folder structure. This will change in Fluid 6,
where it will be assumed that users define both `resolveTemplateName()`
and `getAvailableComponents()` consistently if necessary.
@s2b s2b force-pushed the feature/componentSchema branch from 87b3b7a to e67a95a Compare February 26, 2026 16:11
@s2b
Copy link
Copy Markdown
Contributor Author

s2b commented Mar 3, 2026

Interface will be backported, but not implementation in AbstractComponentCollection. See #1333.

@s2b s2b merged commit 70f6eec into main Mar 3, 2026
15 checks passed
@s2b s2b deleted the feature/componentSchema branch March 3, 2026 14:30
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