diff --git a/core/core.services.yml b/core/core.services.yml
index 40c6a8a..96ec3ee 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -499,7 +499,7 @@ services:
     class: Drupal\Core\Extension\ModuleInstaller
     tags:
       - { name: service_collector, tag: 'module_install.uninstall_validator', call: addUninstallValidator }
-    arguments: ['@app.root', '@module_handler', '@kernel', '@router.builder']
+    arguments: ['@app.root', '@module_handler', '@kernel', '@event_dispatcher']
     lazy: true
   content_uninstall_validator:
     class: Drupal\Core\Entity\ContentUninstallValidator
@@ -579,6 +579,11 @@ services:
   field_definition.listener:
     class: Drupal\Core\Field\FieldDefinitionListener
     arguments: ['@entity_type.manager', '@entity_field.manager', '@keyvalue', '@cache.discovery']
+  entity.module_install.subscriber:
+    class: \Drupal\Core\EventSubscriber\ModuleInstallerEntitySubscriber
+    arguments: ['@kernel']
+    tags:
+      - { name: event_subscriber }
   entity.form_builder:
     class: Drupal\Core\Entity\EntityFormBuilder
     arguments: ['@entity.manager', '@form_builder']
diff --git a/core/lib/Drupal/Core/Extension/ModuleInstaller.php b/core/lib/Drupal/Core/Extension/ModuleInstaller.php
index c3dbcc8..c58b1be 100644
--- a/core/lib/Drupal/Core/Extension/ModuleInstaller.php
+++ b/core/lib/Drupal/Core/Extension/ModuleInstaller.php
@@ -8,6 +8,7 @@
 use Drupal\Core\Entity\EntityStorageException;
 use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\Serialization\Yaml;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 /**
  * Default implementation of the module installer.
@@ -46,6 +47,13 @@ class ModuleInstaller implements ModuleInstallerInterface {
   protected $uninstallValidators;
 
   /**
+   * The event dispatcher.
+   *
+   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
+   */
+  protected $eventDispatcher;
+
+  /**
    * Constructs a new ModuleInstaller instance.
    *
    * @param string $root
@@ -54,14 +62,17 @@ class ModuleInstaller implements ModuleInstallerInterface {
    *   The module handler.
    * @param \Drupal\Core\DrupalKernelInterface $kernel
    *   The drupal kernel.
+   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $event_dispatcher
+   *   The event dispatcher.
    *
    * @see \Drupal\Core\DrupalKernel
    * @see \Drupal\Core\CoreServiceProvider
    */
-  public function __construct($root, ModuleHandlerInterface $module_handler, DrupalKernelInterface $kernel) {
+  public function __construct($root, ModuleHandlerInterface $module_handler, DrupalKernelInterface $kernel, EventDispatcherInterface $event_dispatcher) {
     $this->root = $root;
     $this->moduleHandler = $module_handler;
     $this->kernel = $kernel;
+    $this->eventDispatcher = $event_dispatcher;
   }
 
   /**
@@ -207,36 +218,8 @@ public function install(array $module_list, $enable_dependencies = TRUE) {
           $version = max(max($versions), $version);
         }
 
-        // Notify interested components that this module's entity types and
-        // field storage definitions are new. For example, a SQL-based storage
-        // handler can use this as an opportunity to create the necessary
-        // database tables.
-        // @todo Clean this up in https://www.drupal.org/node/2350111.
-        $entity_manager = \Drupal::entityManager();
-        $update_manager = \Drupal::entityDefinitionUpdateManager();
-        foreach ($entity_manager->getDefinitions() as $entity_type) {
-          if ($entity_type->getProvider() == $module) {
-            $update_manager->installEntityType($entity_type);
-          }
-          elseif ($entity_type->entityClassImplements(FieldableEntityInterface::CLASS)) {
-            // The module being installed may be adding new fields to existing
-            // entity types. Field definitions for any entity type defined by
-            // the module are handled in the if branch.
-            foreach ($entity_manager->getFieldStorageDefinitions($entity_type->id()) as $storage_definition) {
-              if ($storage_definition->getProvider() == $module) {
-                // If the module being installed is also defining a storage key
-                // for the entity type, the entity schema may not exist yet. It
-                // will be created later in that case.
-                try {
-                  $update_manager->installFieldStorageDefinition($storage_definition->getName(), $entity_type->id(), $module, $storage_definition);
-                }
-                catch (EntityStorageException $e) {
-                  watchdog_exception('system', $e, 'An error occurred while notifying the creation of the @name field storage definition: "!message" in %function (line %line of %file).', ['@name' => $storage_definition->getName()]);
-                }
-              }
-            }
-          }
-        }
+        $event = new ModuleEvent($module);
+        $this->eventDispatcher->dispatch(ModuleEvents::MODULE_INSTALLED, $event);
 
         // Install default configuration of the module.
         $config_installer = \Drupal::service('config.installer');
@@ -394,31 +377,8 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
       \Drupal::getContainer()->set('router.route_provider.old', \Drupal::service('router.route_provider'));
       \Drupal::getContainer()->set('router.route_provider', \Drupal::service('router.route_provider.lazy_builder'));
 
-      // Notify interested components that this module's entity types are being
-      // deleted. For example, a SQL-based storage handler can use this as an
-      // opportunity to drop the corresponding database tables.
-      // @todo Clean this up in https://www.drupal.org/node/2350111.
-      $update_manager = \Drupal::entityDefinitionUpdateManager();
-      foreach ($entity_manager->getDefinitions() as $entity_type) {
-        if ($entity_type->getProvider() == $module) {
-          $update_manager->uninstallEntityType($entity_type);
-        }
-        elseif ($entity_type->entityClassImplements(FieldableEntityInterface::CLASS)) {
-          // The module being installed may be adding new fields to existing
-          // entity types. Field definitions for any entity type defined by
-          // the module are handled in the if branch.
-          $entity_type_id = $entity_type->id();
-          /** @var \Drupal\Core\Entity\FieldableEntityStorageInterface $storage */
-          $storage = $entity_manager->getStorage($entity_type_id);
-          foreach ($entity_manager->getFieldStorageDefinitions($entity_type_id) as $storage_definition) {
-            // @todo We need to trigger field purging here.
-            //   See https://www.drupal.org/node/2282119.
-            if ($storage_definition->getProvider() == $module && !$storage->countFieldData($storage_definition, TRUE)) {
-              $update_manager->uninstallFieldStorageDefinition($storage_definition);
-            }
-          }
-        }
-      }
+      $event = new ModuleEvent($module);
+      $this->eventDispatcher->dispatch(ModuleEvents::MODULE_UNINSTALLED, $event);
 
       // Remove the schema.
       drupal_uninstall_schema($module);
@@ -542,6 +502,7 @@ protected function updateKernel($module_filenames) {
     // dependencies.
     $container = $this->kernel->getContainer();
     $this->moduleHandler = $container->get('module_handler');
+    $this->eventDispatcher = $container->get('event_dispatcher');
   }
 
   /**
