Description
Wikipedia-Preview is a standalone JavaScript component that allows external partners to show previews of Wikipedia articles on their sites. Similar to the page previews extension but for external sites.
Preview environment
Demo: https://wikimedia.github.io/wikipedia-preview/demo/
Storybook: https://wikimedia.github.io/wikipedia-preview/storybook-static/
Which code to review
https://github.com/wikimedia/wikipedia-preview
Performance assessment
Please initiate the performance assessment by answering the below:
- What work has been done to ensure the best possible performance of the feature?
We always keep an eye on the bundle size. The published bundle is minified and available in gzip format. The included SVGs have been optimized. We use no external libraries.
There's a loading state in place while the user is waiting for the API response.
- What are likely to be the weak areas (e.g. bottlenecks) of the code in terms of performance?
Initial download of the bundle may be an issue on slow networks. We could consider breaking it down but we also need to consider the complexity for partners who are integrating it in their sites.
- Are there potential optimisations that haven't been performed yet?
The style (CSS) could be more DRY. I hope this is addressed before the review. It should shave a few bytes.
The fullscreen gallery view uses heavy images. We need to look at the options for loading the smallest possible images that will look OK on the device.
We considered some pre-fetching of data on page load to make the previews instantaneous but that means more bandwidth being used for previews that may not be shown.
- Please list which performance measurements are in place for the feature and/or what you've measured ad-hoc so far. If you are unsure what to measure, ask the Performance Team for advice: performance-team@wikimedia.org.
No measurement in place yet. We don't know if any event logging will be possible so we can't plan for live performance measurements at this point. Any suggestions for other types of testing or static analysis would be much appreciated.