codeant-ai-for-open-source[bot] commented on PR #38533:
URL: https://github.com/apache/superset/pull/38533#issuecomment-4026588550
## **Sequence Diagram**
Shows how MethodEndpoint avoids a Redux-based SSG crash by moving server URL
access into a BrowserOnly child (ServerUrl). During static site generation the
ServerUrl hook is not executed, while in the browser ServerUrl reads Redux and
injects the server URL into the rendered path.
```mermaid
sequenceDiagram
participant SSG as Docusaurus SSG
participant Method as MethodEndpoint (swizzled)
participant BrowserOnly as BrowserOnly wrapper
participant ServerUrl as ServerUrl (uses Redux)
participant Redux as Redux Store (client only)
SSG->>Method: Render API page during build
Method->>BrowserOnly: Includes BrowserOnly(ServerUrl) but does NOT
execute ServerUrl
BrowserOnly-->>Method: Renders without server URL (no Redux access) ->
SSG completes successfully
Note over Method,BrowserOnly: Later, in the browser at runtime
Client->>Method: Hydrate / render component in browser
Method->>BrowserOnly: BrowserOnly mounts ServerUrl
BrowserOnly->>ServerUrl: Initialize
ServerUrl->>Redux: useTypedSelector -> read server.url/variables
Redux-->>ServerUrl: server URL value
ServerUrl-->>Method: Inject resolved server URL into endpoint path
Method-->>Client: Render full endpoint (badge + server URL + path)
```
---
*Generated by [CodeAnt AI](https://codeant.ai)*
--
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]