-
Notifications
You must be signed in to change notification settings - Fork 31
Rewrite LiveTranslationFeature to TCA #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thank you! I'll check this PR after the conference. It seems to be what I desired 😍 |
} | ||
case .view(.connectStream): | ||
return .run { send in | ||
await send(.connectChatStream) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call function instead. Sending other action in send causes performance issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
extension LiveTranslationServiceClient: DependencyKey { | ||
static func live() -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use liveValue directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var liveTranslation = LiveTranslation.State( | ||
roomNumber: ProcessInfo.processInfo.environment["LIVE_TRANSLATION_KEY"] | ||
?? (Bundle.main.infoDictionary?["Live translation room number"] as? String) ?? "" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extract to BulidConfig, which defined as Dependency Client.
See how it works at isowords:
https://github.com/pointfreeco/isowords/tree/main/Sources/Build
Build is preserved in .gitignore so use BuildConfig instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to rewrite LiveTranslationFeature into TCA (aligning it with the architecture of other features).
And also add #93 and #95 features.
480p.mov
I found an issue where the simulator build doesn’t run the translation after stopping debugging. However, this can also be reproduced on the main branch, so it doesn’t seem to be a critical problem.