Skip to content

Commit ee2f4a8

Browse files
perf(web): update everything compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 70d60e0 commit ee2f4a8

2 files changed

Lines changed: 15 additions & 19 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/sidebar/useUpdateEverything.ts",
99100
] as const;

‎apps/web/src/components/sidebar/useUpdateEverything.ts‎

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { useAtomValue } from "@effect/atom-react";
22
import { PROVIDER_DISPLAY_NAMES } from "@t3tools/contracts";
33
import { Atom } from "effect/reactivity";
4-
import { useMemo } from "react";
54

65
import { APP_VERSION } from "~/branding";
76
import { isDesktopLocalConnectionTarget } from "~/connection/desktopLocal";
@@ -40,25 +39,21 @@ export type ReportLocalUpdateError = (title: string, description: string) => voi
4039
export function useUpdateEverything(localUpdateVersion: string | null) {
4140
const targetVersion = localUpdateVersion ?? APP_VERSION;
4241
const { environments } = useEnvironments();
43-
const machinesAtom = useMemo(
44-
() =>
45-
Atom.make((get) =>
46-
environments.map((environment) => ({
47-
environmentId: environment.environmentId,
48-
label: environment.label,
49-
serverConfig: environment.serverConfig,
50-
connected: environment.connection.phase === "connected",
51-
hostedByThisApp:
52-
isElectron &&
53-
(environment.entry.target._tag === "PrimaryConnectionTarget" ||
54-
isDesktopLocalConnectionTarget(environment.entry.target)),
55-
canMaintain: canUpdateServer(
56-
get(environmentSession.sessionStateAtom(environment.environmentId)),
57-
),
58-
updateState: get(serverEnvironment.updateStateAtom(environment.environmentId)),
59-
})),
42+
const machinesAtom = Atom.make((get) =>
43+
environments.map((environment) => ({
44+
environmentId: environment.environmentId,
45+
label: environment.label,
46+
serverConfig: environment.serverConfig,
47+
connected: environment.connection.phase === "connected",
48+
hostedByThisApp:
49+
isElectron &&
50+
(environment.entry.target._tag === "PrimaryConnectionTarget" ||
51+
isDesktopLocalConnectionTarget(environment.entry.target)),
52+
canMaintain: canUpdateServer(
53+
get(environmentSession.sessionStateAtom(environment.environmentId)),
6054
),
61-
[environments],
55+
updateState: get(serverEnvironment.updateStateAtom(environment.environmentId)),
56+
})),
6257
);
6358
const machines = useAtomValue(machinesAtom);
6459
const { targets: behindServers, skipped: unreachable } = collectServerUpdateTargets(

0 commit comments

Comments
 (0)