Summary
The lifecycle methods on MarkdownController and StreamedMarkdownController are currently synchronous, even though every call site invokes them from an async context (.task { ... }) or a place where a Task { } wrapper is already implied.
Marking them async lets the call sites await them directly, aligns the controllers with the package's Swift-concurrency conventions (AGENTS.md), and keeps the async boundary explicit at the view layer.
Methods to convert:
StreamedMarkdownController.start() / end()
MarkdownController.onAppear(markdown:) / onDisappear()
The fire-and-forget interaction hooks (onTableCopyTap, onImageTap, etc.) and the sync onChange(markdown:) yield-into-continuation method are intentionally left synchronous, since their call sites are non-async UIKit/AppKit delegates and SwiftUI action closures.
Motivation
- Call sites already run inside
.task { } (an async context), so await-ing is natural and avoids implicit fire-and-forget.
- Makes the concurrency boundary explicit and consistent across the two controllers.
Summary
The lifecycle methods on
MarkdownControllerandStreamedMarkdownControllerare currently synchronous, even though every call site invokes them from an async context (.task { ... }) or a place where aTask { }wrapper is already implied.Marking them
asynclets the call sitesawaitthem directly, aligns the controllers with the package's Swift-concurrency conventions (AGENTS.md), and keeps the async boundary explicit at the view layer.Methods to convert:
StreamedMarkdownController.start()/end()MarkdownController.onAppear(markdown:)/onDisappear()The fire-and-forget interaction hooks (
onTableCopyTap,onImageTap, etc.) and the synconChange(markdown:)yield-into-continuation method are intentionally left synchronous, since their call sites are non-async UIKit/AppKit delegates and SwiftUI action closures.Motivation
.task { }(an async context), soawait-ing is natural and avoids implicit fire-and-forget.