michael-s-molina opened a new pull request, #40915:
URL: https://github.com/apache/superset/pull/40915

   ### SUMMARY
   
   Extension loading was blocking the entire React render tree on every page 
load. `ExtensionsStartup` wrapped the full route tree and returned `null` until 
`initializeExtensions()` resolved.
   
   **Root cause:** `ExtensionsStartup` awaited extension initialization before 
rendering children, blocking all routes including pages that have no dependency 
on extensions (e.g. the welcome page).
   
   **Fix — two parts:**
   
   1. **`ExtensionsStartup`: remove blocking gate.**
      `window.superset` setup is synchronous. Extension loading is now 
fire-and-forget — children render immediately and extensions register in the 
background.
   
   2. **`views` and `menus` registries: make reactive.**
      The registries were plain module-level data structures (a `Map` and an 
array). Components reading from them on render would miss any extensions that 
registered after initial paint. Added a `listeners` set and `notify()` calls on 
every `registerView`/`registerMenuItem`, and exported `useViews(location)` / 
`useMenu(location)` hooks that subscribe to changes and trigger re-renders when 
extensions register. Updated all four consumers:
      - `StatusBar` → `useViews`
      - `SouthPane` → `useViews`
      - `AppLayout` → `useViews`
      - `PanelToolbar` → `useMenu`
   
      Note: `EditorHost` already used a reactive pattern (`onDidRegisterEditor` 
events) and required no changes.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   | Before | After |
   |--------|-------|
   | Page renders blank until all extensions are fetched and loaded (~1–3s) | 
Page renders immediately; extension contributions appear once loaded |
   
   ### TESTING INSTRUCTIONS
   
   1. Enable the `ENABLE_EXTENSIONS` feature flag and configure at least one 
extension with a `remoteEntry`.
   2. Navigate to the welcome page — confirm it renders immediately without 
delay.
   3. Navigate to SQL Lab — confirm the page renders immediately.
   4. Wait for extensions to finish loading — confirm extension-contributed 
panels (SouthPane tabs), status bar items, right sidebar panels, and toolbar 
menus appear after load without a page refresh.
   5. To reproduce the pre-fix regression, temporarily add a delay in 
`ExtensionsLoader.initializeExtensions()` before the API call and confirm 
extension contributions appear reactively after the delay.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags: `ENABLE_EXTENSIONS`
   - [x] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to