Phoenix LiveView Phoenix.Sync.LiveView.sync_stream evaluation
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- elixir
調査の方向性
Issue で言及されているエントリポイント Phoenix.Sync.LiveView.sync_stream と sync_stream_update から始め、dead render、初回の live render、snapshot の経過時間、limit オプションがどのように扱われているかを追跡します。観測された動作を、要求されている現在の初期データ、最新の dead-render データ、設定可能な snapshot 更新、機能する limit と比較します。この issue では具体的なファイルやテストは指定されていません。
索引モデルが issue の本文から書いたものです。
説明
Hello 👋🏻
I'm evaluating Phoenix.Sync.LiveView.sync_stream in my Phoenix LiveView application. Particular use case I'm checking is notification stream - I want to display notifications and keep them up to date in the UI.
I'm using it in the "standard" way:
defmodule MyWeb.MyLive do
use Phoenix.LiveView
import Phoenix.Sync.LiveView
def mount(_params, _session, socket) do
{:ok, sync_stream(socket, :todos, Todos.Todo)}
end
def handle_info({:sync, event}, socket) do
{:noreply, sync_stream_update(socket, event)}
end
end
After playing with it for some time, I have these observations that surprised me.
deadrender always has no data in stream - it's not ideal in tests and differs from the original LiveView approach.- initial
liverender stream has old (sometimes very old) data. It means there's a lot of catching up to be done on each page refresh (since I'm not using client-side caching) - Limit query seems to be not working, it silently ignores it.
So my questions:
-
Regular phoenix applications are being "mounted" frequently, on each page navigation. Currently it means each such mount is followed by a lot of catching up, which is visible in UI. I understand it's done that way to reduce database load, but it's not ideal. Is there an easy option to configure max snapshot age before it's refreshed?
-
Is there a way to get similar behaviour to phoenix streams in tests? I'm asking about dead render having fresh data (without cache)
-
Is there a way to respect limit query in the initial render?
Phoenix.Sync.LiveView.sync_stream(.., ..,.., limit: 10)doesn't seem to work.
In general, I have a feeling that sync_stream is promising, but not yet battle-tested utility. Which is a shame.
What I was hoping for:
I would love a solution that would work in the same way as "stock" phoenix live view streams
- initial data is always "current", present for both dead and initial live render, so there's not a lot of catching up, with limits working
- I don't have to "babysit" these streams with lots of pubsub broadcasts and subscribes, it would just stay synchronized out of the box.
All in all, I'm rooting for this project! It's really impressive how it's all working, just wanted to drop my own observations.
- 主要言語
- Elixir
- スター
- 290
- フォーク
- 17
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
electric-sql/phoenix_sync のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
electric-sql/phoenix_sync#128 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
electric-sql/phoenix_sync#126 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
electric-sql/phoenix_sync#119 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
electric-sql/phoenix_sync#118 · リアクション 8 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
electric-sql/phoenix_sync#117 · コメント 5 件 ·
electric-sql/phoenix_sync の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
carverauto/serviceradar#4596 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
agentjido/jido_harness#80 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
sevenseacat/cinder#235 ·