Title: improve server_method and finder_method · Issue #457 · hyperstack-org/hyperstack · GitHub
Open Graph Title: improve server_method and finder_method · Issue #457 · hyperstack-org/hyperstack
X Title: improve server_method and finder_method · Issue #457 · hyperstack-org/hyperstack
Description: 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...
Open Graph Description: 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...
X Description: 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...
Opengraph URL: https://github.com/hyperstack-org/hyperstack/issues/457
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"improve server_method and finder_method","articleBody":"`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.\r\n\r\nEach of these mechanisms are similar in that they execute on the server and return values to the client. The improvements are to \r\n\r\n(a) figure out how a server_method can automatically be refetched: ...\r\ncertainly when the record is changed the server (and client is notified) the client should request a refetch.\r\nthere 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.\r\n\r\n(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.\r\n\r\n","author":{"url":"https://github.com/catmando","@type":"Person","name":"catmando"},"datePublished":"2023-06-29T15:33:23.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/457/hyperstack/issues/457"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2395deb9-3444-c222-adee-53b887ca3cfe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A1D2:11B886:1C0FBB1:243B6AE:699278E5 |
| html-safe-nonce | 1d8ba4d5e646e5393a6b5c80427910959918a1cad3b1411650f0f07e5c85433a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMUQyOjExQjg4NjoxQzBGQkIxOjI0M0I2QUU6Njk5Mjc4RTUiLCJ2aXNpdG9yX2lkIjoiNzI4MjE4MTk2NjI3NDkxODYyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ed4c54956ce025f744a61ab5e07812ea96e1105f0bf17dbed17ecffd0eb79e70 |
| hovercard-subject-tag | issue:1781079908 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/hyperstack-org/hyperstack/457/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b45853a846e76850f0ad47bf4dcf365f1c0e3de5ee6acf7f09740af21acd05f1/hyperstack-org/hyperstack/issues/457 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b45853a846e76850f0ad47bf4dcf365f1c0e3de5ee6acf7f09740af21acd05f1/hyperstack-org/hyperstack/issues/457 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | catmando |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/hyperstack-org/hyperstack git https://github.com/hyperstack-org/hyperstack.git |
| octolytics-dimension-user_id | 34562730 |
| octolytics-dimension-user_login | hyperstack-org |
| octolytics-dimension-repository_id | 145879576 |
| octolytics-dimension-repository_nwo | hyperstack-org/hyperstack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145879576 |
| octolytics-dimension-repository_network_root_nwo | hyperstack-org/hyperstack |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width