[wip] CONSOLE-4512: Switch from legacy render to createRoot#16202
[wip] CONSOLE-4512: Switch from legacy render to createRoot#16202logonoff wants to merge 10 commits intoopenshift:mainfrom
render to createRoot#16202Conversation
Replace bare React.lazy() usage with AsyncComponent, which provides its own Suspense boundary and retry logic. The MenuToggle icon was missing a Suspense boundary, causing the lazy-loaded perspective icon to suspend an ancestor boundary and block the entire app content from rendering when concurrent features are enabled via createRoot. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
this allows the blame to be shifted away from "contextProviderExtensions suspense", so we know if it is a contextProviderExtensions suspending or if it is the AppContent as a whole
Derive activeTabId directly from URL params instead of syncing state via useEffect. The previous pattern caused a feedback loop under concurrent rendering: clicking a tab set state immediately, but the useEffect reset it to the stale URL value before the navigation took effect, producing a visible flicker. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The useEffect syncing activeNamespace from the URL had activeNamespace in its dependency array, creating a feedback loop: switching namespace set state immediately, but the effect re-fired before the URL updated and reset to the old value. Stabilize updateNamespace with useCallback and refs so it does not change identity on every render. This removes all three eslint-disable react-hooks/exhaustive-deps suppressions and provides correct dependency arrays throughout. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
setHealthCheck was called directly during render, dispatching to the parent's useReducer and triggering an immediate re-render cycle. React 18's createRoot is stricter about setState during render and detects this as an infinite loop. Move the call into a useEffect so it only runs after render when the computed values actually change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
setLimitReqState was called directly during render, dispatching to the parent's useReducer and triggering an infinite re-render cycle. Move the call into a useEffect so it only fires when the computed limit/requested states change. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dispatch({ type: ActionType.OBJ }) was called directly during render
to sync the obj prop into reducer state. Move it into a useEffect
to avoid infinite re-render cycles under concurrent rendering.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
setHasRevealableContent was called inside useMemo, which is setState during render. With createRoot this caused re-render cycles that prevented the reveal state from stabilizing, so the E2E test read "Value hidden" instead of the decoded secret value. Derive hasRevealableContent as a useMemo instead of useState, since it only depends on the data prop. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@logonoff: This pull request references CONSOLE-4512 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: logonoff The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@logonoff: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
No description provided.