#d8rules reaches milestone 2

The last 4 months, we have been busy getting the MVP for Rules in Drupal 8 ready. Thanks to the funding by Acquia, drunomics & epiqo - fago and klausi were able to dedicate 316 hours on implementing the most critical features to complete milestone 2 (of 3) for #d8rules.

So what has been done:

  • Completed the Rules engine features (Metadata assertions, logging service)

  • Completed Rules plugins (Events, Loops, components API)

  • Completed configuration management system support (config entity, CMI support, integrity checks)

  • Completed action & condition APIs and used the improvements for the generic Rules integration

  • Basically usable UI (Nothing fancy yet) - auto-completion functionality has been added right now (in dev only), to make it easier to use.

  • Added API for embedding the Rules UI, such that modules can re-use it (e.g. for Commerce to embed Rules conditions UI)

  • Token replacement support based on a new Typed-Data based token replacement API

We have released Rules 8.x Alpha 1 with all the above mentioned improvements as a first, experimental preview of the Rules module in Drupal 8.

There are many exciting things, one of them we’d like to highlight: We implemented a reusable token replacement API that covers all entities and fields via Typed Data. Some examples of valid tokens would be:

{{ node.field_integer.2.value | default('0') }}

{{ node.title.value | default('tEsT') | lower }}

The replacement API makes use of twig style replacements and is extensible via further filter plugins (like default, or lower). As the token replacement API is independent of Rules, we are working on moving it and other Typed Data API improvements to another location, such that those APIs are re-usable independently of Rules.

Documentation for contributing or developing with Rules can be found at http://docs.d8rules.org. It currently mostly covers the essentials: Providing actions, conditions and events.

Also, we worked on improving our config exports to avoid future changes as far as possible - however, we won’t don’t support updates for the created configurations until the first beta.

Next steps

Milestone 3 is all about getting a final release of Rules for Drupal 8 ready.

We are now working on the caching improvements and adding auto-completion support for data selection and will soon tag another alpha release with those features included.

Besides that, we’ll work on stabilizing the Rules features and extend the UI capabilities to include features like loops or Typed Data widgets and formatters.

Today is a good day to go and dive into Rules for Drupal 8 for any developer. Our code base is full of Drupal 8 best practices, leverages plug-ins for Actions, Conditions, integrates with Symfony events and the Drupal 8 core context API. You will also find plenty of Unit and Integration tests - check out our roadmap that also lists entry points for new contributors.

Of course, progress we’ll be slower now as we are now out of the sponsored hours again. We are looking for a remaining amount of € 13.500 to complete milestone 3 and deliver a stable release of Rules for Drupal 8. If you’re an agency or a client wanting to use Rules in Drupal 8, we’d appreciate your support to speed up completing the module. Just drop me a mail or get in touch using our sponsor form.