improve server_method and finder_method
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 功能
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- javascript, ruby
研究方向
首先追蹤 issue 中描述的現有 server_method 和 finder_method 機制,包括 scope 如何指定 joins,以及值如何回傳給 client。完成這項工作需要確定設計並實作所要求的 server-method 重新擷取和 scope 層級的 aggregator,同時定義重新計算行為並確保結果可 JSON 序列化。
由索引模型根據 Issue 內容生成。
描述
server_method applies to a record and returns a value computed on that record from the server, finder_method applies to a scope (all a model class) and returns a single record from that scope.
Each of these mechanisms are similar in that they execute on the server and return values to the client. The improvements are to
(a) figure out how a server_method can automatically be refetched: ...
certainly when the record is changed the server (and client is notified) the client should request a refetch.
there is also currently a ! extension to server_methods that forces a refetch, but using this is not too clean. Somehow after the record is changed locally on the server during some logical points in the UI lifecycle we should be able to request that any server_methods associated with the record be recomputed. This has to be somehow done on request however, not EVERYTIME the record changes locally. For example say a record has some column that is updated by the user typing into it. We will probably want to wait till the user changes focus before recomputing, otherwise we are going to do a roundtrip to the server on every keystroke. Perhaps model_instance.update_server_methods (alias update_server_method) which takes a list of method names to update. If method_names is empty then it does all currently active server_methods.
(b) figure out how finder_method can be extended return an aggregate value rather than a record. In otherwords its actually a new method aggregator that applies to a scope (including the default scope) and does some computation on that scope and returns a jsonizable value. Its very similar in the mechanism that finder_method uses, except where finder_method internally returns a single item collection containing the record, in this case we would return a jsonizable object tree. Probably it should use the same mechanism scopes use to specify that the computation has joins in it, so that we know when to recompute.
- 主要語言
- JavaScript
- 星號
- 538
- 分支
- 41
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
hyperstack-org/hyperstack 的其他 Issue
-
enhancement needs doc
難度 2/5 1-3 小時 新手友好度 68/100
hyperstack-org/hyperstack#359 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
hyperstack-org/hyperstack#267 ·
-
難度 3/5 1-2 天 新手友好度 35/100
hyperstack-org/hyperstack#456 ·
-
難度 5/5 一週以上 新手友好度 15/100
hyperstack-org/hyperstack#455 · 2 則留言 ·
-
難度 3/5 1-2 天 新手友好度 35/100
hyperstack-org/hyperstack#454 · 1 則留言 ·
查看 hyperstack-org/hyperstack 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
難度 2/5 1-3 小時 新手友好度 76/100
-
難度 2/5 1-3 小時 新手友好度 78/100
Automattic/studio#4908 ·
-
難度 2/5 1-3 小時 新手友好度 74/100
-
難度 2/5 1-3 小時 新手友好度 86/100
sugarlabs/musicblocks#8847 ·