From 5bd9271fc3a0e2aff4fb2234dcfd686f4af5afee Mon Sep 17 00:00:00 2001
From: Travis Tomka <underoathosx@gmail.com>
Date: Thu, 27 May 2021 19:38:17 -0600
Subject: [PATCH 1/2] Update Drupal core version requirements.

---
 js_component.info.yml | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/js_component.info.yml b/js_component.info.yml
index 7f9dd02..7a6f1b6 100644
--- a/js_component.info.yml
+++ b/js_component.info.yml
@@ -1,6 +1,5 @@
 type: module
 name: JS Component
 description: Define JS components as custom blocks from a theme or module.
-core: 8.x
-core_version_requirement: ^8 || ^9
+core_version_requirement: ^8.7.7 || ^9
 package: Other
-- 
GitLab


From 4d277a514d50bee78330ac625e23e9e7a7b7271b Mon Sep 17 00:00:00 2001
From: Steven Luongo <luongosb@gmail.com>
Date: Tue, 22 Apr 2025 08:53:40 -0400
Subject: [PATCH 2/2] Issue #3520495 by vetchneons: Drupal 11 Compatibility
 Update

---
 js_component.info.yml                                  | 2 +-
 src/EventSubscriber/JSComponentBuildEventSubscribe.php | 2 +-
 src/Plugin/Block/JSComponentBlockType.php              | 8 ++++++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/js_component.info.yml b/js_component.info.yml
index ce9667f..0f71343 100644
--- a/js_component.info.yml
+++ b/js_component.info.yml
@@ -1,5 +1,5 @@
 type: module
 name: JS Component
 description: Define JS components as custom blocks from a theme or module.
-core_version_requirement: ^9.3 || ^10
+core_version_requirement: ^10.1 || ^11
 package: Other
diff --git a/src/EventSubscriber/JSComponentBuildEventSubscribe.php b/src/EventSubscriber/JSComponentBuildEventSubscribe.php
index 3b5a8d4..a6343af 100644
--- a/src/EventSubscriber/JSComponentBuildEventSubscribe.php
+++ b/src/EventSubscriber/JSComponentBuildEventSubscribe.php
@@ -14,7 +14,7 @@ class JSComponentBuildEventSubscribe implements EventSubscriberInterface {
   /**
    * {@inheritDoc}
    */
-  public static function getSubscribedEvents() {
+  public static function getSubscribedEvents(): array {
     return [
       Events::BUILD_COMPONENT_DATA => [
         ['buildJSComponentData'],
diff --git a/src/Plugin/Block/JSComponentBlockType.php b/src/Plugin/Block/JSComponentBlockType.php
index c03b80f..3c1e57d 100644
--- a/src/Plugin/Block/JSComponentBlockType.php
+++ b/src/Plugin/Block/JSComponentBlockType.php
@@ -26,6 +26,8 @@ use Drupal\Core\Render\ElementInfoManagerInterface;
 use Drupal\js_component\JSComponentManagerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Drupal\Core\Utility\Error;
+
 
 /**
  * Define JS component block.
@@ -218,7 +220,8 @@ class JSComponentBlockType extends BlockBase implements ContainerFactoryPluginIn
         $build += $this->buildComponentInlineTemplate();
       }
     } catch (\Exception $exception) {
-      watchdog_exception('js_component', $exception);
+      $logger = \Drupal::logger('js_component');
+      Error::logException($logger, $exception);
     }
 
     return $build;
@@ -392,7 +395,8 @@ class JSComponentBlockType extends BlockBase implements ContainerFactoryPluginIn
         $subform_state
       ]);
     } catch (\Exception $exception) {
-      watchdog_exception('js_component', $exception);
+      $logger = \Drupal::logger('js_component');
+      Error::logException($logger, $exception);
     }
 
     return $values;
-- 
GitLab