FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Peel: convert CoursewareContainer to TypeScript (fast-follow to de-class #2008) · Issue #2019 · openedx/frontend-app-learning · GitHub

Peel: convert CoursewareContainer to TypeScript (fast-follow to de-class #2008) #2019

Description

Part of #1946 — Redux → React Query migration (Stage 1). Part of the #1976 courseware decomposition (plan) — fast-follow to #2008, stacked directly above the de-class and below the RQ peels (#2010+).

Goal: convert src/courseware/CoursewareContainer.jsx to .tsx immediately after it's de-classed (#2008), so the courseware React Query peels all happen in TypeScript-land.

Why a separate PR from #2008: the de-class is already a churn-y structural diff; layering a rename + type annotations on top makes it harder to review. Keeping them as two stacked PRs lets each review as a single idea.

Approach — don't type the doomed Redux stuff. The Redux-sourced selectors (currentCourseSelector, etc.) and the redirect-helper positional args are about to be deleted/replaced by the RQ peels, so type them loosely (any/minimal) now and fill in real types per-peel as each selector becomes a typed useQuery return.

Tasks

  • Rename CoursewareContainer.jsx → .tsx; add the minimum annotations to compile.
  • any/loose-type the Redux-sourced values as needed (in practice reselect infers the redirect helpers + createSelector selectors, so only the two internal refs need useRef<any>).

Add a reusable AppDispatch type + useAppDispatch hook to src/store.ts — dropped. Typed thunk dispatch only serves the Redux we're deleting (RQ code doesn't dispatch), and plain useDispatch() type-checks fine since the thunks are still JS. store.ts is left untouched. See the PR decision log.

Verify: npm run types + npm run lint clean; CoursewareContainer.test.jsx still green; no behavior change.

Scoped-but-light; a full plan gets added when this is picked up.

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


Back | FazBrowse Home | New Git URL