Skip to content

Commit 51c3366

Browse files
perf(web): the pull request label and reviewer pickers compile without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 70d60e0 commit 51c3366

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,6 @@ export const REACT_COMPILED_FILES = [
9696
"apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx",
9797
"apps/web/src/components/ThreadTerminalDrawer.tsx",
9898
"apps/web/src/components/settings/SettingsPanels.tsx",
99+
"apps/web/src/components/pullRequest/PullRequestLabelPicker.tsx",
100+
"apps/web/src/components/pullRequest/PullRequestReviewerPicker.tsx",
99101
] as const;

‎apps/web/src/components/pullRequest/PullRequestLabelPicker.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useAtomCommand } from "~/state/use-atom-command";
22
import type { EnvironmentId, PullRequestLabelCandidate, PullRequestRef } from "@t3tools/contracts";
33
import { CheckIcon, TagIcon } from "lucide-react";
4-
import { useMemo, useState } from "react";
4+
import { useState } from "react";
55

66
import { pullRequestEnvironment } from "~/state/pullRequests";
77
import { useEnvironmentQuery } from "~/state/query";
@@ -41,9 +41,8 @@ export function PullRequestLabelPicker({
4141
reportFailure: false,
4242
});
4343

44-
const candidates = useMemo(
45-
() => (candidatesQuery.data?.candidates ?? []).filter((entry) => matches(entry, query)),
46-
[candidatesQuery.data, query],
44+
const candidates = (candidatesQuery.data?.candidates ?? []).filter((entry) =>
45+
matches(entry, query),
4746
);
4847

4948
const toggle = async (candidate: PullRequestLabelCandidate) => {

‎apps/web/src/components/pullRequest/PullRequestReviewerPicker.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {
55
PullRequestReviewerCandidate,
66
} from "@t3tools/contracts";
77
import { CheckIcon, UserPlusIcon } from "lucide-react";
8-
import { useMemo, useState } from "react";
8+
import { useState } from "react";
99

1010
import { pullRequestEnvironment } from "~/state/pullRequests";
1111
import { useEnvironmentQuery } from "~/state/query";
@@ -45,9 +45,8 @@ export function PullRequestReviewerPicker({
4545
reportFailure: false,
4646
});
4747

48-
const candidates = useMemo(
49-
() => (candidatesQuery.data?.candidates ?? []).filter((entry) => matches(entry, query)),
50-
[candidatesQuery.data, query],
48+
const candidates = (candidatesQuery.data?.candidates ?? []).filter((entry) =>
49+
matches(entry, query),
5150
);
5251

5352
const toggle = async (candidate: PullRequestReviewerCandidate) => {

0 commit comments

Comments
 (0)