improve server_method and finder_method
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Funcionalidade
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript, ruby
- Domínio
- backend-api-design, full-stack
Direção de pesquisa
Comece rastreando os mecanismos existentes de server_method e finder_method descritos na issue, incluindo como os scopes especificam joins e como os valores são retornados ao client. A conclusão exigiria um design definido e uma implementação para o refetch solicitado de server-method e para aggregators no nível do scope, com comportamento de recomputação e resultados JSON-serializable.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- JavaScript
- Estrelas
- 538
- Forks
- 41
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de hyperstack-org/hyperstack
-
expose_as_operations method Abertaenhancement needs doc
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
hyperstack-org/hyperstack#359 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
hyperstack-org/hyperstack#267 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
hyperstack-org/hyperstack#456 ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 15/100
hyperstack-org/hyperstack#455 · 2 comentários ·
-
won't run with latest puma Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
hyperstack-org/hyperstack#454 · 1 comentário ·
Todas as issues de hyperstack-org/hyperstack
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
-
Daemon passes --experimental-wasm-jspi unconditionally on Node >= 24; Node 26 rejects the flag Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Automattic/studio#4908 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 86/100
sugarlabs/musicblocks#8847 ·