Change record status: 
Introduced in branch: 

The template process layer and process functions (e.g. template_process_HOOK(), MODULE_process_HOOK(), THEME_process_HOOK()) have been removed. Any process functions need to be converted to preprocess functions.

In the Drupal 7 theme system, process functions were used to flatten variables into strings for printing (see template_process() from Drupal 7 for an example). With the shift towards using (more) render arrays and renderable objects (objects with __toString() methods), in Drupal 8 we can remove this additional layer of processing and complexity from the theme system in favour of "lazy rendering" as late as possible and only when necessary. The RenderWrapper class can also be used to late render function calls.

Render arrays and renderable objects can be manipulated throughout the preprocess phase without needing to worry about the variable already being turned into markup or a flattened string. The render array or renderable object can then be printed in a template file without first flattening it into a string. With the Twig template engine (the default template engine in Drupal 8), you simply print the variable in your template and the Twig engine determines whether it is a render array, renderable object, string etc. and renders it appropriately.

The following example prints an Attribute object with a __toString() method in a Twig template:

{{ attributes }}
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other updates done


This doc needs an update once preprocess is deprecated as well:
Introduce hook_theme_prepare[_alter]() and deprecate hook_preprocess_HOOK()

love, light n laughter