fix(swift,web): stop pointing deprecated TTS stop helpers at a deprecated API - #762
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change updates deprecated TTS stop guidance in the Swift and web bindings. Both platforms now direct callers to the ChangesTTS deprecation guidance
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This change corrects four deprecated TTS helpers so they direct callers to the returned speech handle instead of another deprecated API; it has no runtime behavior impact and no actionable merge-blocking risk remains. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
bindings/web/packages/core/src/Public/API/Deprecated.tsESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox. 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 |
|
Still reproduces on today's Swift. @available(*, deprecated, renamed: "tts.stop()")while the target is itself deprecated, @available(*, deprecated, message: "Use the SpeechHandle returned by speak(_:options:) to interrupt one utterance")
public func stop() async {So Xcode's fix-it walks a caller from one deprecated symbol straight onto another. Web. One detail I did not have in the description: the web
so the redirect target is documented as not existing, one file away from the deprecation notes that point at it. Branch merges clean into current |
…ated API stopSynthesis/stopSpeaking in both SDKs tell the caller to use tts.stop(), which is itself deprecated in favour of the SpeechHandle returned by speak(). Following the advice trades one deprecation warning for another, and on Swift `renamed:` gives Xcode a fix-it that performs the bad migration for you. Retarget all four at the SpeechHandle, matching the wording tts.stop() already uses. Swift drops `renamed:` for `message:` because the replacement is a returned handle, not a symbol that can be substituted at the call site. Kotlin's equivalents were fixed in RunanywhereAI#731.
faf64e7 to
a5d7e8b
Compare
What is wrong
Four deprecated TTS helpers, two in Swift and two in Web, send the caller to
tts.stop().tts.stop()is itself deprecated.bindings/swift/.../Extensions/TTS/RunAnywhere+TTS.swift:55,76bindings/swift/.../API/Namespaces/TTSNamespace.swift:102Web is the same pair.
Public/API/Deprecated.ts:82,87say ``UseRunAnywhere.tts.stop()``` whileNamespaces/tts.ts:173` deprecates `stop()` in favour of the handle. The live namespace doc a few lines above it is explicit:Why it matters more on Swift
renamed:is not just prose, it produces a fix-it. Xcode offers to rewrite the call, and the rewrite lands on the deprecated API. Reduced to a self-contained file and compiled with the hostswiftc:Take the compiler's advice on line 13 and you get line 14's warning. Net progress is zero.
What this changes
All four now name the SpeechHandle, reusing the wording
tts.stop()already uses so the two hops collapse into one. Swift moves fromrenamed:tomessage:because the replacement is a value returned fromspeak(_:options:), not a symbol the call site can be rewritten to, so a fix-it would be wrong whatever it pointed at.Kotlin's equivalents were the same defect and were fixed in #731; this is the Swift and Web half.
Scope
I checked every deprecation in the repo for this shape, not just the ones I happened to hit: 83 Swift, 23 TypeScript across web/react-native/electron, and the Dart ones. Cross-referencing each recommended replacement against the set of deprecated symbols leaves exactly these four. The other apparent hits are name collisions rather than real chains: the deprecated
generate,generateStreamandspeakare the legacy shims inDeprecated.tsitself, whilevlm.generate,vlm.generateStreamandtts.speakare live. React Native has nostopSpeaking/stopSynthesisforwarders, so nothing to change there.Verification
swiftc -parseon the changed Swift file passes. SwiftLint cannot run on this host (Command Line Tools only), so I checked the constraint by hand instead:line_lengthiswarning: 150, and both new lines are 123 characters, the same length as the existing annotation onTTSNamespace.swift:102they are modelled on.scripts/validation/gates/check_deprecated_surfaces.shpasses on the branch.The Web change is inside a JSDoc comment, so it carries no type or runtime effect.
Summary by CodeRabbit
SpeechHandlereturned bytts.speakto interrupt individual utterances.