Introducing a simple support module for Drupal 8 that sets up the Web Bus II client side component manager. Dependent modules include implementation JavaScript using the conventional Drupal mechanism and a hook to inform the WebBus manager of available components.
WebBus provides an event based system composition methodology similar to “hooks” within the Drupal back-end for constructing rich single page applications in the browser. Combined with custom Blocks, Paragraphs and other modular content subsystems WebBus provides a powerful composition tool for non programmers to use and combine sophisticated front end components.
Registering a WebBus component factory
hook_webbus_register_component_factories() Return an array of arrays where the first element is the name of the component factory and the second the name of the JavaScript function being registered. The implementations are in global functions in external JavaScript files to allow Drupal’s conventional performance features and caching to work optimally.
The WebBus package includes the Kernel and an example module demonstrating Blocks as WebBus components.
Example Block configuration:
Example:
The WebBus Kernel and Example available from https://bitbucket.org/jhickmanarc/webbus2_drupal