Page MenuHomePhabricator

Parsoid Gallery doesn't specify any JS modules in its output unlike core Gallery implementation
Closed, ResolvedPublic

Description

Core Gallery implementation emits modules (styles, JS) as part of its output.

Parsoid's Gallery implementation only specifies style modules as part of the extension config, but does not specific the same JS modules as core.

Event Timeline

ssastry triaged this task as Medium priority.Nov 30 2020, 6:53 PM
ssastry created this task.
[subbu@earth:~/work/wmf/core/includes/gallery] git grep mediawiki.page.gallery
PackedImageGallery.php:         return [ 'mediawiki.page.gallery' ];
SlideshowImageGallery.php:              return [ 'mediawiki.page.gallery.slideshow' ];
TraditionalImageGallery.php:            $out->addModuleStyles( 'mediawiki.page.gallery.styles' );

Registering a modulestyle with the extension seems like a pretty coarse grained api. The legacy parser only adds the styles/scripts if the tag is used on the page. We currently do that for places where we call the out to the legacy parser, with env->addOutputProperty

Should we switch to using that for native extensions as well?

Change 644341 had a related patch set uploaded (by Arlolra; owner: Arlolra):
[mediawiki/services/parsoid@master] [WIP] Refine adding module(style)?s in extapi

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

After that's merged, I think this can be closed as a dupe of T162399

Don't need to merge this as a dupe of that. This was only about the Parsoid impl not specifying any modules at all. Since I +2ed that already, I'll resolve this.

Change 644341 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Refine adding module(style)?s in extapi

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

Change 646892 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.13.0-a19

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

Change 646892 merged by jenkins-bot:
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.13.0-a19

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

Change 646771 had a related patch set uploaded (by C. Scott Ananian; owner: Subramanya Sastry):
[mediawiki/vendor@wmf/1.36.0-wmf.21] Bump wikimedia/parsoid to 0.13.0-a19

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

Change 646771 merged by jenkins-bot:
[mediawiki/vendor@wmf/1.36.0-wmf.21] Bump wikimedia/parsoid to 0.13.0-a19

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