// need individual field markup to support proper theming, we build
// a raw render array containing all field render arrays and cache it.
// This allows us to cache the markup of the various children, that is
// individual fields, which is then available for style template
// preprocess functions, later in the rendering workflow.
// @todo Fetch all the available cached row items in one single cache
// get operation, once https://www.drupal.org/node/2453945 is fixed.
$data =
[ '#pre_render' =>
[[$this, 'elementPreRenderRow'
]],
'#row' =>
$row,
'#cache' =>
[ 'keys' =>
$cache_plugin->
getRowCacheKeys($row),
'tags' =>
$cache_plugin->
getRowCacheTags($row),
'max-age' =>
$max_age,
],
'#cache_properties' =>
$field_ids,
];
$renderer->
addCacheableDependency($data,
$this->view->storage
);
// Views may be rendered both inside and outside a render context:
// - HTML views are rendered inside a render context: then we want to
// use ::render(), so that attachments and cacheability are bubbled.
// - non-HTML views are rendered outside a render context: then we
// want to use ::renderPlain(), so that no bubbling happens