Skip to content

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

Open
rohitratannagar wants to merge 6 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 6 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. Old Frontend System (OFS) APIs move to a dedicated ./legacy export (deprecated). Translations remain at /alpha.

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 (deprecated).
  • /alpha retains only translation exports; NFS APIs are no longer available from /alpha.
  • All NFS APIs are promoted from @alpha to @public.
  • Adds dedicated Module Federation entry points so NFS can discover Global Header extensions through dynamicFrontendFeaturesLoader().

Source layout restructuring

Physically moves files to match the new export structure (per review feedback):

Before After Rationale
src/alpha/plugin.ts, src/alpha/types.ts src/plugin.ts, src/types.ts NFS is now the default — code lives at the top level
src/alpha/extensions/ src/extensions/ NFS extensions promoted to top level
src/alpha/defaults/ src/defaults/ NFS default extensions promoted to top level
src/alpha/components/ (NFS) src/components/ NFS components promoted to top level
src/alpha/utils/ src/utils/ NFS utils promoted to top level
src/plugin.ts (OFS) src/legacy/plugin.ts OFS plugin moved to legacy
src/components/GlobalHeader.tsx, GlobalHeaderComponent.tsx, index.ts (OFS) src/legacy/components/ OFS-only components moved to legacy
src/components/HeaderDropdownComponent/{ApplicationLauncher,Create,Help,Profile}Dropdown* src/legacy/components/HeaderDropdownComponent/ OFS-only dropdown components moved to legacy
src/hooks/use{GlobalHeader,Create,Profile,Help,ApplicationLauncher}*MountPoints.ts src/legacy/hooks/ Scalprum mount-point hooks (OFS-only) moved to legacy
src/defaultMountPoints/ src/legacy/defaultMountPoints/ OFS default mount points moved to legacy

Shared components used by both OFS and NFS remain in their current locations:

  • src/components/ — HeaderIconButton, SearchComponent, Spacer, Divider, HeaderButton, SupportButton, NotificationButton, NotificationBanner, MenuItemLink, HeaderDropdownComponent (shared parts: HeaderDropdownComponent.tsx, MenuSection.tsx, etc.)
  • src/hooks/ — useTranslation, useLogoStyles, etc.
  • src/translations/

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 passes with 0 errors
  • Verify yarn build succeeds (all 6 entry points produced)
  • Verify API reports are unchanged (public API surface preserved)
  • Verify tests pass (21/23 suites — 2 pre-existing failures in shared HeaderDropdownComponent tests)
  • Confirm the global-header translations load correctly in dev mode (yarn start)

Key Changes

Change Reason
NFS files moved from src/alpha/ to src/ NFS is now the default — source layout matches export structure
OFS-only files moved to src/legacy/ Separates deprecated OFS code behind /legacy
src/alpha/index.ts kept as deprecated shim Preserves backwards compatibility for /alpha translation imports
Shared components remain in src/components/, src/hooks/ Used by both NFS and OFS — no move needed
src/index.ts imports updated ./alpha/..../... (NFS files now at top level)
src/legacy.ts imports updated ./plugin./legacy/plugin (OFS plugin moved)
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.22.1

…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 59.09091% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.79%. Comparing base (eb13368) to head (6c075b2).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3413      +/-   ##
==========================================
- Coverage   57.80%   57.79%   -0.02%     
==========================================
  Files        2393     2395       +2     
  Lines       95919    96002      +83     
  Branches    26776    26769       -7     
==========================================
+ Hits        55448    55480      +32     
- Misses      38935    38987      +52     
+ Partials     1536     1535       -1     
Flag Coverage Δ *Carryforward flag
adoption-insights 84.54% <ø> (ø) Carriedforward from eb13368
ai-integrations 69.06% <ø> (ø) Carriedforward from eb13368
app-defaults 69.79% <ø> (ø) Carriedforward from eb13368
augment 46.67% <ø> (ø) Carriedforward from eb13368
boost 75.92% <ø> (ø) Carriedforward from eb13368
bulk-import 72.55% <ø> (ø) Carriedforward from eb13368
cost-management 13.55% <ø> (ø) Carriedforward from eb13368
dcm 60.72% <ø> (ø) Carriedforward from eb13368
extensions 56.48% <ø> (ø) Carriedforward from eb13368
global-floating-action-button 71.18% <ø> (ø) Carriedforward from eb13368
global-header 60.44% <59.09%> (-1.74%) ⬇️
homepage 47.54% <ø> (ø) Carriedforward from eb13368
install-dynamic-plugins 56.77% <ø> (ø) Carriedforward from eb13368
intelligent-assistant 74.06% <ø> (ø) Carriedforward from eb13368
konflux 91.98% <ø> (ø) Carriedforward from eb13368
lightspeed 69.02% <ø> (ø) Carriedforward from eb13368
mcp-integrations 83.40% <ø> (ø) Carriedforward from eb13368
orchestrator 66.79% <ø> (ø) Carriedforward from eb13368
quickstart 65.04% <ø> (ø) Carriedforward from eb13368
sandbox 79.56% <ø> (ø) Carriedforward from eb13368
scorecard 84.94% <ø> (ø) Carriedforward from eb13368
theme 83.89% <ø> (ø) Carriedforward from eb13368
translations 5.12% <ø> (ø) Carriedforward from eb13368
x2a 79.31% <ø> (ø) Carriedforward from eb13368

*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 eb13368...6c075b2. 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
Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>

@debsmita1 debsmita1 left a comment

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.

Tested the changes on RHDH NFS shell (redhat-developer/rhdh#5115)

Screen.Recording.2026-07-20.at.4.09.39.PM.mov

/lgtm

@ciiay ciiay left a comment

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.

Thanks for the pr 👏

It looks mostly good. Just looking at the graduation pattern from #3530 : NFS → root, OFS → /legacy, translations remain at /alpha. The code here matches that, but the PR description/changeset still say existing /alpha NFS imports keep working as re-exports — that doesn’t match the code or #3530.

Please align the description/changeset with the #3530 wording (“translations remain at /alpha”), and update in-repo consumers that still import NFS APIs from global-header/alpha (e.g. quickstart, app-defaults) to use the stable root export.

Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
@openshift-ci openshift-ci Bot removed the lgtm label Jul 21, 2026
@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@rohitratannagar

Copy link
Copy Markdown
Contributor Author

Thanks for the pr 👏

It looks mostly good. Just looking at the graduation pattern from #3530 : NFS → root, OFS → /legacy, translations remain at /alpha. The code here matches that, but the PR description/changeset still say existing /alpha NFS imports keep working as re-exports — that doesn’t match the code or #3530.

Please align the description/changeset with the #3530 wording (“translations remain at /alpha”), and update in-repo consumers that still import NFS APIs from global-header/alpha (e.g. quickstart, app-defaults) to use the stable root export.

updated!!

@its-mitesh-kumar its-mitesh-kumar left a comment

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.

Approving based on #3413

@rohitratannagar
rohitratannagar requested a review from ciiay July 21, 2026 11:22

@divyanshiGupta divyanshiGupta Jul 23, 2026

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.

@rohitratannagar please move all the files under alpha to src as we are removing the ./alpha subpath and moving the apis to main . entry point as you already know so it doesnt make sense to keep the files under alpha sub-folder. Please refer - #3530. cc: @rohitkrai03

@rohitratannagar rohitratannagar Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@divyanshiGupta Thanks for review,
Components are being exported from the index.ts only (that is . entry point), so moving out these components from alpha will create mess, as there is already components folder inside src. If it is regarding the code-readability / conventions, please let me know. I will update it 🙂.

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.

It is about making the code ready in a way that it can just be removed easily in the next release. So the NFS related code should go into components and anything OFS can go into /legacy. Global Header is a bit unique in that respect because it creates a lot of dynamic plugin extensions and components that only work in old scalprum based system. And the alpha folder has all new components related to NFS. Some of the components will still be relevant in NFS because it uses them as base but anything only used for OFS should go into legacy.

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.

Signed-off-by: rohitratannagar <rohitratannagar2003@gmail.com>
…stable-NFS

# Conflicts:
#	workspaces/global-header/plugins/global-header/src/alpha/components/GlobalHeader.tsx
@sonarqubecloud

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.

5 participants