Change record status: 
Project: 
Introduced in branch: 
8.0.x
Introduced in version: 
8.0.0-beta6
Description: 

A new way of internally referencing Twig templates (a Twig loader) has been added based on the Drupal theme registry. These template references are most commonly used when extending or including within a Twig template.

Before

Previously there were two ways of referencing a Twig template:

Namespace (based on module or theme name):

{% extends "@block/block.html.twig" %}

Full path (from the Drupal root):

{% extends "core/modules/block/templates/block.html.twig" %}

After

The two methods above are still available, and a theme registry loader is now available (added as a lower priority Twig loader):

{% extends "block.html.twig" %}

The theme registry loader checks the registry for the active block.html.twig template and will return that template, whether it be from your active theme, base theme, or a module. This makes overriding templates and changing your mind later more predictable.

The same method works for includes:

{% include "block.html.twig" %}

The theme registry loader was added as a tagged service.

Impacts: 
Module developers
Themers