Problem/Motivation
In \Drupal\Core\Theme\ThemeManager::render
there is a condition that prevents module-originated templates from being processed with a different render_template
if (isset($theme_engine)) {
if ($info['type'] != 'module') { // <<<< THIS CONDITION
if (function_exists($theme_engine . '_render_template')) {
$render_function = $theme_engine . '_render_template';
}
$extension_function = $theme_engine . '_extension';
if (function_exists($extension_function)) {
$extension = $extension_function();
}
}
}
This interferes with Experience Builder's templates being able to render with a different theme engine. There's a workaround RN, but it's clunky and any additional module hoping to do this would also need to add it.
Based on looking at the commit history and talking to some long time core contributors, there's a good chance this is just an artifact from drupal <=7 and not something essential. Lets find out!