bbovenzi opened a new pull request, #77408:
URL: https://github.com/apache/airflow/pull/77408

   A page plugin that throws, while rendering or in an effect, now leaves the 
page as it would be without the plugin instead of replacing it with the route's 
error page. The error goes to the console.
   
   ### Why
   `ReactPlugin` had no error boundary, so an error from a plugin's component 
reached the route's error element and took down the Dag, task or dashboard page 
the plugin was only adding to. Plugin actions already had 
`PluginActionBoundary` for this. It becomes `PluginBoundary` and now wraps page 
plugins too.
   
   A bundle that fails to load already behaves this way: `loadPlugin` reloads 
once, logs the error and renders nothing. The existing "reloads once and 
renders nothing when the bundle cannot be fetched" test covers that, so a 
plugin now shows no error on screen whether it fails to load or fails to render.
   
   `ReactPlugin` also called `lazy()` during render, which makes a new 
component type on every render unless the React Compiler memoizes it. It now 
keeps the lazy component in state, one per mount; every caller keys 
`ReactPlugin` by plugin. The `react/hook-use-state` disable comment on that 
line goes away when the UI lint stack (#77218) drops that rule.
   
   ### Tests
   - New: a plugin that throws while rendering, and one that throws in an 
effect, render next to page content. Both check the page text is still there, 
nothing else rendered, and the console names the plugin. Both fail against 
`main`'s `ReactPlugin`.
   - `pnpm lint` and `pnpm format:check` pass; `ReactPlugin.test.tsx` and the 
`PluginActions` tests pass (47 tests).
   - Not checked: a real plugin in a running UI.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


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