Skip to content

feat(global-header): Promote global-header NFS plugin from /alpha to …#3413

Open
rohitratannagar wants to merge 3 commits into
redhat-developer:mainfrom
rohitratannagar:feat/global-header-stable-NFS
Open

feat(global-header): Promote global-header NFS plugin from /alpha to …#3413
rohitratannagar wants to merge 3 commits into
redhat-developer:mainfrom
rohitratannagar:feat/global-header-stable-NFS

Conversation

@rohitratannagar

@rohitratannagar rohitratannagar commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Jira: https://redhat.atlassian.net/browse/RHIDP-14169

after changes

Screen.Recording.2026-07-06.at.12.39.32.AM.mov

Promotes the global-header NFS (New Frontend System) plugin from /alpha to stable exports.

Restructures the Global Header plugin so the New Frontend System (NFS) becomes the default entry point while preserving full backward compatibility for the Old Frontend System (OFS) through a dedicated ./legacy export.

Previously, NFS lived under src/alpha and was imported via:

@red-hat-developer-hub/backstage-plugin-global-header/alpha

while OFS was the default package export.

This PR flips that relationship:

  • NFS is now the default package entry point.
  • Legacy/OFS components move to the new ./legacy subpath.
  • Existing /alpha imports continue to work (deprecated) for backward compatibility.
  • All NFS APIs are promoted from @alpha to @public.
  • Adds dedicated Module Federation entry points so NFS can discover Global Header extensions through dynamicFrontendFeaturesLoader().

fix

  • Adds the missing name parameter to the TranslationBlueprint.make() call in the
    stable (non-alpha) global-header plugin export. Without it, the extension ID is
    ambiguous and can collide with other unnamed translation extensions at runtime. And with the name they can be optionally disabled in the app.
        app:
            extensions:
                 - translation:app/global-header-translations: false

Test plan

  • Verify yarn tsc:full passes in the global-header workspace
  • Verify yarn build:api-reports:only --ci passes
  • Confirm the global-header translations load correctly in dev mode (yarn start)

Key Changes

Change Reason
src/alpha/index.tssrc/index.ts Makes NFS the default package entry point
Legacy exports moved to src/legacy.ts Separates deprecated OFS APIs behind /legacy
/alpha now re-exports from root Preserves backward compatibility while marking the path deprecated
Added PluginRoot Scalprum exposed module Enables legacy dynamic plugin resolution
Added module: Legacy to OFS mount points Allows the dynamic loader to distinguish legacy modules from NFS extensions
Promoted all NFS exports from @alpha to @public Marks NFS APIs as production-ready
Added globalHeaderModuleExport.ts Exposes globalHeaderModule as a default export for Module Federation
Added globalHeaderTranslationsModuleExport.ts Exposes translation module as a default export
Updated app imports app uses the root package, app-legacy imports from /legacy

Migration Guide

NFS (Recommended)

Before

import { globalHeaderModule } from '@red-hat-developer-hub/backstage-plugin-global-header/alpha';
import { globalHeaderTranslationsModule } from '@red-hat-developer-hub/backstage-plugin-global-header/alpha';
import { GlobalHeaderComponentBlueprint } from '@red-hat-developer-hub/backstage-plugin-global-header/alpha';

After

import {
  globalHeaderModule,
  globalHeaderTranslationsModule,
  GlobalHeaderComponentBlueprint,
} from '@red-hat-developer-hub/backstage-plugin-global-header';

OFS (Legacy)

Before

import {
  GlobalHeader,
  globalHeaderTranslations,
  GlobalHeaderComponent,
  defaultGlobalHeaderComponentsMountPoints,
} from '@red-hat-developer-hub/backstage-plugin-global-header';

After

import {
  GlobalHeader,
  globalHeaderTranslations,
  GlobalHeaderComponent,
  defaultGlobalHeaderComponentsMountPoints,
} from '@red-hat-developer-hub/backstage-plugin-global-header/legacy';

Testing

NFS Mode

  1. Export the plugin:
cd workspaces/global-header/plugins/global-header
yarn install
sudo npx @red-hat-developer-hub/cli plugin export --dev --dynamic-plugins-root /path/to/rhdh-local/local-plugins
  1. Enable NFS:
APP_CONFIG_app_packageName=app-next
ENABLE_STANDARD_MODULE_FEDERATION=true
  1. Enable the local plugin in dynamic-plugins.override.yaml.

  2. Configure extensions:

app:
  extensions:
    - app-root-wrapper:app/global-header
    - translation:app/global-header-translations
    - api:app/app-language:
        config:
          availableLanguages: ['en', 'de', 'es', 'fr', 'it', 'ja']
          defaultLanguage: 'en'
  1. Start RHDH Local:
podman compose up -d
  1. Verify Module Federation:
http://localhost:7007/.backstage/dynamic-features/remotes

Expected:

  • GlobalHeaderModuleExport
  • GlobalHeaderTranslationsModuleExport

OFS Mode

Configure every Global Header mount point using:

module: Legacy

Then start RHDH Local:

podman compose up -d

Checklist

  • Added a changeset
  • Updated documentation
  • Added/updated tests
  • Added screenshots (UI changes)

@github-actions

Copy link
Copy Markdown
Contributor

This pull request adds a new top-level directory under workspaces/. Please follow Submitting a Pull Request for a New Workspace in CONTRIBUTING.md.

@rhdh-gh-app

rhdh-gh-app Bot commented Jun 16, 2026

Copy link
Copy Markdown

Important

This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior.

Changed Packages

Package Name Package Path Changeset Bump Current Version
app-legacy workspaces/global-header/packages/app-legacy none v0.0.0
app workspaces/global-header/packages/app none v0.0.0
@red-hat-developer-hub/backstage-plugin-global-header workspaces/global-header/plugins/global-header minor v1.21.6

…stable

Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
@rohitratannagar rohitratannagar force-pushed the feat/global-header-stable-NFS branch 2 times, most recently from 1bd4724 to 94f0809 Compare June 16, 2026 08:36
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.00%. Comparing base (d86f9c6) to head (7e15cbe).
⚠️ Report is 181 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3413   +/-   ##
=======================================
  Coverage   54.00%   54.00%           
=======================================
  Files        2403     2404    +1     
  Lines       87620    87631   +11     
  Branches    24260    24263    +3     
=======================================
+ Hits        47315    47322    +7     
- Misses      38752    38755    +3     
- Partials     1553     1554    +1     
Flag Coverage Δ *Carryforward flag
adoption-insights 83.58% <ø> (ø) Carriedforward from d60b316
ai-integrations 70.03% <ø> (ø) Carriedforward from d60b316
app-defaults 69.60% <ø> (ø) Carriedforward from d60b316
augment 46.39% <ø> (ø) Carriedforward from d60b316
bulk-import 72.86% <ø> (ø) Carriedforward from d60b316
cost-management 17.48% <ø> (ø) Carriedforward from d60b316
dcm 59.63% <ø> (ø) Carriedforward from d60b316
extensions 62.17% <ø> (ø) Carriedforward from d60b316
global-floating-action-button 74.30% <ø> (ø) Carriedforward from d60b316
global-header 61.64% <75.00%> (+0.01%) ⬆️
homepage 51.52% <ø> (ø) Carriedforward from d60b316
install-dynamic-plugins 56.23% <ø> (ø) Carriedforward from d60b316
konflux 91.01% <ø> (ø) Carriedforward from d60b316
lightspeed 68.49% <ø> (ø) Carriedforward from d60b316
mcp-integrations 85.46% <ø> (ø) Carriedforward from d60b316
orchestrator 37.33% <ø> (ø) Carriedforward from d60b316
quickstart 62.09% <ø> (ø) Carriedforward from d60b316
sandbox 79.56% <ø> (ø) Carriedforward from d60b316
scorecard 83.93% <ø> (ø) Carriedforward from d60b316
theme 64.54% <ø> (ø) Carriedforward from d60b316
translations 8.49% <ø> (ø) Carriedforward from d60b316
x2a 78.79% <ø> (ø) Carriedforward from d60b316

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d86f9c6...7e15cbe. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions Bot added stale and removed stale labels Jun 30, 2026
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
@rohitratannagar rohitratannagar force-pushed the feat/global-header-stable-NFS branch from 94f0809 to d60b316 Compare July 5, 2026 18:58
@rohitratannagar rohitratannagar marked this pull request as ready for review July 5, 2026 19:21
menuItems: [],
});
const CONTEXT_KEY = '__global_header_context__' as keyof typeof globalThis;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We will be global store using @backstage/version-bridge + useSyncExternalStore which will help us eliminating the Provider dependency for NFS consumers and resolving cross-MF-boundary state sharing issues cleanly something similar to what I am trying here : #3697.

Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

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.

2 participants