RolandJansen / intermix

Typescript/Javascript framework for building sequencer-based audio apps
GNU Lesser General Public License v3.0
6 stars 0 forks source link

Extend API to add/remove unknown plugins #117

Closed RolandJansen closed 4 years ago

RolandJansen commented 4 years ago

Followup to #116

RolandJansen commented 4 years ago

This is tricky (at this point of development).

  1. We need to setup a project with a reference to intermix >=0.5
  2. Intermix 0.5 has not been released and the API isn't stable
  3. We could use a manual build of intermix but since the API is still changing, this can get really painful

So this is something that should be done right after the release of 0.5.

RolandJansen commented 4 years ago

There are two new API function

Plugins are simply ES2015 modules that can be dynamically loaded into the browser like this:

import * as intermix from "<path-to-file>";  // just to clarify where the "intermix" object comes from
[...]
import("<url>").then((PluginModule) => {
    intermix.addPluginClass(PluginModule.default);
}

or even simpler

const PluginModule = await import("<url>");
intermix.addPluginClass(PluginModule.default);

see d592c1cde990d7591a4ca9168a1c10fb8995dbe5