Page MenuHomePhabricator

Improve image loading performance
Open, Stalled, LowPublic

Description

The images used inside the on-boarding steps do not have any preloading logic at the moment or performance optimization. Let's review the current implementation so it has the same experience, at least, that the prior OOUI ProcessDialog implementation.

Event Timeline

Sgs renamed this task from Investigate image loading performance to Improve image loading performance.Apr 24 2023, 8:31 AM
Sgs created this task.

Change 914761 had a related patch set uploaded (by Viviana Yanez; author: Viviana Yanez):

[mediawiki/extensions/GrowthExperiments@master] Frontend documentation: Add OnboardingImage component with preloading logic for images

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

Sgs changed the task status from Open to In Progress.May 15 2023, 10:08 AM
Sgs moved this task from Incoming to In Progress on the Growth-Team (Sprint 0 (Growth Team)) board.

We will get back to the initial solution using background images because of the RTL support in MW for this which also implies image preloading.

Sgs reopened this task as In Progress.May 16 2023, 10:49 AM

Change 914761 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Frontend documentation: Dialog images use background-image CSS property

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

Change 924075 had a related patch set uploaded (by Viviana Yanez; author: Viviana Yanez):

[mediawiki/extensions/GrowthExperiments@master] Frontend documentation: remove img tag from AddImageDialog

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

Change 924075 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Frontend documentation: remove img tag from AddImageDialog

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

In order to take advantage of Resource Loader image preloading optimisation and filenames ending conversion to adapt to images to RTL, we decided to rollback to implement the dialog images as background-images.
However this approach introduced a portability issue, because the static assets are inlined as base64 URLs in Vite (https://github.com/vitejs/vite/issues/4454) and images are not adapting to RTL.
We are considering using a plugin as https://github.com/vitejs/vite/issues/4454#issuecomment-1478992832 or https://github.com/ManBearTM/vite-plugin-no-bundle so we can keep using background-images.
Other possible solution would be to going back to use an image tag and add logic to apply the RTL image changes, but we would need then to solve the performance issue on image loading.

Removing inactive task assignee who's not with WMF anymore. (WMF Growth-Team: Please do so as part of team offboarding steps - thanks.)