Skip to content

Commit

Permalink
Image CDN: Remove script used for compatibility with jetpack-lazy-ima…
Browse files Browse the repository at this point in the history
…ges (#37069)
  • Loading branch information
haqadn authored Apr 29, 2024
1 parent 74560fd commit 58844e1
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 185 deletions.
12 changes: 0 additions & 12 deletions pnpm-lock.yaml

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: removed

Lazy Loading: Removed compatibility script for Jetpack Lazy Loading module.
6 changes: 2 additions & 4 deletions projects/packages/image-cdn/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
"@composer phpunit"
],
"post-install-cmd": "WorDBless\\Composer\\InstallDropin::copy",
"post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy",
"build-production": "pnpm run build-production",
"build-development": "pnpm run build"
"post-update-cmd": "WorDBless\\Composer\\InstallDropin::copy"
},
"repositories": [
{
Expand All @@ -51,7 +49,7 @@
},
"autotagger": true,
"branch-alias": {
"dev-trunk": "0.3.x-dev"
"dev-trunk": "0.4.x-dev"
},
"textdomain": "jetpack-image-cdn",
"version-constants": {
Expand Down
29 changes: 0 additions & 29 deletions projects/packages/image-cdn/package.json

This file was deleted.

31 changes: 1 addition & 30 deletions projects/packages/image-cdn/src/class-image-cdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@

namespace Automattic\Jetpack\Image_CDN;

use Automattic\Jetpack\Assets;

/**
* Class Image_CDN
*/
final class Image_CDN {

const PACKAGE_VERSION = '0.3.7-alpha';
const PACKAGE_VERSION = '0.4.0-alpha';

/**
* Singleton.
Expand Down Expand Up @@ -114,9 +112,6 @@ private function setup() {
add_filter( 'wp_calculate_image_srcset', array( $this, 'filter_srcset_array' ), 10, 5 );
add_filter( 'wp_calculate_image_sizes', array( $this, 'filter_sizes' ), 1, 2 ); // Early so themes can still easily filter.

// Helpers for maniuplated images.
add_action( 'wp_enqueue_scripts', array( $this, 'action_wp_enqueue_scripts' ), 9 );

/**
* Allow Photon to disable uploaded images resizing and use its own resize capabilities instead.
*
Expand Down Expand Up @@ -1228,30 +1223,6 @@ protected static function image_sizes() {
return is_array( self::$image_sizes ) ? self::$image_sizes : array();
}

/**
* Enqueue Photon helper script
*
* @uses wp_enqueue_script, plugins_url
* @action wp_enqueue_script
* @return null
*/
public function action_wp_enqueue_scripts() {
if ( self::is_amp_endpoint() ) {
return;
}

Assets::register_script(
'jetpack-photon',
'../dist/image-cdn.js',
__FILE__,
array(
'enqueue' => true,
'nonminpath' => 'js/image-cdn.js',
'in_footer' => true,
)
);
}

/**
* Determine if image_downsize should utilize Photon via REST API.
*
Expand Down
63 changes: 0 additions & 63 deletions projects/packages/image-cdn/src/js/image-cdn.js

This file was deleted.

31 changes: 0 additions & 31 deletions projects/packages/image-cdn/webpack.config.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Updated composer.lock.


10 changes: 2 additions & 8 deletions projects/plugins/boost/composer.lock

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: other
Comment: Updated composer.lock.


10 changes: 2 additions & 8 deletions projects/plugins/jetpack/composer.lock

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

0 comments on commit 58844e1

Please sign in to comment.