@devries-cameron20 / t3code Mirror · read-only / commits / e3a578f2d1
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 06:45 UTC

perf(web): the environment hooks compile without manual memoization (#20665)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 16, 2026 at 21:55 UTC e3a578f2d1f888776e64153c12ceb5d9e32edd35
1 file changed +5 -14
apps/web/src/state/environments.ts
+5 -14
@@ -7,7 +7,6 @@ import {
7 import { Discovery } from "@t3tools/client-runtime/relay";
8 import type { EnvironmentId } from "@t3tools/contracts";
9 import * as Option from "effect/Option";
10 -import { useMemo } from "react";
10
11 import { environmentCatalog } from "../connection/catalog";
12 import {
@@ -44,12 +43,8 @@ export function useEnvironments() {
43 const networkStatus = useAtomValue(environmentCatalog.networkStatusValueAtom);
44 const presentationById = useAtomValue(environmentPresentations.presentationsAtom);
45
47 - const environments = useMemo(
48 - () =>
49 - [...presentationById.entries()].map(([environmentId, presentation]) =>
50 - projectEnvironmentPresentation(environmentId, presentation),
51 - ),
52 - [presentationById],
46 + const environments = [...presentationById.entries()].map(([environmentId, presentation]) =>
47 + projectEnvironmentPresentation(environmentId, presentation),
48 );
49
50 return {
@@ -68,13 +63,9 @@ export function useEnvironment(
63 environmentId: EnvironmentId | null,
64 ): EnvironmentPresentation | null {
65 const { presentation } = useEnvironmentPresentation(environmentId);
71 - return useMemo(
72 - () =>
73 - environmentId === null || presentation === null
74 - ? null
75 - : projectEnvironmentPresentation(environmentId, presentation),
76 - [environmentId, presentation],
77 - );
66 + return environmentId === null || presentation === null
67 + ? null
68 + : projectEnvironmentPresentation(environmentId, presentation);
69 }
70
71 export function usePrimaryEnvironment(): EnvironmentPresentation | null {