Giter VIP home page Giter VIP logo

plugins's Issues

Refactor \EclipseGc\Plugin\Traits\PluginDiscoveryTrait::$keyedDefinitions to JUST $definitions on the trait

Currently \EclipseGc\Plugin\Traits\PluginDiscoveryTrait::$keyedDefinitions exists and probably should not. Rather this should be refactored out in favor of just a $definitions property on the trait. Currently one is keyed by plugin id and the other by simple numeric array keys.

This could end up touching on the \Iterator implementation of PluginDiscoveryInterface in favor of something like Symfony's "Bag" classes instead of a native array in the Discovery object and making discovery iterate-able.

Commit to a particular plugin instantiation approach

In Drupal 8, we provided a pluggable factory solution for plugins. This was good in theory, but in practice, too often, a plugin had to be aware of its own needs from a dependency injection perspective. This meant a lot of static factory methods on plugins with hard-coded dependencies on services in a container. This is impossible to override without subclassing the entire plugin which isn't particularly usable or desirable.

Instead of committing to a factory that must work for ALL plugins of a particular type, I propose the new PluginDefinitionInterface be expanded to include documentation of __construct() requirements. This passes the "buck" to PluginDefinitionInterface when it's instantiated to include the appropriate things like a service container (when necessary), but I find that preferable to forcing that knowledge onto the plugin classes themselves.

Introduce configurable plugins

Configurable plugins should be part of the basic offering of Plugins. In Drupal 8 we did this via arrays for configuration, but this means that the plugin was in charge of things like validating configuration, serializing itself for storage, etc, etc.

We should write this such that a given plugin expects a given configuration object (which extends a common interface). This configuration object should be capable of validating its values and serializing its values.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.