Page MenuHomePhabricator

Remove "mediawiki.template.muhogan" from RelatedArticles
Closed, ResolvedPublic3 Story Points

Description

RelatedArticles switches between Hogan and Mustache using a mediawiki.template.muhogan module for two templates:

  • resources/ext.relatedArticles.cards/card.muhogan
  • resources/ext.relatedArticles.cards/cards.muhogan

The templates look like this:

<ul class="ext-related-articles-card-list">
</ul>

and

<li title="{{ title }}" class="ext-related-articles-card">
        <div class="ext-related-articles-card-thumb" {{# hasThumbnail }}style="background-image: url( '{{ thumbnailUrl }}' );"{{/ hasThumbnail }}></div>
        <a href="{{ url }}" aria-hidden="true" tabindex="-1"></a>
        <div class="ext-related-articles-card-detail">
                <h3><a href="{{ url }}">{{ title }}</a></h3>
                {{# extract }}<p class="ext-related-articles-card-extract">{{ extract }}</p>{{/ extract }}
        </div>
</li>

It is the only extension outside MobileFrontend that uses Hogan templates.

While in future we might want to make these use Mustache, for the short term, we want to avoid shipping copies of both Mustache AND Hogan to end users.
To keep things simple, let's construct the above using jQuery and remove the template dependency altogether. While not ideal, this will simplify things for us as we move Minerva and MobileFrontend off Hogan.

Acceptance criteria

  • Use of RelatedArticles templates is dropped in favor of jQuery (conditionals/attr method).

QA steps

All tests should be carried out with an anonymous user in incognito window:

Sign off steps

QA Results

Event Timeline

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptApr 2 2019, 12:02 AM
Jdlrobson triaged this task as High priority.Apr 2 2019, 12:02 AM
Jdlrobson added a project: RelatedArticles.
Jdlrobson set the point value for this task to 5.Apr 2 2019, 4:42 PM
Jdlrobson changed the point value for this task from 5 to 3.

Change 502529 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[mediawiki/extensions/RelatedArticles@master] Remove muhogan templates and module

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

Change 502529 merged by Jdlrobson:
[mediawiki/extensions/RelatedArticles@master] Remove muhogan templates and module

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

Krinkle removed a subscriber: Krinkle.
Jdlrobson removed a project: Patch-For-Review.
Jdlrobson updated the task description. (Show Details)
Edtadros reassigned this task from Edtadros to ovasileva.
Edtadros added a subscriber: Edtadros.

Test Result

Status: ✅ PASS
OS: macOS Mojave
Browser: Chrome
Device: MBP
Emulated Device: iPhoneX

Test Artifact(s):

QA steps

All tests should be carried out with an anonymous user in incognito window:

✅ AC1: Confirm related articles do not show up on desktop wikipedia beta clustr: https://en.wikipedia.beta.wmflabs.org/wiki/Related_Articles_2

✅ AC2: Confirm related articles show on mobile: https://en.m.wikipedia.beta.wmflabs.org/wiki/Related_Articles_2

✅ AC3: Confirm they show on desktop wikivoyage beta cluster: https://en.wikivoyage.beta.wmflabs.org/wiki/Related_test

✅ AC4: Confirm they show on mobile wikivoyage: https://en.m.wikivoyage.beta.wmflabs.org/wiki/Related_test

Edtadros updated the task description. (Show Details)Apr 25 2019, 9:10 PM
phuedx claimed this task.Apr 29 2019, 1:46 PM
phuedx added subscribers: ovasileva, phuedx.

I feel comfortable signing this off in @ovasileva's absence.

phuedx removed phuedx as the assignee of this task.Apr 29 2019, 2:54 PM
phuedx assigned this task to Jdrewniak.Apr 29 2019, 5:20 PM

Change 507544 had a related patch set uploaded (by Jdrewniak; owner: Jdrewniak):
[mediawiki/extensions/RelatedArticles@master] Hygiene: Followup from 191fc2a

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

Change 507621 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/extensions/RelatedArticles@master] Remove unused ResourceLoaderMuHoganModule module

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

Change 507544 merged by jenkins-bot:
[mediawiki/extensions/RelatedArticles@master] Hygiene: Followup from 191fc2a

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

Change 507621 merged by jenkins-bot:
[mediawiki/extensions/RelatedArticles@master] Remove unused ResourceLoaderMuHoganModule module

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

Jdlrobson removed Jdrewniak as the assignee of this task.

This has already been QAed. Follow ups do not warrant further QA

pmiazga added a subscriber: pmiazga.May 2 2019, 3:58 PM

I'll sign off this task

pmiazga claimed this task.May 2 2019, 3:59 PM
pmiazga removed a project: Patch-For-Review.
pmiazga closed this task as Resolved.May 2 2019, 7:38 PM
pmiazga updated the task description. (Show Details)