Lightning versus Drupal

Lightning is a distribution of Drupal with modules and configuration added for publishers. While not as powerful as the competing Thunder distribution of Drupal, Lightning has useful additions, some of which are now in Drupal. Does Lightning continue to be more useful than Drupal?

This comparison is based on Drupal 8.5.3 and the Lightning released at the same time.

Drupal has a vendor directory inside the public Web directory while Lightning has the vendor directory outside the Web directory. Outside the Web directory is better and it creates problems for people using cheap shared hosting because they do not have access to anything outside the public Web directory.

Drupal should offer an install option or instructions to move the vendor directory and some other directories outside of the Web directory.

when you run a straight comparison of Drupal and Lightning, you first have to move the Lightning vendor directory into the directory that Lightning calls docroot. You then find Lighting modifications scattered all over the place.

There is a Drupal distribution named Thunder that competes against Lightning. Thunder adds more to Drupal, compared to Lightning, but keeps all the changes clean compared to Lightning. Lightning needs a big cleanup to Thunder standards.

The Drupal download also adds to the mess. The Drupal 8.5.3 download file is generated by a Drush command. Drush adds Drush junk to many of the files, making a file by file comparison slow because there are so many false mismatches. Drupal should go back to generating clean download files.

Drupal 8.5.3 adds one module

Drupal contains only one module that is not in Lightning, a module named composer-merge-plugin from Wikimedia. The module is described as "Composer plugin to merge multiple composer.json files". I do not know why you would want that because Composer should be able to include the other files, with no need for a merge.

Lightning adds many modules

Lighting adds code in the core, libraries, modules, profiles, and vendor directories.

Core

There is a directory core/b with additions that should be in libraries or modules. They alter Entity and Media functionality. From what I can see, the code modifications are made obsolete by Drupal 8.5.3 and should be removed.

Libraries

Lightning adds libraries for Cropper and Dropzone. Cropper is JavaScript to crop images and Dropzone is JavaSscript to handle part of a drag and drop content upload.

There were modules back at the start of Drupal 7 to provide both functions. what I do not understand is why those modules were not moved into the early development of Drupal 8 as part of the Drupal media initiative.

The Lightning development process appears to be oriented to reinventing everything. I have not found documentation of the decision making process.

The Lightning current mess is probably caused by the incredibly slow messy development of Drupal 8. The Lightning developers had to supply code missing from Drupal 8 then Drupal 8 caught up with Lightning and the Lightning developers now have to unpick all their special code.

The problem is made worse by the Drupal 8 developers leaving small holes in their code, small bits missing. The Lightning developers are unlikely to be able to fill the small holes with small bits of code. Given the way the underlying Symfony framework works, you often have to replace a huge chunk of code to fill in a small hole.

Modules

Lightning adds modules named acquia_connector, consumers, contact_storage, crop, ctools, devel, diff, dropzonejs, embed, entity_block, entity_browser, entity_embed, image_widget_crop, inline_entity_form, jsonapi, lightning_api, lightning_core, lightning_dev, lightning_layout, lightning_media, lightning_workflow, media_entity_generic, media_entity_instagram, media_entity_twitter, metatag, openapi, panelizer, panels, pathauto, schemata, search_api, simple_oauth, token, video_embed_field, and views_infinite_scroll.

Some modules are obvious. Crop loads the Cropper library. Image widget crop adds the crop code to images.

Entity browser is left over from earlier Drupal 8 versions before Drupal started developing entity and media browsers. Unfortunately the Drupal media browser is pushed back to Drupal 8.6 and might not deliver a full replacement for the Lightning equivalent.

In Drupal 8, simple modules are often spit up into many tiny modules with each doing just one thing. You then have to connect the maze of bits together in some overall module.

The hope is that the tiny bits can then be reused. This is the opposite of all previous Drupal development where a module arrived complete and components were unpicked only when another module wanted the same functionality.

Lightning uses Panels and Panelizer for Layout. Thunder does something different. Drupal developers are talking about adopting the Thunder approach for Drupal. Reversing out Panelizer is difficult.

Profiles

There is a lightning profile containing 435 items. The automation of the install process must be made more complicated by both the Lightning modifications to the profile process and the weird use of directories.

Vendor

The vendor directory contains the modules Alchemy Zippy, Behat and Gerkin and Mink, php-htmldiff, drupal-code-generator, container-interop, composer-patches, php-encryption, dot-access-*, php-xdg-base-dir, Drupal coder and console, Drupal scaffold, Drush, htmlpurifier, Goutte, Gramash expander and yaml-expander, php-webdriver, twitter-api-php, phantomjs-installer, php-console-*, jwt, and many,many more.

Behat, Devel, and others are used for testing changes to Lightning. I think Lighting would be more useful for most people if the testing elements were left out so the users could see what they actually need.

The future

Will Lightning work for you in the future? There are a few modules missing from Lightning that I would add for many publishing projects. After counting all the modules I would add to Lightning, there is not much difference between starting with Drupal 8.5 and starting with Lightning.

Image editing

Editors want image editing to help them reuse images across content and within content. Focal Point is a useful module supplied in Thunder and several other Drupal distributions but not in Lightning. Focal Point is one of the modules I would add to Lightning or Drupal 8.5.

Layout

Lightning uses Panels and Panelizer for Layout. The Drupal developers are going in a different direction. Something similar to Panelizer is id Drupal 8.5 under Layout Builder but is hidden. Layout Builder will appear in Drupal 8.6.

Reversing out Panelizer is painful. You might have to start planning now for the move to whatever Drupal provides, the current Layout Builder or a Layout Builder modified after feedback. The Lightning developers are talking about adding a conversion from Panelizer to Layout Builder but with no date for the change.

Panels and Panelizer do different overlapping things. When you mix both, the result can be confusing and very difficult to undo because it can be so hard to find out what is caused by each module. The new Drupal Layout Builder and Layout Library replace parts of both. The Drupal Layout system will not be official until Drupal 8.6 is released towards the end of 2018.

Some people like Panelizer while others prefer Panels. The new approach is often to use Panels with Paragraphs or just Paragraphs. You should look at Paragraphs and Layout Builder before using Panelizer.

The new Drupal layout approach will probably replace Panels but take longer than the move from Panelizer to Layout Builder. Paragraphs is already in Thunder and should be looked at for Drupal 8 or 9.

Media

Drupal 8.5 was supposed to have all the media features of Lightning. Media browser is now back to Drupal 8.6. Looking at the issues around media, I expect useful parts will be deferred to Drupal 8.7 or Drupal 9.

If you are starting a new Web site today, it is probably easier to make media work in Lightning compared to using Drupal 8.5 then adding in the media enhancements you will need for publishing. Upgrades to new releases of Lightning could be difficult because you could be locked into obsolete modules.

For my simple publishing use, I choose Drupal 8.5 with the addition of a media browser and Paragraphs. For a more complicated publishing project, I would look toward Thunder as a distribution closer to complete and with a potentially easier upgrade path.

Conclusion

Lightning is Drupal 8 extended for publishing. While Lightning would have been a big step forward compared to early releases of Drupal 8, the extensions are now a bit out of date and upgrades could be difficult. The Thunder distribution for publishers has more functionality and a more modern approach.

For new projects, I suggest building up from Drupal 8.5 or using Thunder with many of the complicated extras switched off until to actually need them.

Tags