kvnli216 commented on code in PR #77408:
URL: https://github.com/apache/airflow/pull/77408#discussion_r4646113577


##########
airflow-core/src/airflow/ui/src/pages/ReactPlugin.tsx:
##########
@@ -154,22 +160,19 @@ export const ReactPlugin = ({ reactApp }: { readonly 
reactApp: ReactAppResponse
   // If the plugin component was already registered on the global object by a 
previous load,
   // render it directly without going through Suspense/lazy (avoids flashing 
the spinner).
   const existing = (globalThis as Record<string, unknown>)[reactApp.name];
-
-  if (typeof existing === "function") {
-    const Plugin = existing as PluginComponentType;
-
-    return <Plugin {...pluginProps} />;
-  }
-
-  // Otherwise, lazy-load the bundle once. When it resolves, it must set a 
function component
-  // under globalThis[reactApp.name], which we then use as the default export.
-  const LazyPlugin = lazy(() => loadPlugin(reactApp));
   // A base plugin sits above every page, so a spinner there shows on every 
full page load.
   const fallback = reactApp.destination === "base" ? null : <Spinner />;
+  const Plugin = typeof existing === "function" ? (existing as 
PluginComponentType) : undefined;
 
   return (
-    <Suspense fallback={fallback}>
-      <LazyPlugin {...pluginProps} />
-    </Suspense>
+    <PluginBoundary name={reactApp.name}>

Review Comment:
   **CHG.N1**
   
   If a Dag Overview plugin throws on one Dag, does it stay hidden after 
switching to a Dag where it would work? It looks like `PluginBoundary` never 
clears `hasError`, and since `ReactPlugin` is only keyed by `plugin.name`, the 
same boundary stays mounted across Dags until a full reload. Might be worth 
resetting it when the route params change, like keying `PluginBoundary` on the 
`dagId`, `runId`, `taskId` and `mapIndex` that `ReactPlugin` already reads.



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