diff --git a/node_tree.info.yml b/node_tree.info.yml
index 0fa1aa5..6dc4993 100644
--- a/node_tree.info.yml
+++ b/node_tree.info.yml
@@ -2,7 +2,7 @@ name: 'Node tree'
 type: module
 description: 'A lazily loaded tree of nodes (jqTree) built from a parent reference field: a tree page with permalinks, a tree block that opens at the current node, JSON endpoints, a lineage breadcrumb and Drush commands that link children to parents.'
 package: Content
-core_version_requirement: ^10.3 || ^11
+core_version_requirement: ^11.2 || ^12
 configure: node_tree.settings
 dependencies:
   - drupal:node
diff --git a/node_tree.module b/node_tree.module
index c53916a..7c61c6e 100644
--- a/node_tree.module
+++ b/node_tree.module
@@ -7,35 +7,24 @@
 
 declare(strict_types=1);
 
+use Drupal\Core\Hook\Attribute\LegacyHook;
+use Drupal\node_tree\Hook\NodeTreeHooks;
 use Drupal\Core\Routing\RouteMatchInterface;
-use Drupal\Core\Url;
-use Drupal\node_tree\NodeTree;
 
 /**
  * Implements hook_help().
  */
+#[LegacyHook]
 function node_tree_help(string $route_name, RouteMatchInterface $route_match): ?string {
-  if ($route_name === 'help.page.node_tree') {
-    $settings = Url::fromRoute('node_tree.settings')->toString();
-    return '<p>' . t('Node tree shows the nodes of the configured node types as a tree that loads on demand, following the parent reference field each node carries: a tree page with a permalink per node, a block that opens the tree at the node being viewed, JSON endpoints, a lineage breadcrumb and Drush commands that link children to their parents. Configure the node types, fields and path on the <a href=":url">settings page</a>.', [':url' => $settings]) . '</p>';
-  }
-  return NULL;
+  return \Drupal::service(NodeTreeHooks::class)->help($route_name, $route_match);
 }
 
 /**
  * Implements hook_theme().
  */
+#[LegacyHook]
 function node_tree_theme(array $existing, string $type, string $theme, string $path): array {
-  return [
-    'node_tree_block' => [
-      'variables' => [],
-      'template' => 'node-tree-block',
-    ],
-    'node_tree_content_block' => [
-      'variables' => [],
-      'template' => 'node-tree-content-block',
-    ],
-  ];
+  return \Drupal::service(NodeTreeHooks::class)->theme($existing, $type, $theme, $path);
 }
 
 /**
@@ -48,15 +37,7 @@ function node_tree_theme(array $existing, string $type, string $theme, string $p
  * loaded from the jsDelivr CDN at the pinned version. The status report
  * says which is in use.
  */
+#[LegacyHook]
 function node_tree_library_info_alter(array &$libraries, string $extension): void {
-  if ($extension !== 'node_tree' || !isset($libraries['jqtree']) || NodeTree::jqtreeIsLocal()) {
-    return;
-  }
-  $base = 'https://cdn.jsdelivr.net/npm/jqtree@' . NodeTree::JQTREE_VERSION . '/';
-  $libraries['jqtree']['css']['component'] = [
-    $base . 'jqtree.css' => ['type' => 'external'],
-  ];
-  $libraries['jqtree']['js'] = [
-    $base . 'tree.jquery.js' => ['type' => 'external'],
-  ];
+  \Drupal::service(NodeTreeHooks::class)->libraryInfoAlter($libraries, $extension);
 }
diff --git a/node_tree.services.yml b/node_tree.services.yml
index e1aec08..141ba38 100644
--- a/node_tree.services.yml
+++ b/node_tree.services.yml
@@ -21,3 +21,7 @@ services:
     class: Drupal\node_tree\EventSubscriber\ConfigSubscriber
     tags:
       - { name: event_subscriber }
+
+  Drupal\node_tree\Hook\NodeTreeHooks:
+    class: Drupal\node_tree\Hook\NodeTreeHooks
+    autowire: true
diff --git a/src/Hook/NodeTreeHooks.php b/src/Hook/NodeTreeHooks.php
new file mode 100644
index 0000000..18702bc
--- /dev/null
+++ b/src/Hook/NodeTreeHooks.php
@@ -0,0 +1,76 @@
+<?php
+
+namespace Drupal\node_tree\Hook;
+
+use Drupal\node_tree\NodeTree;
+use Drupal\Core\Url;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Hook\Attribute\Hook;
+use Drupal\Core\StringTranslation\StringTranslationTrait;
+
+/**
+ * Hook implementations for node_tree.
+ */
+class NodeTreeHooks {
+  use StringTranslationTrait;
+
+  /**
+   * Implements hook_help().
+   */
+  #[Hook('help')]
+  public function help(string $route_name, RouteMatchInterface $route_match): ?string {
+    if ($route_name === 'help.page.node_tree') {
+      $settings = Url::fromRoute('node_tree.settings')->toString();
+      return '<p>' . $this->t('Node tree shows the nodes of the configured node types as a tree that loads on demand, following the parent reference field each node carries: a tree page with a permalink per node, a block that opens the tree at the node being viewed, JSON endpoints, a lineage breadcrumb and Drush commands that link children to their parents. Configure the node types, fields and path on the <a href=":url">settings page</a>.', [
+        ':url' => $settings,
+      ]) . '</p>';
+    }
+    return NULL;
+  }
+
+  /**
+   * Implements hook_theme().
+   */
+  #[Hook('theme')]
+  public function theme(array $existing, string $type, string $theme, string $path): array {
+    return [
+      'node_tree_block' => [
+        'variables' => [],
+        'template' => 'node-tree-block',
+      ],
+      'node_tree_content_block' => [
+        'variables' => [],
+        'template' => 'node-tree-content-block',
+      ],
+    ];
+  }
+
+  /**
+   * Implements hook_library_info_alter().
+   *
+   * JqTree is Apache-2.0 licensed, which drupal.org does not allow in a
+   * project's repository, so it is not shipped with the module. A site serves
+   * it from /libraries/jqtree (composer, or a copy of tree.jquery.js and
+   * jqtree.css from the jqtree npm package); without that, the library is
+   * loaded from the jsDelivr CDN at the pinned version. The status report
+   * says which is in use.
+   */
+  #[Hook('library_info_alter')]
+  public function libraryInfoAlter(array &$libraries, string $extension): void {
+    if ($extension !== 'node_tree' || !isset($libraries['jqtree']) || NodeTree::jqtreeIsLocal()) {
+      return;
+    }
+    $base = 'https://cdn.jsdelivr.net/npm/jqtree@' . NodeTree::JQTREE_VERSION . '/';
+    $libraries['jqtree']['css']['component'] = [
+      $base . 'jqtree.css' => [
+        'type' => 'external',
+      ],
+    ];
+    $libraries['jqtree']['js'] = [
+      $base . 'tree.jquery.js' => [
+        'type' => 'external',
+      ],
+    ];
+  }
+
+}
diff --git a/src/Hook/NodeTreeRequirements.php b/src/Hook/NodeTreeRequirements.php
index 11e6d32..97a0b59 100644
--- a/src/Hook/NodeTreeRequirements.php
+++ b/src/Hook/NodeTreeRequirements.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\node_tree\Hook;
 
+use Drupal\Component\Utility\DeprecationHelper;
 use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
 use Drupal\Core\Extension\Requirement\RequirementSeverity;
 use Drupal\Core\Hook\Attribute\Hook;
@@ -89,7 +90,7 @@ final class NodeTreeRequirements implements ContainerInjectionInterface {
     if (class_exists(RequirementSeverity::class)) {
       return $level === 'warning' ? RequirementSeverity::Warning : RequirementSeverity::OK;
     }
-    return $level === 'warning' ? REQUIREMENT_WARNING : REQUIREMENT_OK;
+    return $level === 'warning' ? DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::Warning, fn() => REQUIREMENT_WARNING) : DeprecationHelper::backwardsCompatibleCall(\Drupal::VERSION, '11.2.0', fn() => RequirementSeverity::OK, fn() => REQUIREMENT_OK);
   }
 
 }
diff --git a/tests/src/Functional/NodeTreeTest.php b/tests/src/Functional/NodeTreeTest.php
index 9f8da1c..f5cf899 100644
--- a/tests/src/Functional/NodeTreeTest.php
+++ b/tests/src/Functional/NodeTreeTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
 
 namespace Drupal\Tests\node_tree\Functional;
 
+use PHPUnit\Framework\Attributes\Group;
 use Drupal\Component\Serialization\Json;
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
@@ -25,6 +26,7 @@ use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
  * @group node_tree
  */
 #[RunTestsInSeparateProcesses]
+#[Group('node_tree')]
 final class NodeTreeTest extends BrowserTestBase {
 
   /**
