-
-
Notifications
You must be signed in to change notification settings - Fork 913
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
Update to wry 0.13; support IPC, devtool, and feature flags #243
Conversation
Specifically set wry to 0.13; this has breaking changes (notably: RPC -> IPC).
Check wry's documentation for each. Some of them are platform dependent or have platform dependent effects. (mostly MacOS and Linux)
I think upgrade to wry 0.13 has been implemented in another PR: #221 |
modularize looks great. But I think some |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!! Thank you for diving into this!
We're probably going to tweak some of the feature flags before releasing our next version - especially with enabling dev tools by default in debug mode.
Note on the feature flags: According to wry's documentation, the following flags are MacOS-specific and only enable private APIs, which might only be used during development anyway:
That does not mean, those flags actually toggle real behaviour for anyone else; if you want to use devtools on Windows or Linux, you always can, as well as transparency and fullscreen. To be honest, those flags are named misleading and confusing, they should probably have platform prefixes to communicate, that they are not general purpose feature toggles. The reason I included them here is that I do not want to block MacOS developers from using the private APIs if they so desire.
That one was interesting (at least on Windows). So to actually open the devtool, one has to trigger that. fn AppWithDevTool(cx: Scope) -> Element {
let window = dioxus::desktop::use_window(&cx);
// snip
cx.render(rsx! {
button {
onmousedown: |e| e.cancel_bubble(),
onclick: move |_| { window.devtool() },
"Open DevTool"
}
})
} I guess this should be documented probably. 😅 Bonus: disabling the context menu all together (as it's not very useful when no devtool entry is there): // add this JS snippet somewhere in your app
window.addEventListener('contextmenu', e => e.preventDefault()); Kudos: tauri-apps/wry#30 (comment) |
We'll probably remove them from the top-level dioxus crate, meaning you need to manually bring in the dioxus-desktop crate with features enabled to dig into platform-specific configurations. And perhaps prefix them with |
First of all: Thank you for this amazing project!
I had already slightly more fun with this than with tauri itself, even though it stands on the shoulders of it (wry, tao).
I know it's a lot at once, but the wry 0.13 upgrade led me down a rabbit hole.
What changes:
If something is not to your liking or you want something split up differently, I can try to cut separate PRs.
Note: I tested it with some examples and a local project, all on a Win10 machine.