0.6.1: maintenance — decompose complexity hotspots, dedup dispatch, drop dead exports#255
Conversation
…port emitTypeTestsForModule was a dev aid with no consumers in src/test/test-d and was not re-exported from the public surface. The module-level 'export default tywrap' was likewise unused: src/index.ts imports the named tywrap and re-exports its own default, so nothing depended on the tywrap.ts default. Both removed; the named tywrap export is retained.
Decompose three cognitive-complexity hotspots in src/dev.ts without changing reload/watch behavior, ordering, or side effects: - resolveWatchTargets (cognitive 28 -> resolved): extract the invariant Python resolution script to a module constant and split out resolveWatchPythonEnv, resolveWatchTargetPayload, resolvePackageWatchTargets, resolveFileWatchTarget, and resolveModuleWatchTargets helpers. - collectWatchDirectories (cognitive 19 -> resolved): extract isWatchableDirectory and listChildDirectories from the BFS loop. - runReload (cognitive 25 -> 13, no longer actionable): introduce a ReloadState object plus prepareReload, activateReloadBridge, and disposeReloadFailure helpers, preserving the exact closed-checkpoint abort semantics and emit ordering. No public API, behavior, or wire-protocol change.
Extract rejectAllQueuedWrites and processQueuedWrite helpers from flushWriteQueue to drop its cognitive complexity below threshold (23 -> below 15). The write-drain ordering, backpressure handling, queue-timeout fallback, and synchronous-error rejection semantics are preserved exactly; the loop now dispatches on a status returned by processQueuedWrite (continue / backpressure / error).
Maintenance release: dead-export removal, 11 complexity-hotspot decompositions (output-preserved), and codec/RPC-client dispatch dedup. No API/behavior/wire changes. Actionable complexity 14 -> 3.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughVersion 0.6.1 maintenance release refactoring internal code organization: consolidating duplicated request/response decoding in the runtime codec and RPC client, extracting complexity hotspots in core modules and dev watch system into smaller focused helpers, and removing two dead exports. No public API changes or behavior modifications. Changes0.6.1 Maintenance Release
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
0.6.1 — maintenance patch (invisible)
The 0.6.1 cleanup slice from the ts-fx review. No API, behavior, or wire-protocol changes — purely internal. Built as a stacked agent workflow (9 scopes), each characterization-gated (snapshot before/after, assert identical) and verified.
What changed
emitTypeTestsForModule, redundantexport default tywrap) — neither on the public surface.generateKey(cache),validateTypeHints(validation), thedev.tswatch/reload trio,flushWriteQueue(subprocess transport), discovery dependency/path helpers,normalizePath/resolvePythonExecutable(utils),parseTypingFactoryName(annotation parser).bridge-codecandrpc-clientinto one path (the cross-bridgecall/instantiatemerge was deliberately left alone as too risky for a patch).Result
generatecog 91,fetchPythonIrcog 27 → 0.7.0;splitTopLevel→ intentionally irreducible) are deferred.Carries the version bump + human CHANGELOG so the merge cuts 0.6.1 via
publish_from_main.