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

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 Normal priority.Jan 25 2017, 7:24 PM
pmiazga added a subscriber: pmiazga.Mar 6 2017, 3:47 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?

Jhernandez removed Jhernandez as the assignee of this task.May 4 2017, 12:04 PM

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?

phuedx removed a subscriber: phuedx.May 4 2017, 4:06 PM

(this is stalled on T158980)

Jdlrobson moved this task from Backlog to Tasks on the MobileFrontend board.Jul 13 2017, 5:54 PM
Jdlrobson updated the task description. (Show Details)Aug 3 2017, 10:28 PM
Jdlrobson updated the task description. (Show Details)Aug 28 2017, 9:51 PM
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 Normal 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!

It is indeed :)

Jdlrobson closed this task as Resolved.Oct 23 2018, 1:07 AM
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.