Skip to content

Commit 54aae85

Browse files
perf(web): device host connection checks compile with the React Compiler
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 0d30035 commit 54aae85

2 files changed

Lines changed: 21 additions & 24 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,5 @@ export const REACT_COMPILED_FILES = [
7676
"apps/web/src/components/settings/SourceControlHostSettings.tsx",
7777
"apps/web/src/components/settings/UsageProviderSettings.tsx",
7878
"apps/web/src/components/settings/TelemetryExportSettings.tsx",
79+
"apps/web/src/components/settings/useHostConnectionChecks.ts",
7980
] as const;

‎apps/web/src/components/settings/useHostConnectionChecks.ts‎

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,26 @@ export function useHostConnectionChecks(targets: ReadonlyArray<DeviceHostCheckTa
2222
running.current.add(key);
2323
setChecks((current) => ({ ...current, [key]: {} }));
2424
const results: Record<string, DeviceHostCheck> = {};
25-
try {
26-
await checkDeviceHostConnections(
27-
targets,
28-
host,
29-
async (environmentId, input) => {
30-
if (!readEnvironmentScope(environmentId, AuthSettingsWriteScope)) {
31-
throw new Error("This connection cannot test device hosts.");
32-
}
33-
const result = await test({ environmentId, input });
34-
if (result._tag === "Failure") throw new Error(Cause.pretty(result.cause));
35-
return result.value;
36-
},
37-
(environmentId, result) => {
38-
results[environmentId] = result;
39-
setChecks((current) => ({
40-
...current,
41-
[key]: { ...current[key], [environmentId]: result },
42-
}));
43-
},
44-
);
45-
return results;
46-
} finally {
47-
running.current.delete(key);
48-
}
25+
await checkDeviceHostConnections(
26+
targets,
27+
host,
28+
async (environmentId, input) => {
29+
if (!readEnvironmentScope(environmentId, AuthSettingsWriteScope)) {
30+
throw new Error("This connection cannot test device hosts.");
31+
}
32+
const result = await test({ environmentId, input });
33+
if (result._tag === "Failure") throw new Error(Cause.pretty(result.cause));
34+
return result.value;
35+
},
36+
(environmentId, result) => {
37+
results[environmentId] = result;
38+
setChecks((current) => ({
39+
...current,
40+
[key]: { ...current[key], [environmentId]: result },
41+
}));
42+
},
43+
).finally(() => running.current.delete(key));
44+
return results;
4945
};
5046
return { checks, testConnection };
5147
}

0 commit comments

Comments
 (0)