From 49f670edf975250cc662d2ec1a25429009eedc05 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Thu, 30 Jun 2022 11:26:06 -0400 Subject: [PATCH 1/4] refactor: Ensure entry script HMR --- src/web/assets/src/js/ImageOptimize.js | 7 +++++++ src/web/assets/src/js/Welcome.js | 21 +++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/web/assets/src/js/ImageOptimize.js b/src/web/assets/src/js/ImageOptimize.js index b94fd34..4736135 100644 --- a/src/web/assets/src/js/ImageOptimize.js +++ b/src/web/assets/src/js/ImageOptimize.js @@ -1,2 +1,9 @@ // Import our CSS import '@/css/app.css'; + +// Accept HMR as per: https://vitejs.dev/guide/api-hmr.html +if (import.meta.hot) { + import.meta.hot.accept(() => { + console.log("HMR") + }); +} diff --git a/src/web/assets/src/js/Welcome.js b/src/web/assets/src/js/Welcome.js index 9d8fa82..e4d3e4e 100644 --- a/src/web/assets/src/js/Welcome.js +++ b/src/web/assets/src/js/Welcome.js @@ -2,12 +2,17 @@ import Vue from 'vue'; import ConfettiParty from '@/vue/ConfettiParty.vue'; new Vue({ - el: "#cp-nav-content", - components: { - ConfettiParty, - }, - data: { - }, - methods: { - }, + el: "#cp-nav-content", + components: { + ConfettiParty, + }, + data: {}, + methods: {}, }); + +// Accept HMR as per: https://vitejs.dev/guide/api-hmr.html +if (import.meta.hot) { + import.meta.hot.accept(() => { + console.log("HMR") + }); +} From f257b53accdc0ad34157bf1df416f3d0f0124b68 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 6 Jul 2022 15:20:00 -0400 Subject: [PATCH 2/4] fix: If there's no transform requested, return `null` so other plugins have a crack at it ([#349](https://github.com/nystudio107/craft-imageoptimize/issues/349)) --- src/services/Optimize.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/services/Optimize.php b/src/services/Optimize.php index f35a1a0..281347b 100644 --- a/src/services/Optimize.php +++ b/src/services/Optimize.php @@ -152,6 +152,10 @@ public function handleGetAssetUrlEvent(GetAssetUrlEvent $event) if (empty($transform)) { $transform = null; } + // If there's no transform requested, return `null` so other plugins have a crack at it + if ($transform === null) { + return null; + } // If we're passed in null, make a dummy AssetTransform model for Thumbor // For backwards compatibility if ($transform === null && ImageOptimize::$plugin->transformMethod instanceof ThumborImageTransform) { From 4b1f7951f2654d8466fe974f9706fa717c24cea3 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Wed, 6 Jul 2022 15:20:25 -0400 Subject: [PATCH 3/4] chore: Version 1.6.47 --- CHANGELOG.md | 4 ++++ composer.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd001da..09384ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # ImageOptimize Changelog +## 1.6.47 - 2022.07.06 +### Fixed +* If there's no transform requested, return `null` so other plugins have a crack at it ([#349](https://github.com/nystudio107/craft-imageoptimize/issues/349)) + ## 1.6.46 - 2022.06.29 ### Fixed * Fixed an issue that could throw an exception when double-clicking on an asset, due to an incorrect asset bundle path diff --git a/composer.json b/composer.json index cf0ca08..91eabc6 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nystudio107/craft-imageoptimize", "description": "Automatically create & optimize responsive image transforms, using either native Craft transforms or a service like imgix, with zero template changes.", "type": "craft-plugin", - "version": "1.6.46", + "version": "1.6.47", "keywords": [ "craft", "cms", From f7319fa647c08f35fca69f170c6314231a2c2d03 Mon Sep 17 00:00:00 2001 From: Andrew Welch Date: Fri, 8 Jul 2022 20:06:16 -0400 Subject: [PATCH 4/4] chore: Version 1.6.47 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 09384ba..b36c5b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # ImageOptimize Changelog -## 1.6.47 - 2022.07.06 +## 1.6.47 - 2022.07.08 ### Fixed * If there's no transform requested, return `null` so other plugins have a crack at it ([#349](https://github.com/nystudio107/craft-imageoptimize/issues/349))