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 local provider update groups compile without manual memoization (#20604)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 22:02 UTC
2182353fdfbac18b7045d213e750cb79f32742ce
1 file changed
+24
-29
apps/web/src/components/ProviderUpdateLaunchNotification.environments.ts
+24
-29
@@ -1,6 +1,5 @@
1
import type { ConnectionCatalogEntry } from "@t3tools/client-runtime/connection";
2
import type { ServerConfig } from "@t3tools/contracts";
3
-import { useMemo } from "react";
3
4
import { useEnvironments, usePrimaryEnvironmentId } from "~/state/environments";
5
import { isDesktopLocalConnectionTarget } from "~/connection/desktopLocal";
@@ -40,37 +39,33 @@ export function useLocalEnvironmentUpdateGroups(): {
39
const { environments } = useEnvironments();
40
const primaryEnvironmentId = usePrimaryEnvironmentId();
41
43
- return useMemo(() => {
44
- const inputs: LocalEnvironmentProvidersInput[] = [];
42
+ const inputs: LocalEnvironmentProvidersInput[] = [];
43
46
- for (const environment of environments) {
47
- if (!isLocalConnectionTarget(environment.entry.target)) {
48
- continue;
49
- }
44
+ for (const environment of environments) {
45
+ if (!isLocalConnectionTarget(environment.entry.target)) {
46
+ continue;
47
+ }
48
51
- const isPrimary = environment.environmentId === primaryEnvironmentId;
52
- const serverConfig: ServerConfig | null = environment.serverConfig;
49
+ const isPrimary = environment.environmentId === primaryEnvironmentId;
50
+ const serverConfig: ServerConfig | null = environment.serverConfig;
51
54
- inputs.push({
55
- environmentId: environment.environmentId,
56
- label: isPrimary
57
- ? deriveEnvironmentDisplayLabel({
58
- isWsl: false,
59
- wslDistro: null,
60
- platformOs: serverConfig?.environment.platform.os,
61
- fallbackLabel: environment.label,
62
- })
63
- : environment.label,
64
- isPrimary,
65
- connectionState: isPrimary
66
- ? "ready"
67
- : normalizeConnectionState(environment.connection.phase),
68
- providers: serverConfig?.providers ?? [],
69
- });
70
- }
52
+ inputs.push({
53
+ environmentId: environment.environmentId,
54
+ label: isPrimary
55
+ ? deriveEnvironmentDisplayLabel({
56
+ isWsl: false,
57
+ wslDistro: null,
58
+ platformOs: serverConfig?.environment.platform.os,
59
+ fallbackLabel: environment.label,
60
+ })
61
+ : environment.label,
62
+ isPrimary,
63
+ connectionState: isPrimary ? "ready" : normalizeConnectionState(environment.connection.phase),
64
+ providers: serverConfig?.providers ?? [],
65
+ });
66
+ }
67
72
- inputs.sort((left, right) => Number(right.isPrimary) - Number(left.isPrimary));
68
+ inputs.sort((left, right) => Number(right.isPrimary) - Number(left.isPrimary));
69
74
- return buildLocalEnvironmentUpdateGroups(inputs);
75
- }, [environments, primaryEnvironmentId]);
70
+ return buildLocalEnvironmentUpdateGroups(inputs);
71
}