Skip to content

Commit 9f59e73

Browse files
perf(web): the guide tour compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 7111501 commit 9f59e73

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ 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/guide/GuideTour.tsx",
99100
] as const;

‎apps/web/src/components/pullRequest/guide/GuideTour.tsx‎

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { EnvironmentId, PullRequestRef, PullRequestReviewGuide } from "@t3tools/contracts";
2-
import { useEffect, useEffectEvent, useMemo, useRef, useState, type ReactNode } from "react";
2+
import { useEffect, useEffectEvent, useRef, useState, type ReactNode } from "react";
33

44
import { createPullRequestDiffFileContentsLoader } from "~/lib/diffFileContents";
55
import { isEditableFocused } from "~/lib/editableFocus";
@@ -52,24 +52,20 @@ export function GuideTour({
5252
const position = Math.max(Math.min(tour.position, stopCount - 1), 0);
5353
const stop = guide.stops[position] ?? null;
5454

55-
const wantedPaths = useMemo(() => (stop === null ? [] : stopFilePaths(stop)), [stop]);
55+
const wantedPaths = stop === null ? [] : stopFilePaths(stop);
5656
const diff = useGuideDiffFiles({
5757
environmentId,
5858
reference,
5959
headSha: guide.headSha,
6060
wantedPaths,
6161
});
6262
const getDiffFileContents = useAtomCommand(pullRequestEnvironment.diffFileContents);
63-
const loadDiffFiles = useMemo(
64-
() =>
65-
createPullRequestDiffFileContentsLoader(getDiffFileContents, {
66-
environmentId,
67-
reference,
68-
commit: null,
69-
cacheKey: `pull-request-guide:${key}`,
70-
}),
71-
[environmentId, getDiffFileContents, key, reference],
72-
);
63+
const loadDiffFiles = createPullRequestDiffFileContentsLoader(getDiffFileContents, {
64+
environmentId,
65+
reference,
66+
commit: null,
67+
cacheKey: `pull-request-guide:${key}`,
68+
});
7369

7470
const scrollRef = useRef<HTMLDivElement>(null);
7571
const goTo = (next: number) => {

0 commit comments

Comments
 (0)