Skip to content

Convert the plugin-store override registry off Redux to React context #2017

Description

@brian-smith-tcril

Part of #1946 — Redux → React Query migration (Stage 1).

Goal: convert the plugin-store override registry off Redux to a React context / module-level registry, so the plugins reducer can leave src/store.ts.

Context — this is not @openedx/frontend-plugin-framework (FPF). FPF is the declarative PluginSlot system (PluginSlot / DIRECT_PLUGIN / PLUGIN_OPERATIONS), used in src/plugin-slots/* and config-driven — it never touches state.plugins. generic/plugin-store is a separate, bespoke Redux "override-method" registry: registerOverrideMethod stores function references by plugin+method (hence the serializable-check exemption in store.ts), and usePluginsCallback(name, default) folds registered overrides over a default. Its only in-repo consumer is the iframe-URL override in src/courseware/course/sequence/Unit/index.jsx.

Why Stage 1: this is learning's own Redux. Getting redux / react-redux / @reduxjs/toolkit out of learning's package.json must happen before the frontend-base move, so this slice has to go regardless of the special-exams blocker. Only the later reshaping of the override API onto the frontend-base Slot system is Stage 2.

Tasks

  • Replace the plugin slice + registerOverrideMethod + usePluginsCallback with a React context / module-level registry.
  • Remove the plugins reducer from store.ts (and its ignoredActions serializable exemption).
  • Keep the single in-repo consumer (Unit/index.jsx iframe-URL override) working.

Open question (settle when scoped): whether the external registerOverrideMethod dispatch contract can be preserved in Stage 1, or whether that reshaping must wait for the Stage-2 Slot migration — the redux removal itself does not.

Verify: iframe-URL override still applies; plugins reducer gone from the store; no react-redux in the plugin-store.

Prerequisite for #1978's "specialExams-only" store endpoint.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions