Skip to content

Commit

Permalink
Merge branch 'trunk' of https://github.com/WordPress/performance into…
Browse files Browse the repository at this point in the history
… add/external-bg-preload
  • Loading branch information
westonruter committed Dec 3, 2024
2 parents fbb6076 + 7e69f6b commit 5c3e698
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php-test-plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
coverage: [false]
include:
- php: '7.4'
wp: '6.5'
wp: '6.6'
- php: '8.3'
wp: 'trunk'
- php: '8.2'
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 15 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
},
"devDependencies": {
"@octokit/rest": "^21.0.2",
"@wordpress/env": "^10.12.0",
"@wordpress/prettier-config": "^4.12.0",
"@wordpress/scripts": "^30.5.1",
"@wordpress/env": "^10.13.0",
"@wordpress/prettier-config": "^4.13.0",
"@wordpress/scripts": "^30.6.0",
"commander": "12.1.0",
"copy-webpack-plugin": "^12.0.2",
"css-minimizer-webpack-plugin": "^7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion plugins/auto-sizes/auto-sizes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Enhanced Responsive Images
* Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/auto-sizes
* Description: Improves responsive images with better sizes calculations and auto-sizes for lazy-loaded images.
* Requires at least: 6.5
* Requires at least: 6.6
* Requires PHP: 7.2
* Version: 1.3.0
* Author: WordPress Performance Team
Expand Down
2 changes: 1 addition & 1 deletion plugins/dominant-color-images/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Image Placeholders
* Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/dominant-color-images
* Description: Displays placeholders based on an image's dominant color while the image is loading.
* Requires at least: 6.5
* Requires at least: 6.6
* Requires PHP: 7.2
* Version: 1.1.2
* Author: WordPress Performance Team
Expand Down
2 changes: 1 addition & 1 deletion plugins/embed-optimizer/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Embed Optimizer
* Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/embed-optimizer
* Description: Optimizes the performance of embeds through lazy-loading, preconnecting, and reserving space to reduce layout shifts.
* Requires at least: 6.5
* Requires at least: 6.6
* Requires PHP: 7.2
* Version: 0.3.0
* Author: WordPress Performance Team
Expand Down
2 changes: 1 addition & 1 deletion plugins/image-prioritizer/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Image Prioritizer
* Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/image-prioritizer
* Description: Prioritizes the loading of images and videos based on how visible they are to actual visitors; adds <code>fetchpriority</code> and applies lazy-loading.
* Requires at least: 6.5
* Requires at least: 6.6
* Requires PHP: 7.2
* Requires Plugins: optimization-detective
* Version: 0.2.0
Expand Down
15 changes: 11 additions & 4 deletions plugins/optimization-detective/detect.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,16 @@ export default async function detect( {
return;
}

// Keep track of whether the window resized. If it resized, we abort sending the URLMetric.
let didWindowResize = false;
window.addEventListener(
'resize',
() => {
didWindowResize = true;
},
{ once: true }
);

// TODO: Does this make sense here?
// Prevent detection when page is not scrolled to the initial viewport.
if ( doc.documentElement.scrollTop > 0 ) {
Expand Down Expand Up @@ -542,10 +552,7 @@ export default async function detect( {

// Only proceed with submitting the URL Metric if viewport stayed the same size. Changing the viewport size (e.g. due
// to resizing a window or changing the orientation of a device) will result in unexpected metrics being collected.
if (
window.innerWidth !== urlMetric.viewport.width ||
window.innerHeight !== urlMetric.viewport.height
) {
if ( didWindowResize ) {
if ( isDebug ) {
log(
'Aborting URL Metric collection due to viewport size change.'
Expand Down
2 changes: 1 addition & 1 deletion plugins/optimization-detective/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Optimization Detective
* Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/optimization-detective
* Description: Provides an API for leveraging real user metrics to detect optimizations to apply on the frontend to improve page performance.
* Requires at least: 6.5
* Requires at least: 6.6
* Requires PHP: 7.2
* Version: 0.9.0-alpha
* Author: WordPress Performance Team
Expand Down
2 changes: 1 addition & 1 deletion plugins/performance-lab/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Performance Lab
* Plugin URI: https://github.com/WordPress/performance
* Description: Performance plugin from the WordPress Performance Team, which is a collection of standalone performance features.
* Requires at least: 6.5
* Requires at least: 6.6
* Requires PHP: 7.2
* Version: 3.6.1
* Author: WordPress Performance Team
Expand Down
2 changes: 1 addition & 1 deletion plugins/speculation-rules/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Speculative Loading
* Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/speculation-rules
* Description: Enables browsers to speculatively prerender or prefetch pages to achieve near-instant loads based on user interaction.
* Requires at least: 6.5
* Requires at least: 6.6
* Requires PHP: 7.2
* Version: 1.3.1
* Author: WordPress Performance Team
Expand Down
2 changes: 1 addition & 1 deletion plugins/web-worker-offloading/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Web Worker Offloading
* Plugin URI: https://github.com/WordPress/performance/issues/176
* Description: Offloads select JavaScript execution to a Web Worker to reduce work on the main thread and improve the Interaction to Next Paint (INP) metric.
* Requires at least: 6.5
* Requires at least: 6.6
* Requires PHP: 7.2
* Version: 0.1.1
* Author: WordPress Performance Team
Expand Down
2 changes: 1 addition & 1 deletion plugins/webp-uploads/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Modern Image Formats
* Plugin URI: https://github.com/WordPress/performance/tree/trunk/plugins/webp-uploads
* Description: Converts images to more modern formats such as WebP or AVIF during upload.
* Requires at least: 6.5
* Requires at least: 6.6
* Requires PHP: 7.2
* Version: 2.3.0
* Author: WordPress Performance Team
Expand Down

0 comments on commit 5c3e698

Please sign in to comment.