Page MenuHomePhabricator

[EPIC] Add Redux to MobileFrontend
Closed, DeclinedPublic

Description

NOTE: this task is a draft and should be considered work in progress until resolution or this notice is removed.

The purpose of this task is to install Redux as an NPM dependency, add any tooling changes needed, initialize the library on application entry, and identify the first part of the codebase to be changed to use the new functionality.

The Redux library has been in use for a long time in the Popups extension so a security review should be unnecessary so long as only Redux and redux-thunk are used.

Initialization should reference Popups's implementation.

Acceptance criteria

  • The latest version of Redux is installed in MobileFrontend, initialized on entry, and ready for use.
  • Any changes needed to the Webpack and test configurations are considered.
  • Document merge and deploy dates, and gzipped increases on the release timeline.
  • Deprecations are noted where applicable.
  • A part of the code is identified for the initial use and a new subtask of T225455 is made. The new task should require setting good usage patterns, any considerations that should be made for testing Redux'd code, adding any additional documentation necessary, and identifying subsequent subtasks to be made.
  • All code is slowly ported to Redux over a set timeframe.

Related Objects

Event Timeline

Change 524314 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Simplify Drawers via Redux statement

https://gerrit.wikimedia.org/r/524314

Change 525177 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/MobileFrontend@master] Overlays to use Redux state management

https://gerrit.wikimedia.org/r/525177

Jdlrobson triaged this task as Medium priority.Aug 2 2019, 6:10 PM

Change 524314 abandoned by Jdlrobson:
Simplify Drawers via Redux state management

Reason:
Not sure where we landed with this but I'm guessing with desktop project we won't have time to pursue this.

https://gerrit.wikimedia.org/r/524314

Change 525177 abandoned by Jdlrobson:
Overlays to use Redux state management (simplified OverlayManager)

https://gerrit.wikimedia.org/r/525177

Jdlrobson renamed this task from Add Redux to MobileFrontend to [EPIC] Add Redux to MobileFrontend.Mar 11 2020, 9:23 PM
Jdlrobson added a project: Epic.
Jdlrobson updated the task description. (Show Details)
Jdlrobson closed this task as Declined.EditedJul 24 2020, 10:32 PM
Jdlrobson added a subscriber: Jdlrobson.

A little unsure about this now in light of other work while Vue is being adopted and best practices are emerging so I'm going to decline this given the moved goalposts. I actually think vue-router should be enough to cope with state in MobileFrontend since that's the only thing that changes.
Proof of concept at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/616175 WIP: OverlayManager using Vue [NEW]

(also vuex is in core)