Currently a hook_library_alter() defined in the template.php of a front-end theme is not called.
When you empty the cache so it build the theme registry, the hook_library_alter() is never called.
This is however super important when you detach completely the front-end theme from drupal and wants to redefines some jquery library versions / Or adds a new UI.
Some people on the internet claims it is possible to implements alter_hook in template.php but I could not manage to reproduces it.
The only work around right now is to externalize a module which define the alter hook, but then for my use case it replace the jquery, and jquery.ui for the whole drupal system, thus the admin theme as well.
It then break the admin theme and contributed modules when contributing on the back-end which is not the expected behavior.
Theme should be able to alter hooks on a per-theme basis.
A possible solution is having a hook registry per active theme.
I read these already
\Drupal\Core\Asset\LibraryDiscoveryCollector doesn't support theme change on single request. If theme changes class has to be reconstruced.
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,479 pass(es). View
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 91,481 pass(es). View