dazinator / NetPack

.Net Core library, for runtime processing of static files such as typescript, js, css etc.
13 stars 2 forks source link

Plugin Pipeline #39

Open dazinator opened 5 years ago

dazinator commented 5 years ago

Create a pipeline that can:-

  1. Detect changes to plugin zip files (i.e use a glob pattern like /plugins/*.zip)
  2. Process them by:
    • Extract the ZIP contents to a shadow directory
    • Read the manifest to identify the plugin
    • Unloading the currently loaded ALC for the plugin (if for example a currently loaded plugin is being updated)
    • Load the plugin from the shadow directory into a new ALC.

This pipeline will take input glob to watch for plugins: e.g '/plugins/*.zip' This pipeline will allow an implementation of IPluginEvents to be passed, which will allow the caller to hook into following events:

  1. Plugin detected
  2. Plugin Extracted
  3. Plugin being unloaded
  4. Plugin unloaded
  5. Plugin being loaded
  6. Plugin loaded

These events will allow:

Caller could send notification events to update status of plugin installation. Caller could do some additional unloading / cleanup when a module is being unloaded (could perhaps support allowing the plugin itself to run some actions pre unload) Caller could take some actions immediately after new plugin is loaded. Caller can configure which module contents to expose as StaticFiles? and which to expose via Content IFileProvider.