Problem/Motivation
We want to load as few as code as possible on requests, unless needed.
Currently the ThemeHandler has quite a lot of dependencies:
public function __construct($root, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, StateInterface $state, InfoParserInterface $info_parser,LoggerInterface $logger, AssetCollectionOptimizerInterface $css_collection_optimizer = NULL, ConfigInstallerInterface $config_installer = NULL, ConfigManagerInterface $config_manager = NULL, RouteBuilderInterface $route_builder = NULL, ExtensionDiscovery $extension_discovery = NULL) {
Another problem is that the module_installer exists, but the theme_handler is still responsible for installing
Proposed resolution
Move the installation code of themes into its separate entity, called ThemeInstaller.
That itself improves the performance a bit.
As BC layer we can keep ThemeHandler::install() but just call out to the other code.
Remaining tasks
User interface changes
API changes
- New service called theme_installer
- theme_handler->install() => theme_install->install()
- theme_handler->uninstall() => theme_install->uninstall()
Beta phase evaluation