Page MenuHomePhabricator

Remove "mediawiki.template.muhogan" from RelatedArticles
Closed, ResolvedPublic3 Estimated 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

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

Jdlrobson removed a project: Patch-For-Review.
Jdlrobson updated the task description. (Show Details)
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

T219846-1.png (2×1 px, 371 KB)

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

T219846-2.png (2×1 px, 246 KB)

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

T219846-3.png (2×1 px, 192 KB)

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

T219846-4.png (2×1 px, 154 KB)

phuedx added subscribers: ovasileva, phuedx.

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

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

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

pmiazga updated the task description. (Show Details)