bbovenzi commented on code in PR #77408:
URL: https://github.com/apache/airflow/pull/77408#discussion_r4647951256
##########
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:
Fixed!
--
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]