Page MenuHomePhabricator

ExampleSkin should use SkinMustache
Closed, ResolvedPublic

Description

Encouraging string stitching in HTML like in https://github.com/wikimedia/mediawiki-skins-Example/blob/master/includes/ExampleTemplate.php#L15 is bad practice and potentially offputting for non PHP developers.

ExampleSkin currently acts as a very bad example of how to write a skin given recent developments and should be updated to use SkinMustache.

Event Timeline

I do feel if we're going to be suggesting this is the way forward to do things (for whatever reasons)... We should get some love to lightncandy in MW Core and extensions that use it, rather than just sitting on an old unsupported version which is 0.23

See T121947

Totally. This is news to me but Minerva is pretty locked into it right now

TBH right now after taking a closer look at the Example skin, I would not recommend using it for a new skin. Now the Zordius upgrade has occurred I don't think anything blocks using templates and I think that along with a lot of simplification of the Skin php classes is necessary for this to be something we put in front of new skin developers.

FWIW long term I don't think we should use an ExampleSkin extension and I think skins should not require PHP knowledge. I think what would be better is to create an extension that helps developers build skin. I've tried to write up these thoughts here:
https://phabricator.wikimedia.org/phame/post/view/188/why_does_building_a_skin_require_php_knowledge/
and I'd be interested in your comments.

Jdlrobson renamed this task from ExampleSkin should use mustache template for HTML to ExampleSkin should use SkinMustache.Jul 7 2020, 7:30 PM
Jdlrobson triaged this task as High priority.
Jdlrobson updated the task description. (Show Details)

Change 624759 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Example@master] ExampleSkin uses SkinMustache

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

Change 624759 merged by jenkins-bot:
[mediawiki/skins/Example@master] ExampleSkin uses SkinMustache

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

Jdlrobson claimed this task.

Opened up T262565 to complete the transition.

Change 626505 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Example@master] Use portlet data from template

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

Change 626794 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/Example@master] Use SkinMustache for footer generation

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

Change 626505 merged by jenkins-bot:
[mediawiki/skins/Example@master] Use portlet data from template

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

Change 626794 merged by jenkins-bot:
[mediawiki/skins/Example@master] Use SkinMustache for footer generation

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

Change 631395 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/skins/Example@master] Turn on RL SkinModule legacy feature

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