Skip to content
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

ソング:phraseRendering.tsの処理をsinging.tsに移動 #2338

Merged

Conversation

sigprogramming
Copy link
Contributor

@sigprogramming sigprogramming commented Nov 4, 2024

内容

#2248 でフレーズレンダラーを追加してphraseRendering.tsに置きましたが、
actionやmutationのDIが必要になって面倒なので、singing.tsに移して、actionやmutationを直接呼ぶようにします。(ExternalDependenciesを無くします)
フレーズレンダラーと各ステージの処理の流れは変更していません。

その他

@sigprogramming sigprogramming requested a review from a team as a code owner November 4, 2024 01:21
@sigprogramming sigprogramming requested review from Hiroshiba and removed request for a team November 4, 2024 01:21
@sigprogramming
Copy link
Contributor Author

sigprogramming commented Nov 4, 2024

一旦revertしてコミットを分けました。
singing.tsに移動ExternalDependenciesを無くすに分けました)

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コード的にはLGTM!!

別案として、関数ごとにDIせず直接Storeを渡せば、面倒事減らしつつコードも分離できて読みやすいのかも?とちょっと思いました!
まあsrc/sing/phraseRendering.tsStoreに依存してるのは方向的にちょっと妙なので、例えばsrc/store/singingを作り、今のsinging.tssinging/index.tsに映したうえで、src/store/singing/phraseRendering.tsに配置する感じとかなら自然かも。

singing.ts内に移すのでもOKだと思います!
singing.tsが3400行に戻ってちょい大きいのと、ステージごとに処理を分ける設計はスコープが切れるので問題がおきにくいのが嬉しそう、みたいな気持ちです。

(全然強い意見ではないです 🙏  アイデア出しくらい。)

@sigprogramming
Copy link
Contributor Author

Storeを渡すのも考えたのですが、Storeの型が分かりませんでした…

音素タイミング編集機能の実装でレンダリング周りを変更するかもなので、ひとまずsinging.tsに移して、後でまたphraseRendering.ts等に移動を考えています…!

@Hiroshiba
Copy link
Member

Hiroshiba commented Nov 4, 2024

ちなみに型はこちらです!(この前必要になって切り出しました)

export type Store = BaseStore<State, AllGetters, AllActions, AllMutations>;

ひとまずsinging.tsに移して、後でまたphraseRendering.ts等に移動を考えています…!

なるほどです、了解しました!
2回移動するとあとで今までのコードの変更が追いづらいかもと少し思いましたが、実装しやすさ優先も良さそう!

Copy link
Member

@Hiroshiba Hiroshiba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

@Hiroshiba Hiroshiba merged commit a948735 into VOICEVOX:main Nov 4, 2024
8 checks passed
@sigprogramming sigprogramming deleted the move_phrase_rendering_process branch November 4, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants