RFC: Plugin load metadata
The DX / performance of loading plugin process, it requires to load metadata and then it creates a custom node, what if it will work more like this:
const ctx = new AudioContext();
const player = document.getElementById('soundSample');
const mediaSource = ctx.createMediaElementSource(player);
const pluginURL = "https://wasabi.i3s.unice.fr/WebAudioPluginBank/WASABI/PingPongDelay3";
// Fetch the plugin module (js module or commonjs/whatever)
const pluginModule = await fetch(pluginURL);
// Just create a plugin node (optionally it could take options after context) no need to know node
// class symbol, plugin is not aware of how it is loaded, but might have logic for additional resources // load, ex. WA
const pluginNode = new pluginModule.Node(ctx);
mediaSource.connect(node);
node.connect(ctx.destination);
When we designed the WAP standard, we had in mind the separation of dsp processing and GUI. HTML imports were the future in that time, that is the reason why we used a factory pattern with load and loadGui methods. Now html imports are dead, so we need to rethink the way plugins will be loaded. The idea of a factory is stilll there as plugins might themselves load other things (i.e sound samples) before being ready to be used. A factory might do this job for us, but your proposal is very attractive too. Let's discuss that for SDK V2 if you're interested...