Skip to content

ios-simulator.js part 1: parsers to a module, 20 closure-free helpers lifted (#1447 pass V) - #1473

Merged
currentbits merged 3 commits into
mainfrom
coder/refactor-v-split-ios-simulator-js-8a0bf4
Oct 5, 2026
Merged

currentbits merged 3 commits into
mainfrom
coder/refactor-v-split-ios-simulator-js-8a0bf4

Conversation

@currentbits

@currentbits currentbits commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Pass V of #1447 (part 1). electron/ios-simulator.js was 3,244 lines, most of it one ~2,685-line createIOSSimulatorService closure. This PR does the safe first half of the split; the seam extraction follows separately.

Changes

  • Plan: docs/superpowers/specs/2026-10-05-ios-simulator-split.md maps the closure state and the seams (devices/boot, lease journal, helper process, stream, recording, input/screenshot), with an extraction order.
  • electron/ios-simulator-parse.js (533 lines): the pure top-level parsers, validators and the error type.
  • 20 closure-free inner functions moved to module scope, verbatim: cloneLease, leaseSnapshot, callProcess, disconnectedHelperState, mapHelperError, onHelperControl, helperDisconnected, failHelperWaiters, requireCoord, viewerStreamInfoFromSession, releaseSummary, normalizeRunId, recordingFailed, recordingFinalizeFailed, noActiveRecording, createRecordingContext, interruptRecording, isTrustedSimctlPath, isTrustedRecorderPrefix, recoverySummary.

ios-simulator.js: 3,244 → 2,781 lines.

Checked

  • Same API: module.exports keys are identical to main (6).
  • Pure move, ignoring indentation: no non-move lines beyond requires and export lists.
  • Closure-free, by script: none of the 20 lifted functions references any of the factory's 21 parameters (fsApi, now, randomUUID, logger, …) or its remaining closure bindings.
    • The script flagged 7 possible hits. By hand, all were object keys (accessibility: "disconnected") or words inside error strings ("Simulator helper is disconnected"), not references.
  • Tests:
    • electron/test/ios-simulator*.test.js 327/327.
    • Full electron suite (CI-like env) 4126/4126; npm run typecheck clean.
    • npm run test:smoke A–E.

The worker stopped here on a network error (API unreachable) before the seam extraction. That part is a follow-up.

🤖 Generated with Claude Code

Willem and others added 3 commits October 5, 2026 15:08
…to ios-simulator-parse.js (#1447)

Verbatim move of the module-level pure code. ios-simulator.js requires it
back and keeps the same module.exports keys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…module scope (#1447)

They reference no createIOSSimulatorService binding. Indentation is the
only change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits merged commit 5a9c269 into main Oct 5, 2026
6 checks passed
@currentbits
currentbits deleted the coder/refactor-v-split-ios-simulator-js-8a0bf4 branch October 5, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant