WIP: subtitle-translator Nodejs server API - #55
Draft
PBK-B wants to merge 5 commits into
Draft
Conversation
Owner
|
抽取这件事一直想做,不过主要是偏 #2 CLI 应用。目前的想法是之后先在主仓内部做一步:把编排逻辑(并发/分批/上下文/重试/进度)从 useTranslationState 里剥出来,落成 lib 里的一个纯函数 pipeline,浏览器、cli 和 Node 都能直接调。 你也可以先按你的思路做。等跑稳、接口收敛了就可以合并。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#2
我的想法是将与平台(浏览器/node)无关的通用逻辑抽到 packages/translation-core 包中单独维护,浏览器/node 分别导入这个包中相关函数,其他如请求等以接口实现或者平台强相关逻辑代码分别单独实现。
我目前没有动 src 相关代码,只是将其中逻辑抽离出来之后放在 packages/translation-core 中,并另外实现了 app/server 的新 node API 服务端部分。你看看有没有什么建议或偏好,如果有什么我能做以便能继续推进这个计划的请告诉我。
cc @rockbenben