Implicitly discovered template_preprocess_HOOK() callbacks are being deprecated and replaced with explicitly defined initial callbacks.
Various views plugins have the unique ability to define a theme key in their plugin attribute, the views module then automatically defines a theme hook definition for them. That code now makes an assumption that an initial preprocess callback is defined in a specifically named method and class. This is only added if that method exists. Alternatively, plugins with such a callback can also use hook_theme_registry_alter() to define an alternative initial preprocess callback.
The initial preprocess callback is built with this pattern:
Drupal\module_name\Hook\ModuleNameThemeHooks::preprocessCamelizedThemeHookName()
For example, the module views_example_display defines a display plugin with theme: "views_display_example", then the resulting initial preprocess callback looks like this:
namespace Drupal\views_example_display\Hook;
class ViewsExampleDisplayThemeHooks {
public function preprocessViewsDisplayExample(array $variables) {
}
}
This follows the adopted common pattern to put initial preprocess callbacks in the theme hooks class.
Note: This class is automatically registered as a service if there is at least one hook method in that class. Alternatively, it can be explicitly registered:
services:
Drupal\views_example_display\Hook\ViewsExampleDisplayThemeHooks:
autowire: true