feat(lightspeed): expose dedicated NFS module federation entry points for FAB and translations#3512
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
Move ApplicationDrawer and DrawerPanel components into app-defaults and re-export appDrawerExtensions from the new module. The app-react package now only exposes the public API surface (hooks, blueprints, data refs, types) while app-defaults owns the concrete extension wiring. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Christoph Jerolimov <jerolimov+git@redhat.com>
… for FAB and translations - Add lightspeedFABModuleExport.ts and lightspeedTranslationsModuleExport.ts as dedicated default-export entry points required by dynamicFrontendFeaturesLoader - Update package.json exports, typesVersions, and scalprum.exposedModules to register both modules as separate Module Federation containers - Fix React Context duplication across MF boundaries using globalThis singleton pattern in LightspeedDrawerContext, resolving "useLightspeedDrawerContext must be used within a LightspeedDrawerProvider" error in Dock-to-Window mode Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
|
This pull request adds a new top-level directory under |
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Missing ChangesetsThe following package(s) are changed by this PR but do not have a changeset:
See CONTRIBUTING.md for more information about how to add changesets. Changed Packages
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3512 +/- ##
==========================================
- Coverage 54.02% 54.02% -0.01%
==========================================
Files 2409 2410 +1
Lines 87733 87777 +44
Branches 24306 24303 -3
==========================================
+ Hits 47400 47418 +18
- Misses 38812 38838 +26
Partials 1521 1521
*This pull request uses carry forward flags. Click here to find out more. Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
Closing in favor of #3513 |
|



Description
This PR adds dedicated Module Federation entry points for the Lightspeed FAB (Floating Action Button) module and the Translations module, and fixes a React Context duplication bug that occurs across MF chunk boundaries in the New Frontend System (NFS).
These changes are required because
dynamicFrontendFeaturesLoader()in Backstage NFS only loads default exports from each exposed module. The existinglightspeedFABModuleandlightspeedTranslationsModuleare named exports from./src/alpha/index.tsx, which means they cannot be discovered and loaded by the NFS dynamic plugin loader without a dedicated entry point that re-exports them asdefault.Gaps / Reasons for Each Change
src/alpha/lightspeedFABModuleExport.tslightspeedFABModule(which provides theAppRootWrapperBlueprintfor the FAB button) was a named export and therefore invisible todynamicFrontendFeaturesLoader. This file re-exports it asdefault.src/alpha/lightspeedTranslationsModuleExport.tslightspeedTranslationsModule(which registersTranslationBlueprintresources for multi-language support) was also only a named export. This file provides the required default export.package.json(exports, typesVersions, scalprum)scalprum.exposedModules, the RHDH CLI cannot build these files as separate MF containers. Withoutexports/typesVersions, TypeScript consumers cannot import the subpath modules.src/components/LightspeedDrawerContext.tsxcreateContext()to create duplicate Context instances. The "Dock to Window" display mode failed withuseLightspeedDrawerContext must be used within a LightspeedDrawerProviderbecause the provider and consumer used different Context objects. TheglobalThissingleton pattern ensures a single shared Context instance across all MF chunks.How to enable in NFS mode
After deploying the rebuilt dynamic plugin, add to
app-config.yaml:Fixed
✔️ Checklist
Made with Cursor