Merge pull request #32061 from elaine-mattos/feat/add-description-plugin-feature-flags

feat(core-plugin-api): add optional description to plugin feature flags
This commit is contained in:
Andre Wanlin
2026-03-07 12:47:26 -06:00
committed by GitHub
9 changed files with 34 additions and 2 deletions
@@ -103,7 +103,10 @@ describe('createSpecializedApp', () => {
features: [
createFrontendPlugin({
pluginId: 'test',
featureFlags: [{ name: 'a' }, { name: 'b' }],
featureFlags: [
{ name: 'a' },
{ name: 'b', description: 'Feature B description' },
],
extensions: [
createExtension({
attachTo: { id: 'root', input: 'app' },
@@ -146,6 +149,11 @@ describe('createSpecializedApp', () => {
expect(screen.getByText('flags:test=a,test=b')).toBeInTheDocument();
expect(flags).toEqual([
{ name: 'a', pluginId: 'test' },
{ name: 'b', pluginId: 'test', description: 'Feature B description' },
]);
expect(app.apis).toMatchInlineSnapshot(`
ApiResolver {
"apis": Map {
@@ -346,6 +346,7 @@ export function createSpecializedApp(options?: CreateSpecializedAppOptions): {
OpaqueFrontendPlugin.toInternal(feature).featureFlags.forEach(flag =>
featureFlagApi.registerFlag({
name: flag.name,
description: flag.description,
pluginId: feature.id,
}),
);
@@ -354,6 +355,7 @@ export function createSpecializedApp(options?: CreateSpecializedAppOptions): {
toInternalFrontendModule(feature).featureFlags.forEach(flag =>
featureFlagApi.registerFlag({
name: flag.name,
description: flag.description,
pluginId: feature.pluginId,
}),
);