Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xilem: Add message_handler view #456

Closed
wants to merge 4 commits into from

Conversation

azymohliad
Copy link
Contributor

@azymohliad azymohliad commented Jul 28, 2024

This PR implements @Philipp-M idea for a channel view from this message. For now I took liberty to rename it to message_handler, as it seems like the main purpose of the view, while the rest is just a machinery for extracting MessageProxy to it, but it can be changed of course.

I've implemented it just for practice and to aid the discussion, I'm not actually proposing to merge it (at least yet, UPD: I now think #463 is a more ergonomic option). Especially I'm not sure if my hack with deferring store_proxy to View::message call (just for giving it access to mutable app data) is a good pattern.

@Philipp-M
Copy link
Contributor

Philipp-M commented Jul 29, 2024

if my hack with deferring store_proxy to View::message call (just for giving it access to mutable app data) is a good pattern.

Yeah that's not optimal, FWIW it's similar to what I did in #452.
The reason why only View::message has access to the state is historical, and is indeed also something I'd like to discuss (on zulip), since right now it should be possible to access it in either View::build and View::rebuild, as view building/messaging and rebuilding happens on the main thread currently.
Originally the app_logic was on a separate thread, parallel to the thread having access to the view context and the element-tree, to decouple rendering the view from rendering the actual widgets. It's not yet clear if that's necessary, but if app_logic takes too long to evaluate currently on the main thraed, that could mean hickups.

Other than that it looks good so far to me.

@azymohliad azymohliad changed the title Add message_handler view xilem: add message_handler view Jul 29, 2024
@azymohliad
Copy link
Contributor Author

Originally the app_logic was on a separate thread, parallel to the thread having access to the view context and the element-tree, to decouple rendering the view from rendering the actual widgets. It's not yet clear if that's necessary, but if app_logic takes too long to evaluate currently on the main thraed, that could mean hickups.

Aah, that clarifies things! Thanks a lot for the explanation!

@azymohliad azymohliad changed the title xilem: add message_handler view xilem: Add message_handler view Jul 29, 2024
@DJMcNab
Copy link
Member

DJMcNab commented Jul 29, 2024

This is another thing which interacts with hot reloading; in that case, we would definitely need to move things around.

I have a design in my, but it is yet to be tested/implemented.

@Philipp-M
Copy link
Contributor

I don't think a web label makes sense here?

@azymohliad
Copy link
Contributor Author

Btw, let's close this and #463 to clean up the list of PRs? I suppose there's no any value in them, besides just exploring how such views could be implemented

@azymohliad
Copy link
Contributor Author

I'll close it for now to keep the PR list clean, but will keep the branch around for a while just in case.

@azymohliad azymohliad closed this Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants