Page MenuHomePhabricator

Webpack + test transition of mobile.startup classes and instances (Button, Icon, icons, Panel, Section, Thumbnail, Page)
Closed, ResolvedPublic3 Story Points

Description

Continue the migration of mobile.startup to webpack.

Acceptance criteria

  • Button built via webpack
  • Icon built via webpack
  • icons built via webpack
  • Panel built via webpack
  • Section built via webpack
  • Thumbnail built via webpack
  • Page built via webpack
  • After porting, update any global jQuery references to use the util.js module per our dev conversations

Note: Adding additional test coverage is out of scope and will be added separately.
Note: If tests cannot be ported (similar to View.js) due to reliance on sinon or jQuery leave them be. Only port the trivial tests.

Sign off steps

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 19 2018, 7:14 PM
Jdlrobson updated the task description. (Show Details)Sep 24 2018, 5:31 PM
ovasileva triaged this task as High priority.Sep 25 2018, 4:20 PM
ovasileva set the point value for this task to 3.Sep 25 2018, 4:26 PM

Change 463544 had a related patch set uploaded (by Niedzielski; owner: Stephen Niedzielski):
[mediawiki/extensions/MobileFrontend@master] Hygiene: port widgets to Webpack

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

Change 463545 had a related patch set uploaded (by Niedzielski; owner: Stephen Niedzielski):
[mediawiki/extensions/MobileFrontend@master] Hygiene: enable headless Page tests

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

Change 463786 had a related patch set uploaded (by Niedzielski; owner: Stephen Niedzielski):
[mediawiki/skins/MinervaNeue@master] Hygiene: access time via mfModules instead of M

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

Change 463786 abandoned by Niedzielski:
Hygiene: access time via mfModules instead of M

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

Change 463544 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Hygiene: port widgets and models to Webpack

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

Jdlrobson updated the task description. (Show Details)Oct 5 2018, 6:12 PM

Change 463545 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Hygiene: enable headless Page tests

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

Jdlrobson updated the task description. (Show Details)Oct 10 2018, 5:55 PM

1 acceptance criteria not done:
"After porting, update any global jQuery references to use the util.js module per our dev conversations"

What do we want to do here (if anything)

I see globals in:

  • tests/node-qunit/mobile.startup/Page.test.js
  • e.g. $( PARSER_OUTPUT ).html(
  • tests/node-qunit/mobile.startup/util.test.js
  • docReady instanceof $,
  • tests/node-qunit/mobile.startup/Browser.test.js
    • $html = $( tmpDOM );
  • tests/node-qunit/mobile.startup/View.test.js
  • view.$el instanceof $

The View and util usages seem legit, but should we be using util.parseHTML instead for the others?

Change 468347 had a related patch set uploaded (by Niedzielski; owner: Stephen Niedzielski):
[mediawiki/extensions/MobileFrontend@master] Hygiene: replace $ with util.parseHTML in Page.test

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

instanceof $
$html = $( tmpDOM );

I wasn't sure what to do with this one since we don't have a util method for these. Since it was unusual and not part of this task's tests, I left it.

I've made all util.parseHTML() substitutions in Page.test.js.

Change 468347 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Hygiene: replace $ with util.parseHTML in Page.test

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

Niedzielski removed Niedzielski as the assignee of this task.Oct 19 2018, 7:11 PM
Niedzielski removed a subscriber: Niedzielski.
Niedzielski added a subscriber: Niedzielski.
Jdlrobson closed this task as Resolved.Oct 19 2018, 9:18 PM
Jdlrobson updated the task description. (Show Details)