frontend-plugin-api: support feature-level predicates

This lets plugin and module instances apply a shared condition to all of their extensions, while preserving extension-level conditions by combining them with logical AND during app spec resolution.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-03-14 12:00:55 +01:00
parent 457904d372
commit f30eeba995
9 changed files with 201 additions and 66 deletions
@@ -17,6 +17,7 @@
import {
Extension,
FeatureFlagConfig,
FilterPredicate,
IconElement,
OverridableFrontendPlugin,
} from '@backstage/frontend-plugin-api';
@@ -31,6 +32,7 @@ export const OpaqueFrontendPlugin = OpaqueType.create<{
readonly icon?: IconElement;
readonly extensions: Extension<unknown>[];
readonly featureFlags: FeatureFlagConfig[];
readonly if?: FilterPredicate;
readonly infoOptions?: {
packageJson?: () => Promise<JsonObject>;
manifest?: () => Promise<JsonObject>;