Change record status: 
Project: 
Introduced in branch: 
8.x
Description: 

In Drupal 7, the field_view_field() and field_view_value() functions could be used to generate one-off field output, either in a given view mode or through an arbitrary formatter, for example when outside of a broader (but much more performant) "entity view".
- field_view_field() returned the render array for a fully themed field within an entity (including the field label and the output of the formatter on all of the multiple field items).
- field_view_value() returned the output of a formatter for a single field item (a specific delta within the list of multiple items)

In Drupal 8, those functions have been replaced by view() methods on, respectively, the FieldItemList object (i.e $entity->field_name, "the list of field items") and the FieldItem object (i.e. $entity->field_name[$delta], a specific item in the list). Their signatures have also been largely simplified.

Just like in Drupal 7, those one-off methods have a non-negligible overhead, and it is strongly recommended for performance to favor entity_view() / entity_view_multiple() when displaying entities as a whole.

Code samples

Fully themed field, with label and multiple values:

Drupal 7:

$output = field_view_field('node', $node, 'field_foo', $view_mode, $langcode);
$output = field_view_field('node', $node, 'field_foo', array('type' => 'some_formatter', 'settings' => array(...), $langcode));

Drupal 8:

$output = $node->field_foo->view($view_mode);
$output = $node->field_foo->view(array('type' => 'some_formatter', 'settings' => array(...)));

Single formatted field item:

Drupal 7:

$item = $node->field_foo[$langcode][0];
$output = field_view_value('node', $node, 'field_foo', $item, $view_mode, $langcode);
$output = field_view_value('node', $node, 'field_foo', $item, array('type' => 'some_formatter', 'settings' => array(...), $langcode));

Drupal 8:

$output = $node->field_foo[0]->view('full');
$output = $node->field_foo[0]->view(array('type' => 'some_formatter', 'settings' => array(...)));
Impacts: 
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: 
Other updates done