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

   A React plugin with `destination: "base"` renders above the content of every 
page, and while its bundle loads, `ReactPlugin`'s Suspense fallback puts a bare 
spinner in the top left corner. The page itself has already rendered by then, 
so every full page load shows a stray spinner above it until the plugin's 
bundle arrives. On a slow connection that can take seconds. Base plugins now 
render nothing until they are ready. Every other destination keeps the spinner, 
because there the plugin fills a page or tab that would otherwise be empty.
   
   ## Call-stack diff
   
   ```diff
     BaseLayout
     └─ ReactPlugin({ reactApp })              # one per destination "base" app
        ├─ globalThis[reactApp.name] set?      # unchanged: render it directly
        └─ <Suspense fallback>
   -       ├─ <Spinner />                      # every destination
   +       ├─ null                             # destination "base"
   +       ├─ <Spinner />                      # every other destination
           └─ LazyPlugin -> loadPlugin(reactApp)
   ```
   
   - **What is not here.** The page still moves down when a base plugin 
finishes loading, because nothing reserves its space. Fixing that would mean 
letting a plugin declare a placeholder height. That changes the plugin API, so 
I left it out.
   - **How I checked it.** I applied the same one-line change to the 3.3.1 UI 
and served it from an Astro Runtime 3.3.1 image with a base plugin installed. I 
held the plugin's bundle so the loading state stayed on screen. Before the 
change the page showed one spinner; after it, none. With the bundle allowed 
through, the plugin rendered as before. The two new tests in 
`ReactPlugin.test.tsx` cover both fallbacks. The base case fails if its 
fallback goes back to `<Spinner />`.
   
   Before and after, with the base plugin's bundle still loading (Airflow 
3.3.1):
   
   <!-- drag spinner-before.png and spinner-after.png here -->
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code (Claude Opus 5.5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   
   ---
   
   * Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information. Note: commit author/co-author name and email in commits 
become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: 
`{pr_number}.significant.rst`, in 
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
 You can add this file in a follow-up commit after the PR is created so you 
know the PR number.
   


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