Problem/Motivation
In recent profiling for #1867518: Leverage entityDisplay to provide fast rendering for fields we see that executing a template is not for free. It would be interesting to see, whether
getting rid of views-view-field would have helped those usecases a bit.
@#drupal-twig How bad is dropping that template, given the assumption that you have all information as part of views-view-fields available for example.
Comments
Comment #1
davidhernandezYou're talking about defaulting this one to a theme function instead of a template, but people would still be able to override with a targeted template?
I quickly scanned the other issue. Is that last profiling what we are looking at? A 10% difference?
Comment #2
dawehnerWe would talk about not making that granularity of themability in the first place.
Regarding the advantage: Its hard to guess that as you always have a nested render array / theming callstack, but if you look at
https://blackfire.io/profiles/e15e4ea1-6545-4470-979d-fadf2328c597/graph...()&selected=Drupal%5CCore%5CTheme%5CThemeManager%3A%3Atheme&settings%5Bdimension%5D=wt&settings%5Bdisplay%5D=focused#call=Drupal\Core\Theme\ThemeManager::theme you see at least exclusive cost of 4% which could probably be reduce quite a bit.
Comment #3
davidhernandezComment #4
fabianx commentedSo views-view-field currently is a theme function for the default.
I _think_ themers like the possibility to add markup around certain fields or field types, especially using suggestions.
Comment #5
davidhernandezYeah, a field (singular) specific template override is a pretty significant use case.
Comment #6
star-szrTalking about this on the Twig call, if it would be possible to output the fields through the regular field.html.twig and provide suggestions like field__views__title (Edit: or even views__field__title) then this might be more acceptable.
Credit to @joelpittet for that thought.
Comment #7
joelpittetYes I love modifying
views-view-fieldsorviews-view-fieldtemplates. Having views and field context in the field is quite handy.I can't see how we can remove this practically. Fields in views are not always entity field, sometimes they are generated field.
Comment #8
joelpittet@Cottser #6 thanks, after thinking that through a bit further, not all view fields are entity fields... sorry, my bad.
Comment #9
dawehnerNote: This also won't work because we even opt out of that template by default ... people really liked in D7 that we don't use the field wrapper markup by default,
but rather just get the "raw" formatter output.
Comment #10
star-szrThere are no theme functions in core anymore, so closing.