TypeScript
perf(web): device host connection checks compile with the React Compiler (#20501)
Julius Marmingea72d1fcc5a89
diff --git a/apps/web/reactCompiledFiles.ts b/apps/web/reactCompiledFiles.tsindex 58efeb5a313..f4d8634255f 100644--- a/apps/web/reactCompiledFiles.ts+++ b/apps/web/reactCompiledFiles.ts@@ -76,4 +76,5 @@ export const REACT_COMPILED_FILES = ["apps/web/src/components/settings/SourceControlHostSettings.tsx","apps/web/src/components/settings/UsageProviderSettings.tsx","apps/web/src/components/settings/TelemetryExportSettings.tsx",+ "apps/web/src/components/settings/useHostConnectionChecks.ts",] as const;diff --git a/apps/web/src/components/settings/useHostConnectionChecks.ts b/apps/web/src/components/settings/useHostConnectionChecks.tsindex f0129e4b693..4b2733cdfcf 100644--- a/apps/web/src/components/settings/useHostConnectionChecks.ts+++ b/apps/web/src/components/settings/useHostConnectionChecks.ts@@ -22,30 +22,26 @@ export function useHostConnectionChecks(targets: ReadonlyArray<DeviceHostCheckTarunning.current.add(key);setChecks((current) => ({ ...current, [key]: {} }));const results: Record<string, DeviceHostCheck> = {};- try {- await checkDeviceHostConnections(- targets,- host,- async (environmentId, input) => {- if (!readEnvironmentScope(environmentId, AuthSettingsWriteScope)) {- throw new Error("This connection cannot test device hosts.");- }- const result = await test({ environmentId, input });- if (result._tag === "Failure") throw new Error(Cause.pretty(result.cause));- return result.value;- },- (environmentId, result) => {- results[environmentId] = result;- setChecks((current) => ({- ...current,- [key]: { ...current[key], [environmentId]: result },- }));- },- );- return results;- } finally {- running.current.delete(key);- }+ await checkDeviceHostConnections(+ targets,+ host,+ async (environmentId, input) => {+ if (!readEnvironmentScope(environmentId, AuthSettingsWriteScope)) {+ throw new Error("This connection cannot test device hosts.");+ }+ const result = await test({ environmentId, input });+ if (result._tag === "Failure") throw new Error(Cause.pretty(result.cause));+ return result.value;+ },+ (environmentId, result) => {+ results[environmentId] = result;+ setChecks((current) => ({+ ...current,+ [key]: { ...current[key], [environmentId]: result },+ }));+ },+ ).finally(() => running.current.delete(key));+ return results;};return { checks, testConnection };}