Skip to content

Commit 6342a18

Browse files
committed
refactor(ios-runner): reach the host dev-tools probe only when a device needs it
A static edge from `runner-session.ts` to the new module grew three Apple facade closures by one module each (app-lifecycle, doctor, runner-operations), which the eager-import-closure ratchet refuses: the runner subtree is eagerly evaluated to answer a simulator request, and this preflight only ever runs for a physical iOS device. Function-scoped import keeps the preflight where it belongs without paying for it on the paths that can never use it.
1 parent 59b3361 commit 6342a18

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/platform-apple/src/runner/runner-session.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ import {
6363
type RunnerDisposalOptions,
6464
} from './runner-disposal.ts';
6565
import { enrichRunnerFailureFromLog } from './runner-failure-diagnostics.ts';
66-
import { assertDevToolsSecurityForIosRunner } from './runner-dev-tools-security.ts';
6766
import {
6867
advanceRunnerSessionState,
6968
buildRunnerSessionId,
@@ -188,6 +187,10 @@ async function startRunnerSessionWithLease(
188187
await ensureBootedIfNeeded(device);
189188
});
190189
await measureRunnerStartupStep(startupTimings, 'verify_host_dev_tools_security', async () => {
190+
// Loaded here rather than at the top of the file: the runner subtree sits in the eager import
191+
// closure of the seven Apple facades (eager-closure-budgets), and a preflight only a physical
192+
// device ever needs has no business being evaluated to answer a simulator request.
193+
const { assertDevToolsSecurityForIosRunner } = await import('./runner-dev-tools-security.ts');
191194
await assertDevToolsSecurityForIosRunner(device);
192195
});
193196
if (options.cleanStaleBundles) {

0 commit comments

Comments
 (0)