chore(deps): upgrade wry from 0.45.0 to v0.52.0 (#4255)

* chore(deps): upgrade wry from 0.45.0 to v0.51.2

* Unwrap webview

* update tauri

* fix more versions

* switch to a single websocket per app to communicate edits in desktop

* use websockets on the ts side

* queue pending edits before the websocket connects

* fix decoding the websocket blobs in ts

* rebuild js

* fix clippy

* more sensible struct names

* allow http on android and require a key to match between the webview and native sides

* remove out.txt

* clippy

* small style changes

* More light cleanups

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
This commit is contained in:
authored and GitHub committed 2025-07-01 18:08:24 -07:00
1 parent 65dd1f1762
commit d5daf14c15
18 files changed
+1324 -1083

No files matched your search

+6 -6
View File
@@ -4,7 +4,7 @@ use std::path::PathBuf;
use tao::event_loop::{EventLoop, EventLoopWindowTarget};
use tao::window::{Icon, WindowBuilder};
use wry::http::{Request as HttpRequest, Response as HttpResponse};
use wry::RequestAsyncResponder;
use wry::{RequestAsyncResponder, WebViewId};
use crate::ipc::UserWindowEvent;
use crate::menubar::{default_menu_bar, DioxusMenu};
@@ -70,12 +70,12 @@ impl LaunchConfig for Config {}
pub(crate) type WryProtocol = (
String,
Box<dyn Fn(HttpRequest<Vec<u8>>) -> HttpResponse<Cow<'static, [u8]>> + 'static>,
Box<dyn Fn(WebViewId, HttpRequest<Vec<u8>>) -> HttpResponse<Cow<'static, [u8]>> + 'static>,
);
pub(crate) type AsyncWryProtocol = (
String,
Box<dyn Fn(HttpRequest<Vec<u8>>, RequestAsyncResponder) + 'static>,
Box<dyn Fn(WebViewId, HttpRequest<Vec<u8>>, RequestAsyncResponder) + 'static>,
);
impl Config {
@@ -188,7 +188,7 @@ impl Config {
/// Set a custom protocol
pub fn with_custom_protocol<F>(mut self, name: impl ToString, handler: F) -> Self
where
F: Fn(HttpRequest<Vec<u8>>) -> HttpResponse<Cow<'static, [u8]>> + 'static,
F: Fn(WebViewId, HttpRequest<Vec<u8>>) -> HttpResponse<Cow<'static, [u8]>> + 'static,
{
self.protocols.push((name.to_string(), Box::new(handler)));
self
@@ -204,7 +204,7 @@ impl Config {
/// #
/// # fn main() {
/// let cfg = Config::new()
/// .with_asynchronous_custom_protocol("asset", |request, responder| {
/// .with_asynchronous_custom_protocol("asset", |_webview_id, request, responder| {
/// tokio::spawn(async move {
/// responder.respond(
/// HTTPResponse::builder()
@@ -222,7 +222,7 @@ impl Config {
/// See [`wry`](wry::WebViewBuilder::with_asynchronous_custom_protocol) for more details on implementation
pub fn with_asynchronous_custom_protocol<F>(mut self, name: impl ToString, handler: F) -> Self
where
F: Fn(HttpRequest<Vec<u8>>, RequestAsyncResponder) + 'static,
F: Fn(WebViewId, HttpRequest<Vec<u8>>, RequestAsyncResponder) + 'static,
{
self.asynchronous_protocols
.push((name.to_string(), Box::new(handler)));