Description
In the current redux-like design, we have a "single point of communication" through a single generic Tauri command: handle_action(). This allows for easily testable state updates. However, querying data from the backend is not part of this design since all data that the backend holds in its state is always transported fully to the frontend. As the amount of data is growing (connections, credentials, history) it might make sense to not send all data to the frontend, but allow the frontend to query the backend in some form. There are two ways to design this (possibly more):
- Add a separate
query() command and possibly also a separate listener for the frontend to make use of the response. This introduces a bit more complexity for the frontend as it would need to know what and where to listen for (temporary "oneshot" listener for just one single query?). This would allow the frontend to fetch data once, then handle it internally without any persistence.
- Extend the current design (single command) and introduce "query actions" that are also handled by reducers, but not all data that the backend holds is put into the state for the frontend. This is generally more "async safe" as it follows the redux-like loop of data flow.
Motivation
We have to tackle growing amounts of data while (hopefully) introducing only little additional complexity.
Requirements
- Allow the frontend to display large amounts of data (such as lists) without having to hold them at all times.
- Make more specific requests for data that could be computationally intensive (better handled by Rust than by JavaScript).
Open Questions
We can make the assumption that the amount of data will still be reasonable, even for heavier usage (20+ credentials, etc., 100+ connections) as it is purely text. We need to consider if we really want to handle the additional complexity of having to handle a separate "frontend state" and a "backend state" or if we decide to stick with "one state for frontend and backend" and solve the querying through the backend when necessary, so the frontend and backend always have the same view on data at all times.
Are you planning to contribute this in a PR?
Yes
Description
In the current redux-like design, we have a "single point of communication" through a single generic Tauri command:
handle_action(). This allows for easily testable state updates. However, querying data from the backend is not part of this design since all data that the backend holds in its state is always transported fully to the frontend. As the amount of data is growing (connections, credentials, history) it might make sense to not send all data to the frontend, but allow the frontend to query the backend in some form. There are two ways to design this (possibly more):query()command and possibly also a separate listener for the frontend to make use of the response. This introduces a bit more complexity for the frontend as it would need to know what and where to listen for (temporary "oneshot" listener for just one single query?). This would allow the frontend to fetch data once, then handle it internally without any persistence.Motivation
We have to tackle growing amounts of data while (hopefully) introducing only little additional complexity.
Requirements
Open Questions
We can make the assumption that the amount of data will still be reasonable, even for heavier usage (20+ credentials, etc., 100+ connections) as it is purely text. We need to consider if we really want to handle the additional complexity of having to handle a separate "frontend state" and a "backend state" or if we decide to stick with "one state for frontend and backend" and solve the querying through the backend when necessary, so the frontend and backend always have the same view on data at all times.
Are you planning to contribute this in a PR?
Yes