Conversation
b66bbe3 to
0c679a8
Compare
|
This sounds awesome. I'd love to carve out more bits of the app that can be implemented easily as plugins.
That sounds correct. I think we'll need to expose global JS objects/functions with well-defined interfaces that frontend plugins can use. It might not be a bad idea to have a similar set of documented APIs on the backend that guarantees your plugin won't conflict with other plugins. Maybe have some versioning scheme too to make sure plugins are compatible with your Metabase version? As far as loading the code, we could either have a predefined path to a JS file in the plugin jar that automatically gets loaded, or something in the manifest that points to it. I think we'll also eventually want a way to have a static directory of additional resources like images (again either a predefined path or something in the manifest file). We could either dynamically inject script tags in the I think we can use Webpack's "externals" feature to make sure plugins use Metabase's copies of libraries like React, or even to expose internal "libraries" or plugin APIs as normal in Metabase, then in the plugin's webpack config do: Then the plugin code would look just like non-plugin code: |
7be0993 to
50b04c0
Compare
[ci drivers]
50b04c0 to
542f462
Compare
Ok here it is.
The basic ideas are:
modulessubdirectory../bin/build-driver.shdoes all of this for youmodulesdirectoryresourcesdirectory if running withlein) into your plugins directory-cpargument when using Java 9+, just stick everything inpluginsmetabase-plugin.yaml, which tells Metabase how to initialize the plugin. See the SQLite one for an exampleFuture Steps 🚀
While working on this I was thinking a lot about how this could do more than just save a lot of memory usage. All of the following are now real possibilities:
A Metabase plugins store
Plugins admin page
Shipping more of Metabase as separate modules
Open Questions
<script>tag toindex.htmlresponses? We'd probably need to expose some interfaces for doing stuff since you wouldn't be able to resolve stuff at runtime and just do whatever you wanted the way you could with Clojure because things would be minified/etc? @tlrobinson thoughts?