safaehar commented on code in PR #75083:
URL: https://github.com/apache/airflow/pull/75083#discussion_r4474123684


##########
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:
   Done. I wrapped the plugin dependency and bundle imports with 
`loadRouteModule`, so a failed import marks the reload as pending, then call 
`reloadAfterFailedRouteModuleLoad()` from the catch. This refreshes stale 
plugin bundles once without creating a reload loop.
   I also added a regression test verifying that a failed bundle fetch triggers 
the reload. The focused tests, full UI suite, lint, and type checks pass



-- 
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]

Reply via email to