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

User interface changes

API changes

Data model changes

Release notes snippet

Comments

catch created an issue. See original summary.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.