Voting starts in March for the Drupal Association Board election.
The Drupal 8 Plugin system is largely in a state that it could be committed to core:however, there are some concerns that the plugin system may not be particularly obvious from a DX use case. Those of use who have developed the plugin system thus far feel quite the opposite, and so we have tried to put together a simple use case to demonstrate the use of plugins. We need some people who are willing to dig in here a bit and give some serious feedback. This issue is the first of two.
Within this issue we want feedback on building individual plugins.
Documentation of the plugins system can be found here: http://drupal.org/node/1637614 it is not complete, but should give a good idea of the innards of the system.
The plugin system can be checked out as a full Drupal 8 install by executing the following command:
git clone --recursive --branch plugins-next http://git.drupal.org/sandbox/eclipsegc/1441840.git drupal git checkout 3bc376e5a2f8f6a376560f48745ab6d95a5c2834
The plugins example module for this can be placed in sites/all/modules
git clone --recursive --branch info_hooks http://git.drupal.org/sandbox/eclipsegc/1663586.git msg_plugin
You will find 3 modules in this repository.
- msg_plugin: the base module which defines the plugin type, and a couple of plugins.
- msg_plugin_extras: a module that ONLY implements plugins (it has 2 plugins within it and the appropriate hook to inform the system about them)
- msg_plugin_custom: a module which implements a derivatives base plugin.
Looking at the msg_plugin_extras module should give a VERY good idea of what is actually required to write new plugins for this module. The plugins are intentionally simplistic. A simple "this makes sense" or "this doesn't make sense" is probably all we really need here. As many people giving feedback as possible would be nice. The task is simple, and there are serious questions on this topic right now, so PLEASE take some time to review this.
As a side note: the PSR-0 directory structure is needlessly complex. This is on purpose because the mechanism for discovering these plugins is currently a hook, but we would like to do this discovery via annotations on the plugin classes themselves, which would actually allow us to remove the hooks for the modules entirely. This directory structure is representative of the annotation based discovery. If you'd like to play with that solution as well, then you can look at these branches on the same repositories.
Drupal 8 with Plugins & Annotations:
git clone --recursive --branch plugins-annotations http://git.drupal.org/sandbox/eclipsegc/1441840.git drupal
Plugin Example Module with Annotated Plugins instead of Hooks:
git clone --recursive --branch 8.x-1.x http://git.drupal.org/sandbox/eclipsegc/1663586.git msg_plugin
We need feedback on plugin type building on this issue, if you'd like to give feedback on plugin building, please check