Page MenuHomePhabricator

[EPIC] Build entire mobile.startup module using webpack bundler
Closed, ResolvedPublic

Description

Blocked on: T158980

After having experimented with using a bundler in Page previews, We will use webpack to generate MobileFrontend's mobile.startup module.

This will

  • reduce size of RL module
  • Avoid unnecessary file loading in ResourceLoader
  • Make it easier for us to port to a submodule in future if necessary
  • Remove the need for unnecessary globals
  • Use npm libraries
  • Allow us to experiment/investigate using Es5/6, template compiling
  • Prevent us from surfacing functions purely for testing purposes e.g. in Skin.js we expose getSectionId;

acceptance criteria

  • Use webpack to generate a single JS file that is included by mobile.startup that includes all the existing JavaScript
  • Templates and LESS files will continue to be loaded via ResourceLoader
  • Use exports/imports where possible for exporting/importing rather than M.define/M.require
  • There is fast isolated unit testing with npm run test:unit e.g. https://gerrit.wikimedia.org/r/#/c/282899/
  • Integrate code coverage reports and fail job on coverage decrease
  • The closures around every file should be unnecessary after these changes (RL wraps code so no global var leakages, and eslint protects against unused/undefined variables used)

e.g. we can remove the following pattern

( function ( M, $ ) {

Related Objects

StatusSubtypeAssignedTask
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedJdlrobson
DeclinedNone
ResolvedJdlrobson
ResolvedJdlrobson
DuplicateSpikeNone
ResolvedJdrewniak
DeclinedNone
ResolvedJdlrobson
DeclinedNone
Resolved Jhernandez
ResolvedJdrewniak
Resolvedpmiazga
ResolvedJdrewniak
ResolvedJdlrobson
ResolvedJdrewniak

Event Timeline

Jdlrobson renamed this task from Build mobile.startup using webpack to Build mobile.startup using bundler.Jan 20 2017, 7:25 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson removed a project: Epic.

Good question. We can talk about choices of bundler. Have updated description.

Jdlrobson triaged this task as Medium priority.Jan 25 2017, 7:24 PM

We should tackle T156333 first, solve all webpack-related issues and then we should be able to use solve this task without bigger problems.

Jdlrobson renamed this task from Build mobile.startup using bundler to Build mobile.startup using webpack bundler.May 2 2017, 10:43 PM
Jdlrobson changed the task status from Open to Stalled.
Jdlrobson assigned this task to Jhernandez.
Jdlrobson updated the task description. (Show Details)

@Jhernandez I seem to remember you suggesting an alternative approach for MobileFrontend in your post-analysis.
Is the plan to still just target mobile.startup or will we target all the code?

IIRC What we talked is that migrating tests after migrating source is very painful, and that I suggested migrating source + test file to pre-compilation and common.js instead of migrating first the source and then the tests.

@Jhernandez the task as written says migrate only mobile.startup - do we need to migrate all modules at same time? Would that be easier?

Jdlrobson renamed this task from Build mobile.startup using webpack bundler to Build entire mobile.startup module using webpack bundler.Aug 3 2018, 2:48 AM
Jdlrobson updated the task description. (Show Details)
Jdlrobson changed the task status from Stalled to Open.Aug 28 2018, 10:08 PM

Unstalling and revising...

Jdlrobson renamed this task from Build entire mobile.startup module using webpack bundler to [EPIC] Build entire mobile.startup module using webpack bundler.Aug 30 2018, 1:32 AM
Jdlrobson raised the priority of this task from Medium to High.
Jdlrobson added a project: Epic.

This is the current goal relating to T195473 so moving into sprint as a reminder.

Is T156186 the last task in this epic? If so, let's get it done and close this sucker!

Jdlrobson claimed this task.

An epic has fallen! I'm not sure why T156186 was tagged here as that is scheduled for much later in the project! Will send a mail to the team to celebrate this.