Skip to content

Migrate Backstage plugin to proxy architecture with lazy loading #6420

@talissoncosta

Description

@talissoncosta

Summary

Refactor the Flagsmith Backstage plugin from backend plugin to proxy-based architecture, following the pattern used by LaunchDarkly, Harness, and other community plugins.

Parent Epic: Flagsmith/flagsmith-backstage-plugin#10
Spike: #6359

Current Architecture

Frontend → Backend Plugin → Flagsmith API
           (src/service/)
           (35 API calls for 17 flags)

Target Architecture

Frontend → Backstage Proxy → Flagsmith API
           (/proxy/flagsmith)
           (1 call + lazy load on expand)

Benefits

Aspect Before After
Installation 2 packages (frontend + backend) 1 package (frontend only)
Initial API calls 35 (for 17 flags) 1
Configuration Custom backend config Standard proxy config
Pattern Custom Matches LaunchDarkly, Harness

Implementation Tasks

  • Update FlagsmithClient.ts to use proxy (/proxy/flagsmith)
  • Add lazy loading methods (getFeatureVersions, getFeatureStates)
  • Update FlagsTab.tsx with lazy loading on accordion expand
  • Update FlagsmithOverviewCard.tsx for new client
  • Delete src/service/ directory (backend plugin)
  • Update src/index.ts to remove backend export
  • Update package.json to remove backend dependencies
  • Update README.md with proxy configuration

Proxy Configuration

Users will configure in app-config.yaml:

proxy:
  endpoints:
    '/flagsmith':
      target: 'https://api.flagsmith.com/api/v1'
      headers:
        Authorization: Api-Key ${FLAGSMITH_API_TOKEN}

Acceptance Criteria

  • Plugin works with proxy configuration only
  • No backend plugin required
  • Lazy loading reduces initial API calls
  • README updated with new installation steps

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions