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

部分的なVDOMの導入提案 #1225

Open
yumetodo opened this issue Apr 16, 2023 · 3 comments
Open

部分的なVDOMの導入提案 #1225

yumetodo opened this issue Apr 16, 2023 · 3 comments
Labels
Feedback: enhancement New feature or request Type: refactoring Refactoring codes

Comments

@yumetodo
Copy link
Contributor

問題点

/src/renderer/main/package.tsはやはり長大であり、一つの関数も長い。根本的に自力でDOM操作をしていることが型付けを煩雑にして、コードを膨らませている。

提案する解決方法

mithril.jsを用いて部分的にVDOMの恩恵を受けるようにする。mithirl.jsはpure jsで記述できるVDOMライブラリで、document.getElementById等によって取得した任意の要素(一般に空のdiv tag)の配下だけを管理させることができる。

検討した代替案

ReactやVueを用いる場合全面書き換えとなるのでつらい。

補足説明

@yumetodo yumetodo added the Feedback: enhancement New feature or request label Apr 16, 2023
@mitosagi
Copy link
Collaborator

部分的なVDOMを導入するのは良いアイデアだと思います。

調べたところ、Reactでも複数のVDOMを使えるようです。mithril.jsは非同期関数内の再描画にトリガーが必要なことを考えると、Reactを使うのが良いかもしれません。

@yumetodo
Copy link
Contributor Author

Reactでもいけるんですね。

tsxを使う場合はビルドチェインの複雑化になるのでメンテナンスできるかを気にしたほうが良さそうです

@hal-shu-sato
Copy link
Collaborator

hal-shu-sato commented Feb 11, 2024

やっとNext.jsで書けるくらいにはReact勉強しました
サーバーサイド処理がないはず?なので、Next.jsとはまた異なりそうではありますが、部分的にVDOMに移行するのであれば、私もリライト可能です
一応コンポーネントとしてreact-bootstrapを使うのには慣れています

@hal-shu-sato hal-shu-sato added the Type: refactoring Refactoring codes label Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feedback: enhancement New feature or request Type: refactoring Refactoring codes
Projects
None yet
Development

No branches or pull requests

3 participants