mrjmd / pdb

Decoupled Blocks is a Drupal 8 module to simplify integrating javascript frameworks into your site.
https://www.drupal.org/sandbox/mrjmd/2664138
57 stars 14 forks source link

Embrace OOP instead of events #29

Closed phenaproxima closed 8 years ago

phenaproxima commented 8 years ago

This PR pretty much re-architects the API.

All component blocks are now built on an abstract PdbBlock class, which implements the new FrameworkAwareBlockInterface. This interface defines methods that subclasses use for attaching their settings and assets to the page. This has a lot of benefits, chiefly that it obviates the need for events, and that different framework integrations can implement wildly different logic for building their blocks.

I have integrated the Angular 2 implementation with this new system, and left the React module alone.