bbovenzi commented on code in PR #75083:
URL: https://github.com/apache/airflow/pull/75083#discussion_r4469221858
##########
airflow-core/src/airflow/ui/src/pages/ReactPlugin.tsx:
##########
@@ -54,14 +54,22 @@ export type PluginProps = {
type PluginComponentType = FC<PluginProps>;
+const loadPluginDependencies = async () => {
+ const { registerPluginDependencies } = await
import("src/utils/registerPluginDependencies");
+
+ registerPluginDependencies();
+};
+
export const loadPlugin = (
reactApp: ReactAppResponse,
importBundle: (url: string) => Promise<unknown> = (url) => import(/*
@vite-ignore */ url),
+ loadDependencies: () => Promise<void> = loadPluginDependencies,
): Promise<{ default: PluginComponentType }> => {
(globalThis as Record<string, unknown>).AirflowPlugin = undefined;
// We are assuming the plugin manager is trusted and the bundle_url is safe
- return importBundle(new URL(reactApp.bundle_url, document.baseURI).href)
+ return loadDependencies()
Review Comment:
Actually can we add a catch here to refresh plugins when they go stale?
```
.catch((error: unknown) => {
reloadAfterFailedRouteModuleLoad();
throw error;
})
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]