mirror of
https://github.com/grafana/grafana.git
synced 2025-01-07 22:53:56 -06:00
be71277d33
* Plugins: fix loading of modules which resolve to Promises Prior to this commit we expected the default export of a plugin module to be an object with a `plugin` field. This is the case for the vast majority of plugins, but if a plugin uses webpack's `asyncWebAssembly` feature then the default export will actually be a promise which resolves to such an object. This commit checks the result of the SystemJS import to make sure it has a `plugin` field. If not, and if the `default` field looks like a Promise, it recursively attempts to resolve the Promise until the object looks like a plugin. I think this may have broken with the SystemJS upgrade (#70068) because it used to work without this change in Grafana 10.1, but it's difficult to say for sure. * Use Promise.resolve instead of await to clean up some logic * Override systemJSPrototype.import instead of handling defaults inside importPluginModule * Add comment to explain why we're overriding systemJS' import Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com> --------- Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com> |
||
---|---|---|
.. | ||
app | ||
dashboards | ||
emails | ||
fonts | ||
gazetteer | ||
img | ||
lib | ||
locales | ||
maps | ||
sass | ||
test | ||
vendor | ||
views | ||
api-enterprise-spec.json | ||
api-merged.json | ||
openapi3.json | ||
robots.txt |