Page MenuHomePhabricator

Deprecate the mediawiki.viewport library
Closed, ResolvedPublic

Description

After talking to @phuedx, now that IntersectionObserver is widely available in our grade A browsers, we recommend deprecating the mediawiki.viewport library.
Intersection/MutationObserver will be more performant than our existing approach in RelatedArticles and QuickSurveys.

We will update RelatedArticles and QuickSurveys as part of T262859 to use Intersection/MutationObserver . For browsers that don't support it we will not show related articles and will not log impressions for QuickSurveys, which is fine.

We will then deprecate this module in core.

TODO

  • Drop from MobileFrontend
  • Rewrite QuickSurveys to use MutationObserver
  • Rewrite RelatedArticles to use MutationObserver
  • Deprecate in core

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 697847 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/MobileFrontend@master] Drop unused dependency

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

Change 697848 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Deprecate the mediawiki.viewport library

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

Jdlrobson added a project: MobileFrontend.

The MobileFrontend usage is a leftover from when we updated lazy loading images codebase and can be removed.

Change 697847 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Drop unused mediawiki.viewport dependency

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

Change 697848 merged by jenkins-bot:

[mediawiki/core@master] resources: Deprecate the mediawiki.viewport library

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

Jdlrobson claimed this task.

Resolving this. QuickSurveys will be handled in T262859.
RelatedArticles will be handled in T284251

Change 699448 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] mediawiki.viewport: Replace ambiguous "[1.37]" mark with words

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

Change 699448 merged by jenkins-bot:

[mediawiki/core@master] mediawiki.viewport: Replace ambiguous "[1.37]" mark with words

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