drab icon indicating copy to clipboard operation
drab copied to clipboard

Extract non-default modules to external libraries

Open grych opened this issue 7 years ago • 3 comments

  • Drab.Query
  • Drab.Modal

Plus: write a guide on how to extend Drab.

This must be done before 1.0, as it is a significant API change.

grych avatar May 09 '18 20:05 grych

Rename DrabModule behaviour to Drab.Plugin

grych avatar May 11 '18 17:05 grych

Extract all modules, including Drab.Live and Drab.Element, to the external libraries, but add them in the dependency, and as a default plugins.

New API:

  1. To include the plugin, add it to mix deps and to config as something like
config :drab, plugins: [Drab.Query, Drab.Live] ## Drab.Live and Drab.Element by default
  1. Plugins from config will be default to commander, when use Drab.Commander. You may still override it with use Drab.Commander, modules: [...] for the specific Commander

Note: why? It is because most of the Drab.Plugin modules (formerly DrabModule) are injecting some JS. This is for keeping page as small as it is possible

grych avatar May 11 '18 17:05 grych

Moved this to the future 2.0.0, as it is not so urgent.

grych avatar Jun 20 '18 12:06 grych