chore(app-next): add runnable RHDH NFS shell for local development#5115
chore(app-next): add runnable RHDH NFS shell for local development#5115ciiay wants to merge 10 commits into
Conversation
|
The container image build workflow finished with status: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5115 +/- ##
==========================================
+ Coverage 56.03% 63.53% +7.49%
==========================================
Files 123 123
Lines 2404 2424 +20
Branches 553 576 +23
==========================================
+ Hits 1347 1540 +193
+ Misses 1051 882 -169
+ Partials 6 2 -4
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
7fc3586 to
822377d
Compare
31afaeb to
c6ad81c
Compare
| import { createFrontendModule } from '@backstage/frontend-plugin-api'; | ||
| import { SignInPageBlueprint } from '@backstage/plugin-app-react'; | ||
|
|
||
| export const signInModule = createFrontendModule({ |
There was a problem hiding this comment.
It would be better to pull in app-auth (link to artifact here) for this, I believe going with this approach will prevent being able to potentially swap out the default sign-in. And then for most cases the corresponding app-integration plugin would be used to configure source control authentication (link here).
| catalogPlugin, | ||
| scaffolderPlugin, | ||
| searchPlugin, | ||
| rhdhThemeModule, |
There was a problem hiding this comment.
Shouldn't these all be provided by dynamic plugins instead?
There was a problem hiding this comment.
With the exception of the catalogPlugin, scaffolderPlugin, searchPlugin and userSettingsPlugin, only because scaffolder-backend can't be provided via a dynamic plugin at the moment, and so the related plugins may as well stay in place. But I thought generally we wanted to avoid baking too much into the RHDH frontend/backend and rely on providing functionality via dynamic plugins.
| RhdhTemplateSection: | ||
| priority: 300 | ||
| breakpoints: | ||
| xl: { w: 12, h: 5 } |
There was a problem hiding this comment.
Probably not exactly related to this particular PR but it seems odd that we're still exposing this level of layout customization via yaml, how often is this actually customized by users? All of this breakpoint config seems like it'd be better left in the plugin code and customized via css instead.
gashcrumb
left a comment
There was a problem hiding this comment.
I would avoid adding these plugins to the app initialization and instead rely on the frontend dynamic feature loader discovery and dynamic plugins. We could instead include an example "dynamic-plugns.yaml" file that could be used to populate the default set of dynamic plugins that make up the typical RHDH user experience. Otherwise we'll wind up having to removing these later on when users find they are unable to swap out plugins.
|
The container image build workflow finished with status: |
|
The container image build workflow finished with status: |
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Align @module-federation/enhanced with Backstage and mock fetchOverrideTranslations so CI no longer hangs on localhost. Co-authored-by: Cursor <cursoragent@cursor.com>
Export the translations mock as ESM and stub global fetch so init cannot hang on localhost in CI. Co-authored-by: Cursor <cursoragent@cursor.com>
Use sync DynamicRoot import and testing-library render instead of renderWithEffects so background app promises cannot block the suite, and assert createApp via a shared module mock. Co-authored-by: Cursor <cursoragent@cursor.com>
4ca7c46 to
a33e46c
Compare
|
The container image build workflow finished with status: |
Restore explicit parameter types so packages/app tsc passes under noImplicitAny after switching to a jest.Mock createApp spy. Co-authored-by: Cursor <cursoragent@cursor.com>
christoph-jerolimov
left a comment
There was a problem hiding this comment.
We need a way to make testing easier, but without adding new dependencies from rhdh-plugins here.
| "@red-hat-developer-hub/backstage-plugin-app-react": "0.0.5", | ||
| "@red-hat-developer-hub/backstage-plugin-homepage": "1.15.0", |
There was a problem hiding this comment.
We don't want that this are direct dependencies, we want load them as "dynamic plugins" from container images.
Keep static homePageModule until RHIDP-14519 promotes NFS to stable; document local MF export path using rhdh-plugins main default alpha export. Co-authored-by: Cursor <cursoragent@cursor.com>
|



Description
Make
app-nexta runnable RHDH NFS shell for local development and Module Federation plugin testing.This PR makes NFS testing easier for RHIDP-14018: stock app-next does not yet have an NFS-ready homepage plugin path, so teams cannot verify homepage-dependent features (e.g. unread notifications cards) without ad-hoc setup.
Optional plugins (notifications, signals, etc.) are not bundled in the shell — export them into
dynamic-plugins-root(see README).Changes
App shell (
packages/app-next/)src/App.tsx— slim NFS shell: nav, visualizer, catalog/home/scaffolder/search/user-settings,appDrawerModule, temporary statichomePageModule, andrhdhDynamicFrontendFeaturesLoader()src/modules/dynamicFeatures/— temporary MF loader that also registers namedFrontendFeatureexports (needed for global-header’sglobalHeaderModuleand notifications’notifications-home-module)dynamic-plugins.example.yaml— example OCI set (app-auth, app-integrations, global-header, quickstart; homepage/theme left commented — OFS-shaped)README.md— install/run, local config overlay, homepage-card testing (e.g. unread notifications), optional local NFS export of homepage/theme fromrhdh-pluginspackage.json/App.test.tsx— deps and test mocks aligned with the slim shellRepo config
app-config.yaml— reverts NFSapp.extensionsand local auth that were added earlier; NFS/auth live inapp-config.local.yamlonly (shared config stays safe for legacypackages/app/ CI)Review follow-ups / temporary exceptions
dynamic-plugins.yamlhomePageModuleuntil NFS overlay or local exportrhdhDynamicFrontendFeaturesLoaderWhich issue(s) does this PR fix
RHIDP-14018
PR acceptance criteria
How to test changes / Special notes to the reviewer
Build and run
yarn install(from repo root)cp packages/app-next/dynamic-plugins.example.yaml dynamic-plugins.yamlnpx -y @red-hat-developer-hub/cli-module-install-dynamic-plugins@0.2.0 install dynamic-plugins-root(needsskopeo)app.extensions+ guest auth inapp-config.local.yaml(example inpackages/app-next/README.md)EXPERIMENTAL_MODULE_FEDERATION=true yarn workspace app-next buildyarn workspace backend start:nextShell verification
/renders RHDH homepage (statichomePageModule+homePlugin)/visualizer/treeshows core + DP extensionsHomepage cards (optional — e.g. unread notifications)
notifications-home-moduleMF expose) + signals intodynamic-plugins-roothome-page-widget:home/unread-notificationsinapp-config.local.yaml/and in/visualizer/treeDetails:
packages/app-next/README.md→ Testing homepage cardsUnit tests
yarn workspace app-next testScreenshot