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.

Proposed resolution

Remaining tasks

User interface changes

API changes

Comments

davidhernandez’s picture

You'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?

dawehner’s picture

We 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.

davidhernandez’s picture

Issue tags: +Twig
Fabianx’s picture

So 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.

davidhernandez’s picture

Yeah, a field (singular) specific template override is a pretty significant use case.

Cottser’s picture

Talking 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.

joelpittet’s picture

Yes I love modifying views-view-fields or views-view-field templates. 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.

joelpittet’s picture

@Cottser #6 thanks, after thinking that through a bit further, not all view fields are entity fields... sorry, my bad.

dawehner’s picture

Talking 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.

Note: 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.

Cottser’s picture

Status: Active » Closed (won't fix)
Related issues: +#2575081: [policy, no patch] Use E_USER_DEPRECATED in Drupal 8 minor releases

There are no theme functions in core anymore, so closing.