suddjian opened a new pull request #10288: URL: https://github.com/apache/incubator-superset/pull/10288
### SUMMARY <!--- Describe the change below, including rationale and design decisions --> Work-in-progress to add functionality to import plugins dynamically. A corresponding plugin can be found here: https://github.com/apache-superset/dynamic-import-demo-plugin Goals: - Make it possible to create plugins without changing code in other repos - Allow users of Superset to add new chart types without backend access - Allow plugin authors to use whatever languages and code styles they prefer - Open the door to developing a future “app store” so that plugins can be conveniently searched and installed at the press of a button How it works: - Plugin author starts with the template repo with a structure similar to existing plugins. Builds a bundle using Webpack. - Shared packages (react, lodash, @superset-ui) are externals provided superset-side and are referenced as externals. - Bundle is hosted somewhere on the web - CDN, github etc. The plugin has `serve` command to help with local development. - Use the new Custom Plugin UI in Superset (under the "Manage" menu) to add the plugin to Superset. Various hacks were necessary to build a PoC, but I believe they can all be solved with some kind of arcane webpack incantation: - Assigning modules to namespaced global objects to support a plugin's external dependencies instead of an actual dependency management system - Can’t async import from inside the plugin - Images/other assets. How do we load them if we don't know where the plugin is going to be hosted? Currently using url-loader with limit: Infinity, which works but is kinda sad. - I'm still tracking down all the places in Superset that need to change to respect async import of plugins. I'd greatly appreciate any help addressing these issues, or any feedback on the code that anyone has! ### TEST PLAN <!--- What steps should be taken to verify the changes --> ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Changes UI - [ ] Requires DB Migration. - [ ] Confirm DB Migration upgrade and downgrade tested. - [ ] Introduces new feature or API - [ ] Removes existing feature or API ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
