#788900: Deprecate and remove usages of arg() β
reminded me that we still generate theme and template suggestions based on path, for example page--node--1.tpl.php
The problem
Now that most code in core is based on routes, someone could change /node/% to /content/% and your theme would break. This makes those suggestions impossible to use in contrib themes since they can't work generically.
Additionally HTML head is one of the least-cacheable parts of the page in 8.x, and per-path suggestions will make it harder to cache that HTML.
Also these suggestions are a bit broken in D8 in the first place, they include a suggestion with a percent character:
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'html' -->
<!-- FILE NAME SUGGESTIONS:
* html--node--2.html.twig
* html--node--%.html.twig
* html--node.html.twig
x html.html.twig
-->
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'page' -->
<!-- FILE NAME SUGGESTIONS:
* page--node--2.html.twig
* page--node--%.html.twig
* page--node.html.twig
x page.html.twig
-->
Proposed solution
Remove the automatic theme suggestions based on path parts.
Why this should be an RC target
1. This is code removal only.
2. In general, contrib themes never use the per-page suggestions (and if they do they're fragile), they're sometimes used by custom themes (and often incorrectly when block configuration, page manager or similar would be a better choice). So the disruption in terms of number of themes using the feature should be low.
3. New theme developers sometimes use this 'by mistake' instead of the better options in #2, which can lead to custom themes with 10-15 page templates all with minro variations, this is one of the worst maintenance issues with custom themes in the wild.
4. Also themes can add back the suggestions by copying the removed code to template.php.
5. While templates using the suggestions won't be picked up, there's no other disruption to actual sites from the change in terms of errors etc. even if they're using the feature, which 99.9% won't be.