Skip to content

chore: remove redux from package.json, update comments - #2180

Merged
brian-smith-tcril merged 3 commits into
masterfrom
bsmith/special-exams-redux-teardown
Oct 15, 2026
Merged

brian-smith-tcril merged 3 commits into
masterfrom
bsmith/special-exams-redux-teardown

Conversation

@brian-smith-tcril

@brian-smith-tcril brian-smith-tcril commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Removes the redux packages now that no learning code uses them: #2168 removed the last store. Closes #2018, the last layer of its stack (above #2168, which is above #2164). Part of #1946.

What changed

Three commits, to keep each lock diff readable:

  1. Regenerate package-lock.json from scratch (wipe the lock and node_modules, npm install, npm dedupe as chore: regenerate package-lock.json #2042 did) with package.json unchanged, so the diff is only the current ranges resolving to newer versions.
  2. Remove @reduxjs/toolkit, react-redux, redux and reselect (the selector library, whose last import went in refactor: make the courseware redirects declarative and drop their fire-once guards #2146) from package.json and regenerate the same way. @types/react and @types/react-dom ^18 join devDependencies, as in frontend-template-application and frontend-app-authoring: without learning's own react-redux 7, a fresh install failed with ERESOLVE on @types/react 18 vs 19 (decision 4).
  3. Remove or reword the comments that point readers at Redux in src; the plugin-overrides migration guide stays.

redux and react-redux remain in the tree only as frontend-platform's peers and frontend-plugin-framework's dependencies (one copy each), until the frontend-base port (#1905).

Testing

  • npm run lint and npm run types clean; npm test: 124 suites, 1,279 tests; npm run build compiles with webpack's two usual asset-size warnings.
  • npm ls @reduxjs/toolkit is empty.

Decisions

Every choice in this layer, with the reasons:

Full decision log

Decisions — remove the redux packages (#2018)

Layer 3 of the #2018 stack, above #2168 (which adopted
@edx/frontend-lib-special-exams 5.0.0 and removed learning's redux
store); closes #2018. This is the library-gated dependency removal #1978
described and handed to #2018 when #1977 closed it. Settled 2026-10-14.

  1. Two lock regenerations, each from scratch. Both wipe
    package-lock.json and node_modules, run npm install, then
    npm dedupe (as chore: regenerate package-lock.json #2042 did). The first runs with package.json
    unchanged and is committed alone, so its diff is only the current
    ranges resolving to newer versions: 132 version changes, one major
    (ajv-formats 2 to 3, under copy-webpack-plugin's schema-utils).
    Without dedupe a fresh install hoists react-intl 10 (Paragon's peer
    range allows it), which is ESM-only and fails Jest, and @types/node
    26, which fails types; with dedupe the tree keeps react-intl 6.8.9 and
    @types/node 22 and no pins are needed. The second regeneration
    carries the removals, so its lock diff is only what they cause (plus
    electron-to-chromium 1.5.455 to 1.5.456, released between the two).
  2. What leaves package.json: @reduxjs/toolkit, react-redux and
    redux, which no learning code imports since refactor!: adopt frontend-lib-special-exams v5 and drop the redux store #2168, and reselect,
    the selector library used with them, whose last import went in refactor: make the courseware redirects declarative and drop their fire-once guards #2146.
    @reduxjs/toolkit, redux-thunk, @types/react-redux and reselect
    leave the tree.
  3. What still pulls redux in. Only frontend-platform (required peers:
    redux ^4.0.4, react-redux ^7.1.1 || ^8.1.1) and
    frontend-plugin-framework (dependencies: redux 4.2.1, react-redux
    8.1.1). npm satisfies both with one root copy each, react-redux 8.1.1
    and redux 4.2.1, which replaces learning's react-redux 7.2.9 and
    frontend-plugin-framework's nested copy. Both packages stay through the
    frontend-base port (Convert Learning to frontend-base #1905), which is when they leave.
  4. @types/react and @types/react-dom ^18 join devDependencies.
    Without learning's own react-redux 7.2.9 (whose only peer is
    react), npm places frontend-platform's react-redux 8 peer at the
    root. Its optional @types/react peer (^16.8 || ^17.0 || ^18.0)
    applies to the root @types/react, which learning has as 18.3.31
    through react-intl, react-bootstrap and uncontrollable.
    @testing-library/react's optional @types/react-dom peer then
    resolved to 19.3.0, whose @types/react ^19.3.0 peer needs that same
    root copy to be 19, and a fresh install stopped with ERESOLVE. Learning
    listed neither type package; the org's React 18 apps list both:
    frontend-template-application, frontend-base and frontend-app-authoring
    (as devDependencies: ^18, frontend-base ^18.3.20 and ^18.3.6), and the
    frontend-base apps account, profile, instructor-dashboard and
    admin-console. Learning follows the template's spelling. No frontend-platform
    app had dropped its own react-redux before, which is why none hit
    this. The two go in the removal commit, not the first regeneration,
    because only the removal needs them; no overrides.
  5. Comments that point at Redux go (a third commit):
    GoalUnsubscribe.jsx's "don't need to bother with redux" note,
    TourContext.tsx's "mirrors the former tours Redux slice" note, the
    "former end-tour thunks" parenthetical in ProductTours.jsx, and the
    "old reducer … immer" note in apiHooks.test.tsx (the test name
    already says what it checks) are removed. SequenceNavigation.test.jsx's
    TODO still holds (UnitButton prefers the cached unit's contentType
    over the "lock" fallback), so only its source changes, from Redux to
    useUnit.
  6. Kept: the "Migrating from the Redux plugin store" section of
    src/generic/plugin-overrides/README.md, for plugins that still
    dispatch to the old store, and ADRs 0004 (model store), 0006 (thunk
    naming) and 0007 (testing, Draft), as history. No learning ADR for
    React Query: OEP-67 frontend ADR 0010 ("React Query") is the
    org-level decision.
  7. No !. Nothing consumer-facing changes beyond refactor!: adopt frontend-lib-special-exams v5 and drop the redux store #2168's break,
    where plugins lost the store.
  8. Verification (at the layer's head): lint and types clean; 124
    suites, 1,279 tests pass; npm run build compiles with webpack's two
    usual asset-size warnings; npm ls @reduxjs/toolkit is empty.

🤖 Generated with Claude Code

@brian-smith-tcril
brian-smith-tcril added this pull request to stack #2169 October 14, 2026 16:27
@brian-smith-tcril brian-smith-tcril changed the title bsmith/special exams redux teardown chore: remove the redux packages that no learning code imports anymore Oct 14, 2026
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.16%. Comparing base (9c7d31d) to head (dfffb5a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2180      +/-   ##
==========================================
+ Coverage   95.85%   96.16%   +0.31%     
==========================================
  Files         373      373              
  Lines        6146     6025     -121     
  Branches     1516     1480      -36     
==========================================
- Hits         5891     5794      -97     
+ Misses        246      222      -24     
  Partials        9        9              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@brian-smith-tcril brian-smith-tcril changed the title chore: remove the redux packages that no learning code imports anymore chore: remove redux from package.json, update comments Oct 14, 2026
@brian-smith-tcril
brian-smith-tcril force-pushed the bsmith/special-exams-redux-teardown branch 2 times, most recently from 99656cd to 0e05df8 Compare October 14, 2026 16:55
@brian-smith-tcril
brian-smith-tcril marked this pull request as ready for review October 14, 2026 16:56

@arbrandes arbrandes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

See ya, Redux! 🥳

@brian-smith-tcril
brian-smith-tcril force-pushed the bsmith/special-exams-redux-teardown branch from 0e05df8 to f8d40aa Compare October 15, 2026 15:23
Base automatically changed from bsmith/special-exams-v5 to master October 15, 2026 15:30
brian-smith-tcril and others added 3 commits October 15, 2026 11:30
…emovals

Wiped package-lock.json and node_modules, ran `npm install`, then
`npm dedupe` (as #2042 did). package.json is unchanged, so every line here
is the current ranges resolving to newer versions: 132 version changes, one
major (ajv-formats 2 to 3, under copy-webpack-plugin's schema-utils). Dedupe keeps a
single react-intl 6.8.9 and @types/node 22, so no pins are needed.

Part of #2018.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The last redux store went in #2168, so @reduxjs/toolkit, react-redux and
redux leave package.json, along with reselect, the selector library used
with them, whose last import went in #2146. The lock is regenerated from
scratch again (install, then `npm dedupe`). @reduxjs/toolkit, redux-thunk,
@types/react-redux and reselect leave the tree. react-redux and redux stay
as frontend-platform's peers, with one react-redux 8.1.1 shared with
frontend-plugin-framework.

@types/react and @types/react-dom ^18 join devDependencies, as in
frontend-template-application and frontend-app-authoring. Without learning's
own react-redux 7, npm places the react-redux 8 peer at the root, whose
optional @types/react peer allows only 16–18, while
@testing-library/react's optional @types/react-dom peer resolved to 19,
which needs @types/react 19; npm stopped with ERESOLVE. Declaring the
React 18 types resolves both to 18.

Closes #2018.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Learning no longer has a Redux store, so comments that offer it as an
option, name it as a data source, or compare code with the slices and
thunks it replaced now mislead. The LearnerToolsSlot README and comment
point plugins at config and backend APIs instead, and the
SequenceNavigation TODO names `useUnit` as the value that overrides the
lock icon. The plugin-overrides README keeps its migration guide for
plugins that still dispatch to the old store.

Part of #2018.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brian-smith-tcril
brian-smith-tcril force-pushed the bsmith/special-exams-redux-teardown branch from f8d40aa to dfffb5a Compare October 15, 2026 15:30
@brian-smith-tcril
brian-smith-tcril merged commit 86043a3 into master Oct 15, 2026
7 checks passed
@brian-smith-tcril
brian-smith-tcril deleted the bsmith/special-exams-redux-teardown branch October 15, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants