How do I append a view to the node body in custom module? In Drupal 7, we could do the following within a hook_node_view: 

$node-&gt;content['nodehierarchy_children'] = array(
  '#theme' =&gt; 'nodehierarchy_children_embed',
  '#nodehierarchy_view' =&gt; $node-&gt;nh_children_view,
  '#nodehierarchy_view_display' =&gt; @$node-&gt;nh_children_view_display,
  '#nodehierarchy_view_args' =&gt; $arguments,
);


Then in the hook_theme:

function nodehierarchy_views_theme() {
  return array(
    'nodehierarchy_children_embed' =&gt; array(
      'render element' =&gt; 'element',
    ),
  );
}


Finally we have the theme function: 

function theme_nodehierarchy_children_embed($variables) {
  $element = $variables['element'];
  $display = $element['#nodehierarchy_view_display'];
  $arguments = $element['#nodehierarchy_view_args'];
  return $view-&gt;execute_display($display, $arguments);
}


How do I accomplish the above in Drupal 8? I'd like the implementation to be Drupal 9 compatible, so ideally I don't want to use depreciated functions etc.

I mean should I attempt to somehow override node.html.twig and provide it with a render array using something similar to: 

$view = views::getView($node-&gt;nh_children_view)
$build['nodehierarchy_children_embed'] = $view-&gt;buildRenderable($display,$arguments);


I think if someone could provide the functions and general methodology, I could fill in the coding portion.
So it turns out that the hook_node_view was all that was needed, but I don't know why it didn't work the first time:

/**
 * Implements hook_ENTITY_TYPE_view().
 */
function mymodule_node_view(array &amp;$build, EntityInterface $node, EntityViewDisplayInterface $display, $view_mode){
  // Get the arguments to send to the view. 
  $arguments = ...;
  if ($view = Views::getView('my_view')) {
    $display = ...
    $build['some_name'] = $view-&gt;buildRenderable($display,$arguments);
    $body = $node-&gt;get('body')-&gt;value;
    $node-&gt;set('body')-&gt;value = $body.render($build['some_name']);
  }
}