Problem/Motivation
There are various open issues trying to clean-up various aspects of the theme and render system, however it can be hard to find them in one place.
Note this issue is not for dramatic re-architecture of the theme system, that's in #2702061: Unify & simplify render & theme system: component-based rendering (enables pattern library, style guides, interface previews, client-side re-rendering) and #3230518: Figure out how we want to incorporate web components in Drupal 10 and #1804488: [meta] Introduce a Theme Component Library and some other issues.
However, if we can clean-up the current theme system in core, reducing the number of templates, gutting preprocess hooks, potentially deprecating some things, it's less mess to replace with a new one. Some of the below issues may end up being soft or hard blockers for wider refactorings.
Steps to reproduce
Proposed resolution
Remaining tasks
Reduce the number of theme hooks: #1804614: [meta] Consolidate similar twig templates and properly use theme suggestions in core.
Get rid of per-entity theme hooks and templates: #3026221: Unify entity add list theme functions and templates
Render entity fields consistently: #2010930: [META] Apply formatters and widgets to rendered entity base fields (all besides node.title) and #2353867: [META] Expose Title and other base fields in Manage Display
Use 'component types' instead of hardcoding fields vs. extra field vs. field groups in entity displays #1875974: Abstract 'component type' specific code out of EntityDisplay
Stop doing evil things in preprocess #2528314: template_preprocess_node() does not add cacheability metadata
Stop doing lots of other things in preprocess #2649530: Replace template_preprocess() and possibly other things with Twig global variables/functions
Comments