ref(releases): Convert ReleaseIssues to functional component#115698
Draft
ryan953 wants to merge 4 commits into
Draft
ref(releases): Convert ReleaseIssues to functional component#115698ryan953 wants to merge 4 commits into
ryan953 wants to merge 4 commits into
Conversation
Replace browserHistory with useNavigate, remove withApi/withOrganization HOCs in favor of useApi/useOrganization hooks.
Contributor
📊 Type Coverage Diff
🔍 3 new type safety issues introduced
Type assertions (
This is informational only and does not block the PR. |
ryan953
commented
May 16, 2026
| </DemoTourElement> | ||
| )} | ||
| <ReleaseIssues | ||
| organization={organization} |
Member
Author
There was a problem hiding this comment.
weird. it also had withOrganization() wrapping it before.
ryan953
commented
May 16, 2026
Comment on lines
+56
to
+61
| function getActiveIssuesType(location: ReturnType<typeof useLocation>): IssuesType { | ||
| const query = (location.query?.issuesType as string) ?? ''; | ||
| return Object.values<string>(IssuesType).includes(query) | ||
| ? (query as IssuesType) | ||
| : IssuesType.NEW; | ||
| } |
Member
Author
There was a problem hiding this comment.
straight up moved out of the old component, but changed this.props.location to a arg 👍
ryan953
commented
May 16, 2026
Comment on lines
+63
to
+71
| function getIssuesEndpoint( | ||
| version: string, | ||
| location: ReturnType<typeof useLocation>, | ||
| releaseBounds: ReleaseBounds, | ||
| issuesType: IssuesType | ||
| ): { | ||
| endpoint: React.ComponentProps<typeof GroupList>['endpoint']; | ||
| queryParams: IssuesQueryParams; | ||
| } { |
Member
Author
There was a problem hiding this comment.
straight up moved. Replace member calls to be function args
this is gone:
const {version, location, releaseBounds} = this.props;
const issuesType = this.getActiveIssuesType();
now we have args!
Move getIssuesUrl out of the component body to match the pattern of getActiveIssuesType and getIssuesEndpoint.
ryan953
commented
May 16, 2026
Comment on lines
+147
to
+155
| function getIssuesUrl( | ||
| version: string, | ||
| location: ReturnType<typeof useLocation>, | ||
| releaseBounds: ReleaseBounds, | ||
| issuesType: IssuesType, | ||
| organizationSlug: string | ||
| ) { | ||
| const {queryParams} = getIssuesEndpoint(version, location, releaseBounds, issuesType); | ||
| const query = new MutableSearch([]); |
Member
Author
There was a problem hiding this comment.
another straight up move, with args passed.
previously:
const {version, organization} = this.props;
const issuesType = this.getActiveIssuesType();
const {queryParams} = this.getIssuesEndpoint();
const query = new MutableSearch([]);
Use apiOptions + useQuery for the issues-count and resolved endpoints instead of manual api.requestPromise with useCallback/useEffect.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Convert the
ReleaseIssuesclass component to a functional component, removing thebrowserHistoryshim import.Hooks replace HOCs and shim
withApi,withOrganization, andbrowserHistoryare replaced withuseApi,useOrganization, anduseNavigatehooks respectively.useLocationreplaces thelocationprop. The component's public API shrinks to justversion,releaseBounds,queryFilterDescription, andwithChart.Test updates
Tests now use
initialRouterConfigandorganizationrender options instead of passinglocationandorganizationas props. Manualrerendercalls for location changes are replaced by relying on the component's ownnavigate()call triggered by user interaction.