Drupal 8.5 versus Drupal 8.4

Submitted by peter on Tue, 01/02/2018 - 06:43

This comparison is based on Drupal 8.4.3 and Drupal 8.5 development from January 2, 2018. Drupal 8.5 should be close to feature complete and suitable for this comparison. Most of the changes are for testing, not for end user use.

The Media code should improve. Most of the media code is in place and needs adjustment, not new code.

Required for both

Both versions of Drupal require a minimum of PHP 5.5.9. PHP 5.6 was released a long time ago so you should be on PHP 5.6, not 5.5. There is no reason to use anything less than PHP 7 and PHP 7.1 is already out everywhere.

Introduced in 8.5

There is more complicated error handling to allow for special processing of deprecated messages in test sites. Be sure to set your site to test to get deprecated messages or production to ignore those messages.

Errors are added to headers for use by testing software. Make sure you eliminate errors before moving the site to production. You do not want anything sensitive revealed in a header.

Function setDefaultDateTime() will set dateTimeObject to noon as a "reasonable" default for datetime objects created without a time.

Where Drupal 8.4 used while() to process each element in an array, there is a move to foreach(). This is using the transverseable attribute of some objects.

Ajax has an OpenOffCanvasDialogCommand. This was used in one module and is now moved up to Drupal core for use everywhere.

The Http module gets an Exception component. There is a new messenger module. The Render modules gets a Container element. Template gets a TwigNode component.

Layout Builder is an experimental new module. The prerequisites are Layout Discovery and Contextual. This is the main move towards better publishing of custom content with the layout performed by the editor, not the developer.

Behat is introduced for people who use Behat in testing, Coder is added despite the fact that most Drupal sites are not used for development. Goutte adds screen scraping in tests. GastonJS for more test automation via PhantomJS. Mink PhantomJS driver helps GastonJS. vfsStream pretends you have a test file system.

You also get Reflection Docblock, Prophesy for more testing features, PHP Code Coverage, PHP file iterator, PHP text template, PHP Timer, PHP Token Stream, PHPunit, PHP Mock Objects, Comparitor, Diff, Environment, Exporter, Global state, Recursion context, Version, PHP code sniffer, Browser kit, CSS selector, DOM Crawler, and PHP unit Bridge.

Doctrine is expanded with Instantiator.

The PSR-4 autoloader has to work through a longer slower list of libraries due to all the module additions.

Drupal 8.5 schema adds a timestamp field type.

Changed

The mimeHeaderEncode() function now accepts a second parameter to return a shorter result.

The migration code in each module is renamed from migration_templates to migration.

There are more tests in many modules.

Replaced

Function drupal_realpath() is replaced by \Drupal::service('file_system')->realpath(). You can see why parts of Drupal 8 are slower.

The assert() function changes from accepting a string to accepting a true/false.

Removed (stage one)

In Drupal, the first stage of removing something is to "deprecate" it. Several things are deprecated and will be removed in Drupal 9.

The functions drupal_get_message() and drupal_set_message() are deprecated.

Removed

Drupal 8.5 removes Views Bulk operations.

Drupal 8.6

Drupal 8.5 was supposed to deliver all the media enhancements developed in the Lightning distribution. Some changes are deferred until Drupal 8.6.

Conclusion

There is a mass of bloat in Drupal that should be removed for common use as it is used only in testing. Drupal needs three downloads, a minimal download to produce the Drupal you get when you install Drupal using the minimal profile, a Drupal standard for people who want everything for normal use, and a Drupal Development Environment to include all the testware bloat.

Drupal 8.5 improves media handling but you really need 8.6 for complete media handling.