The Role of Features in Drupal 8

Sara Olson, Marketing Analyst
#DrupalCon | Posted

Over the past few months, I've been spreading the word about the Features module in Drupal 8, which became available in April. If you missed my talks at DrupalCon LA, NYC Camp, or Drupal GovCon, you have another chance to learn about how Features works in Drupal 8. On July 29, I joined Brian Lewis of the Modules Unraveled podcast to discuss the role of Features in Drupal 8. Listen to the recording here.

38ccadd58be490abd2741a62fe9d7851b1b460ca

Below you’ll find some of the topics we’ll cover in the podcast.
Features vs. CMI in Drupal 8

Many people might be wondering why Features is even necessary, given the Configuration Management Initiative (CMI) built into Drupal 8 core. CMI cleanly and consistently separates “content” (articles, blogs, etc) from “configuration” (views, content types, fields, etc). CMI also provides mechanisms for deploying configuration between sites, including development, test, and production environments.

Drupal 7 didn’t have CMI, and because the Features module could export and import configuration data as code modules, Features was often used for configuration management and deployment. But Features wasn’t designed to be a full configuration management system. Features was initially written to “bundle reusable functionality.” In Drupal 8, the module is able to return to this original purpose, allowing you to pick and choose what configuration data you want to add to your custom module in a simplified process.

Features is Awesome for Developers

For developers, Features provides functionality to help with the many challenges of configuration that existed in earlier version of Drupal. When the Features module is active, it allows you to enable a module that contains configuration already on your site. Once a module is enabled, Features allows you to Import changes from that module into your site without needing to first uninstall the module. This prevents the situation of having a module that cannot be re-enabled, or a module that cannot be uninstalled because of dependencies and makes it much easier to update the configuration stored in the module during development.

In Drupal 8, you only need to install the Features module in your development environment. Once you have updated your feature module and imported the configuration changes into your dev environment, you then use normal Drupal 8 CMI to deploy configuration to staging and production. If you still want to keep the Features module enabled on staging or production for doing config imports, you can disable the Features UI submodule and only use the drush interface. The goal was the remove the dependency on the Features module. When you create a module using Features D8, the module will work on any other D8 site even without Features being installed!

Why I’m Excited for Drupal 8

I’m actually amazed by the amount of work that has gone into Drupal 8 to make it look and feel like Drupal (Views, Content Types, etc) and yet have a completely different architecture based on Symfony. There are several new concepts - services and routing and plugins - which made getting the hang of Drupal 8 a challenge. But ultimately, working on Features for Drupal 8 was an incredibly rewarding experience.

I challenge developers to give Drupal 8 a spin. If you want to help, go to the Features project page on drupal.org and download the latest 3.x version and start playing with it. Post your bugs and suggestions to the issue queue. We could really use some help writing automated tests in order to release a Beta version.

And, of course, get started by listening to the Modules Unraveled podcast on Features!

 

Sara Olson

Marketing Analyst