Skip to content

feat: use frontend-base compatibility layer#298

Merged
arbrandes merged 2 commits into
overhangio:mainfrom
arbrandes:arbrandes/frontend-plugin-framework-compat
May 6, 2026
Merged

feat: use frontend-base compatibility layer#298
arbrandes merged 2 commits into
overhangio:mainfrom
arbrandes:arbrandes/frontend-plugin-framework-compat

Conversation

@arbrandes

@arbrandes arbrandes commented May 2, 2026

Copy link
Copy Markdown
Collaborator

Description

Lets a frontend-base site keep working with FPF-built plugins as a migration aid during the MFE deprecation window. The shim is opt-in: plugin authors register an (mfe_name, slot_name, plugin_config) triple in FRONTEND_COMPAT_SLOTS to route a single slot through the compat layer, or list a Tutor plugin name in FRONTEND_COMPAT_PLUGINS to bulk-opt every contribution that plugin makes via PLUGIN_SLOTS. Sites with no opted-in contributions are unaffected.

Requires tutor@main: depends on the unreleased ENV_SAVED action.

Implementation Details

Renders one env.config.<mfe_name>.jsx per MFE alongside the legacy per-MFE env.config.jsx, each carrying just the contributions opted in for that MFE. site.config.{build,dev}.tsx registers each one as its own shim App via createLegacyPluginApp, passing the MFE's name as mfeId so the shim can route-scope its contributions. The wildcard "all" is itself a valid mfe_name: it renders env.config.all.jsx and mounts it without an mfeId, so its contributions fire globally across every route, mirroring the legacy iter_plugin_slots("all") semantics. site/package.json adds the compat dep and an npm overrides block redirecting both @openedx/frontend-plugin-framework and @edx/frontend-platform to the same compat package, so transitive imports resolve to the shim's stubs and neither real package is installed.

Two new filters drive opt-in. FRONTEND_COMPAT_SLOTS is the per-slot opt-in registry, mirroring the (mfe_name, slot_name, plugin_config) shape of PLUGIN_SLOTS. FRONTEND_COMPAT_PLUGINS is a coarser bulk opt-in by Tutor plugin name, folding every PLUGIN_SLOTS contribution from that plugin's hook context through the shim.

Three more filters layer (legacy_id, mapping) deltas onto the shim's curated defaultSlotMap, defaultWidgetMap, and defaultRouteMap for ids the shim doesn't yet cover: FRONTEND_SLOT_COMPAT_MAPS, FRONTEND_WIDGET_COMPAT_MAPS, and FRONTEND_ROUTE_COMPAT_MAPS. These deltas are site-wide (not per-MFE), so site.config.{build,dev}.tsx materializes the merged maps once and passes them by reference into every createLegacyPluginApp call. Identical contributions dedup silently; divergent ones warn and last-wins.

All compat wiring is gated on get_frontend_compat_mfes() being non-empty, and tagged TODO(fpf-removal) for cleanup on the FPF deprecation timeline. Full design captured in openedx/frontend-base-compat ADR 0001.

Testing

The easiest way to test this is with tutor-indigo, via this second PR:

overhangio/tutor-indigo#219

After tutor config save and tutor images build mfe, you should see the indigoified header in the new Instructor Dashboard app:

image

LLM usage notice

Built with assistance from Claude.

@github-project-automation github-project-automation Bot moved this to Pending Triage in Tutor project management May 2, 2026
@arbrandes
arbrandes force-pushed the arbrandes/frontend-plugin-framework-compat branch from dd536b9 to e3f0e14 Compare May 2, 2026 23:13
@arbrandes arbrandes changed the title feat: emit env.config.compat.jsx for the FPF compatibility shim feat: render an FPF compatibility shim for frontend-base sites May 2, 2026
@arbrandes
arbrandes force-pushed the arbrandes/frontend-plugin-framework-compat branch from e3f0e14 to 2e36316 Compare May 3, 2026 13:02
@arbrandes arbrandes changed the title feat: render an FPF compatibility shim for frontend-base sites feat: FPF compatibility layer May 3, 2026
@arbrandes
arbrandes force-pushed the arbrandes/frontend-plugin-framework-compat branch from 2e36316 to d8bc3cb Compare May 3, 2026 13:04
@arbrandes arbrandes changed the title feat: FPF compatibility layer feat: FPF compatibility layer for frontend-base May 3, 2026
@arbrandes
arbrandes force-pushed the arbrandes/frontend-plugin-framework-compat branch from d8bc3cb to afdc676 Compare May 3, 2026 13:06
@arbrandes arbrandes changed the title feat: FPF compatibility layer for frontend-base feat: use FPF compatibility layer May 3, 2026
@arbrandes
arbrandes force-pushed the arbrandes/frontend-plugin-framework-compat branch 2 times, most recently from e146dd1 to 200f3af Compare May 3, 2026 16:12
@arbrandes arbrandes changed the title feat: use FPF compatibility layer feat: use frontend-base compatibility layer May 3, 2026
@arbrandes
arbrandes force-pushed the arbrandes/frontend-plugin-framework-compat branch 5 times, most recently from 0553620 to c58e3e5 Compare May 3, 2026 23:36
@arbrandes
arbrandes marked this pull request as ready for review May 3, 2026 23:37
@arbrandes
arbrandes force-pushed the arbrandes/frontend-plugin-framework-compat branch 2 times, most recently from 8c218e3 to 02b2b6d Compare May 4, 2026 13:07
@arbrandes
arbrandes requested a review from ahmed-arb May 4, 2026 13:13
Lets a frontend-base site keep working with FPF-built plugins and
`@edx/frontend-platform` consumers via @openedx/frontend-base-compat, as
a migration aid during the FPF deprecation window.

Co-Authored-By: Claude <noreply@anthropic.com>
@arbrandes
arbrandes force-pushed the arbrandes/frontend-plugin-framework-compat branch 4 times, most recently from 862ea76 to 9966e8c Compare May 5, 2026 11:47
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install git+https://github.com/overhangio/tutor.git@main

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

We'll have to remember to remove this once it lands in Verawood. But without it, CI will fail.

Allows compat-shim contributions to be scoped to specific MFEs
instead of consolidated into a single global bundle, matching how
the legacy per-MFE env.config.jsx applied them.

Requires tutor@main: depends on the unreleased ENV_SAVED action.

Co-Authored-By: Claude <noreply@anthropic.com>
@arbrandes
arbrandes force-pushed the arbrandes/frontend-plugin-framework-compat branch from 9966e8c to ec16070 Compare May 5, 2026 12:10
@arbrandes
arbrandes merged commit a463a08 into overhangio:main May 6, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Pending Triage to Done in Tutor project management May 6, 2026
@arbrandes
arbrandes deleted the arbrandes/frontend-plugin-framework-compat branch May 6, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants