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

Revamp RPC; Make devtools build safe #19

Merged
merged 4 commits into from
Sep 20, 2024
Merged

Conversation

zephraph
Copy link
Owner

@zephraph zephraph commented Sep 20, 2024

Ton of changes here. This fixes #17 and was spawned from the fact that the RCP layer needs the flexibility to return different types in different situations. I replaced the original WebViewEvent / ClientEvent language with a more familiar Request / Response model... sort of.

There's the general idea of a Message. That's something that's sent from the webview to the client. A Message is either a Notification (which is something client didn't ask for, but is open to) or a Response (which is in direct response to a client's request). A Notification represents a global client state change... started, closed, etc. Responses are for specific requests so I've added an ID on both the request and response side that way it's easy to map which response was intended for which request. That's necessary because all these messages are multiplexed over one channel (stdio).

It's really feeling like it's coming together! The nice thing is that I really didn't have to make any updates to my send/receive threads in the webview.

@zephraph zephraph force-pushed the devtools-feature-flag branch from 1698405 to ad95389 Compare September 20, 2024 21:07
@zephraph zephraph merged commit 37e8cce into main Sep 20, 2024
5 checks passed
@zephraph zephraph deleted the devtools-feature-flag branch September 20, 2024 21:11
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.

Gate devtools behind feature flag
1 participant