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

Miria v2 #572

Open
5 of 14 tasks
shiosyakeyakini-info opened this issue Mar 30, 2024 · 8 comments · May be fixed by #604
Open
5 of 14 tasks

Miria v2 #572

shiosyakeyakini-info opened this issue Mar 30, 2024 · 8 comments · May be fixed by #604
Labels
High Priority fix as soon as possible
Milestone

Comments

@shiosyakeyakini-info
Copy link
Owner

shiosyakeyakini-info commented Mar 30, 2024

Miriaをごっそりリファクタリングする

  • Lintを強めに設定する 特にunawaited_futures discarded_futures とかを入れる
  • 単なるシンプルめのダイアログを表示するためにshowDialogを使わずに、ダイアログの状態管理をするStateNotifierを作ってその状態を受けて表示できるようにする (Misskey本家も割とそんな感じの動きしてる)
    • async gapの対策
    • StateNotifierFutureとかで一連の処理でユーザーのダイアログ操作待ちをさせたいときがある 画像つきノート投稿時のサーバーからのセンシティブ判定とか
    • 次いで、ダイアログをAdaptiveにする
  • Material 3にする
  • 既存のProviderをcode generationに置き換える、状態をイミュータブルにする
  • fvmを使い、ビルド毎のFlutterのバージョンを固定する
  • ローカルの状態管理をflutter_hooksでやる
  • showDialogshowModalBottomSheet を auto_route で呼び出すようにする
  • AccountScopeをInheritedWidgetではなく、Scoped Providerにしてdependenciesに入れる
  • Privacy Manifest対応
  • 既存のプルリクエストの整理
  • 命名規則がばらばらなのでなおす (語順で動詞を先にする)
  • StateNotifierとPageを同じディレクトリ階層にしてわかりやすくする
  • もしもこれの対応中にRiverpod 3.0の新機能がきたら、それは恩恵にあずかる
  • LAN内のMisskeyサーバー(ポート指定、HTTP通信)でもログインできるように(デバッグ時)
@poppingmoon
Copy link
Contributor

require_trailing_commas を入れてもらいたいです(インデントが揃うし差分が見やすくなる)

@shiosyakeyakini-info
Copy link
Owner Author

shiosyakeyakini-info commented Jun 9, 2024

  • APIの読み込みも全面的に見直す
    • discard_future, unawaited_futureのLintを入れて全部みなおす
    • なにもしてない、ローディング中、完了時の状態を管理して、二重リノートすると画面が真っ白になるみたいなやつをなんとかする

@shiosyakeyakini-info
Copy link
Owner Author

負債が多すぎてなきそう

@shiosyakeyakini-info shiosyakeyakini-info pinned this issue Jun 9, 2024
@poppingmoon
Copy link
Contributor

AriaではAPIの呼び出しは基本的に全て AsyncNotifier を使って行っています

Notifierのbuildの中でasyncを書くとデータとローディングとエラーの3状態のsealed classみたいなやつを勝手に返してくれるので、switchでそれぞれのviewをまとめて書けます
ファイルは増えますがFutureとsetStateでいちいち状態をいじるよりは楽だと思うのでおすすめです

例: https://github.com/poppingmoon/aria/blob/a5e9da3f5f4567269a401f13dabbe68a2fbdd66d/lib/view/page/explore/explore_roles.dart#L22-L44

@shiosyakeyakini-info
Copy link
Owner Author

riverpodの2585でもにょってる ん~~~もうriverpod 3.0-dev.3にするか

@poppingmoon
Copy link
Contributor

riverpod_generatorに移行するならriverpod_lintを入れてみてもいいかもしれません
たぶん今の状態で入れるとavoid_build_context_in_providersが大量に出ると思います

@shiosyakeyakini-info
Copy link
Owner Author

riverpodのドキュメントを読み直してたらflutter_hooks使うと便利なのでは?ってなってきた
それもやっていこ

@shiosyakeyakini-info
Copy link
Owner Author

shiosyakeyakini-info commented Jun 22, 2024

ぬぁーーー ChangeNotifierはriverpod_generatorでlistenされない そういう仕様らしい
むむ……

@shiosyakeyakini-info shiosyakeyakini-info added the High Priority fix as soon as possible label Jul 12, 2024
@shiosyakeyakini-info shiosyakeyakini-info added this to the Miria v2 milestone Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority fix as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants