Skip to content

[wip] CONSOLE-4512: Switch from legacy render to createRoot#16202

Open
logonoff wants to merge 10 commits intoopenshift:mainfrom
logonoff:CONSOLE-4512-createRoot
Open

[wip] CONSOLE-4512: Switch from legacy render to createRoot#16202
logonoff wants to merge 10 commits intoopenshift:mainfrom
logonoff:CONSOLE-4512-createRoot

Conversation

@logonoff
Copy link
Member

No description provided.

logonoff and others added 10 commits March 26, 2026 09:15
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>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 26, 2026
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Mar 26, 2026

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

Details

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

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 26, 2026
@openshift-ci openshift-ci bot requested review from rawagner and spadgett March 26, 2026 13:20
@openshift-ci openshift-ci bot added the component/core Related to console core functionality label Mar 26, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 26, 2026

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added component/dashboard Related to dashboard approved Indicates a PR has been approved by an approver from all required OWNERS files. component/shared Related to console-shared kind/cypress Related to Cypress e2e integration testing labels Mar 26, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 26, 2026

@logonoff: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-console e30afe2 link true /test e2e-gcp-console

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality component/dashboard Related to dashboard component/shared Related to console-shared do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/cypress Related to Cypress e2e integration testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants