Skip to content

Investigate the special-exams Redux blocker and decide the approach (self-contained store vs React Query) #2018

Description

@brian-smith-tcril

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

Goal: dig into @edx/frontend-lib-special-exams and decide the exact approach for removing the last Redux dependency it forces on learning. Produce a decision + recommendation. This is an investigation, not an implementation — if it concludes a library change is required, the follow-up is a concrete "here is exactly what we'll do" issue on openedx/frontend-lib-special-exams, not a "let's figure it out" one.

What we already know (starting point):

  • The library exports a reducer that learning registers under specialExams in src/store.ts — the only place it's mounted.
  • Learning never reads or writes state.specialExams itself; its own exam data lives in courseHome.examsData.
  • Runtime coupling is three consumers that internally use useSelector/useDispatch: OuterExamTimer (in TabWithTimer, so on every course-home tab), SequenceExamWrapper (courseware Sequence), and the useExamAccess hooks (every courseware Unit).
  • The goal is no redux/react-redux/@reduxjs/toolkit in learning's own package.json (transitive redux pulled in by the library is fine).
  • frontend-base's SiteProvider supplies no store and the shell ships no redux, so learning can't lean on the shell for a Provider — and self-hosting a mini store would keep redux as learning's own dependency. So the Provider/store must ultimately come from the library.

Options to evaluate (cheapest first):

  • Option A — self-contained library store. The library ships its own module-level store and wraps its exported components/hooks in their own react-redux <Provider>, so consumers register no reducer and supply no store. Verify feasibility (single shared store instance across OuterExamTimer + SequenceExamWrapper + access hooks; no reliance on the consumer's store), effort, and any behavior/version implications.
  • Option B — React Query conversion of the library. Larger, aligns with OEP-0067 ADR-0010. Scope only enough to compare cost/benefit against A.

Deliverable: a written recommendation (A vs B vs other), the concrete change it implies, and — if a library change is warranted — a drafted, specific implementation issue ready to file on frontend-lib-special-exams.

Note: this gates only the final dependency removal (#1978's package.json/store.ts teardown), not any of learning's internal React Query conversions.

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