소스 검색

Update webview2-com and windows crates (#2875)

Bill Avery 3 년 전
부모
커밋
34be6cf37a

+ 7 - 0
.changes/windows-0.25.0.md

@@ -0,0 +1,7 @@
+---
+"tauri": patch
+"tauri-runtime": patch
+"tauri-runtime-wry": patch
+---
+
+Update the `windows` crate to 0.25.0, which comes with pre-built libraries. WRY and Tao can both reference the same types directly from the `windows` crate instead of sharing bindings in `webview2-com-sys`.

+ 8 - 2
core/tauri-runtime-wry/Cargo.toml

@@ -14,7 +14,7 @@ readme = "README.md"
 
 [dependencies]
 #wry = { version = "0.12", default-features = false, features = [ "file-drop", "protocol" ] }
-wry = { git = "https://github.com/tauri-apps/wry", rev = "910cc1eb8ed08c66e9fb75df90e28635538d68ab", default-features = false, features = [ "file-drop", "protocol" ] }
+wry = { git = "https://github.com/tauri-apps/wry", rev = "27cf3735f717ffcc409e79031356ea0c99cadf8a", default-features = false, features = [ "file-drop", "protocol" ] }
 tauri-runtime = { version = "0.2.1", path = "../tauri-runtime" }
 tauri-utils = { version = "1.0.0-beta.3", path = "../tauri-utils" }
 uuid = { version = "0.8.2", features = [ "v4" ] }
@@ -22,7 +22,13 @@ infer = "0.4"
 
 [target."cfg(windows)".dependencies]
 ico = "0.1"
-webview2-com = "0.4.0"
+webview2-com = "0.7.0"
+
+[target."cfg(windows)".dependencies.windows]
+version = "0.25.0"
+features = [
+  "Win32_Foundation",
+]
 
 [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
 png = "0.16"

+ 5 - 4
core/tauri-runtime-wry/src/lib.rs

@@ -27,9 +27,10 @@ use tauri_runtime::window::MenuEvent;
 use tauri_runtime::{SystemTray, SystemTrayEvent};
 #[cfg(windows)]
 use webview2_com::{
-  FocusChangedEventHandler,
-  Windows::Win32::{Foundation::HWND, System::WinRT::EventRegistrationToken},
+  FocusChangedEventHandler, Windows::Win32::System::WinRT::EventRegistrationToken,
 };
+#[cfg(windows)]
+use windows::Win32::Foundation::HWND;
 #[cfg(all(feature = "system-tray", target_os = "macos"))]
 use wry::application::platform::macos::{SystemTrayBuilderExtMacOS, SystemTrayExtMacOS};
 #[cfg(target_os = "linux")]
@@ -1676,7 +1677,7 @@ impl Runtime for Wry {
           let proxy = self.event_loop.create_proxy();
           let mut token = EventRegistrationToken::default();
           unsafe {
-            controller.add_GotFocus(
+            controller.GotFocus(
               FocusChangedEventHandler::create(Box::new(move |_, _| {
                 let _ = proxy.send_event(Message::Webview(
                   id,
@@ -1690,7 +1691,7 @@ impl Runtime for Wry {
           .unwrap();
           let proxy = self.event_loop.create_proxy();
           unsafe {
-            controller.add_LostFocus(
+            controller.LostFocus(
               FocusChangedEventHandler::create(Box::new(move |_, _| {
                 let _ = proxy.send_event(Message::Webview(
                   id,

+ 7 - 1
core/tauri-runtime/Cargo.toml

@@ -33,7 +33,13 @@ http-range = "0.1.4"
 infer = "0.4"
 
 [target."cfg(windows)".dependencies]
-webview2-com-sys = "0.4.0"
+webview2-com = "0.7.0"
+
+[target."cfg(windows)".dependencies.windows]
+version = "0.25.0"
+features = [
+  "Win32_Foundation",
+]
 
 [target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies]
 gtk = { version = "0.14", features = [ "v3_20" ] }

+ 1 - 1
core/tauri-runtime/src/lib.rs

@@ -11,7 +11,7 @@ use std::{fmt::Debug, path::PathBuf, sync::mpsc::Sender};
 use uuid::Uuid;
 
 #[cfg(windows)]
-use webview2_com_sys::Windows::Win32::Foundation::HWND;
+use windows::Win32::Foundation::HWND;
 
 pub mod http;
 /// Create window and system tray menus.

+ 1 - 1
core/tauri-runtime/src/webview.rs

@@ -13,7 +13,7 @@ use serde_json::Value as JsonValue;
 use tauri_utils::config::{WindowConfig, WindowUrl};
 
 #[cfg(windows)]
-use webview2_com_sys::Windows::Win32::Foundation::HWND;
+use windows::Win32::Foundation::HWND;
 
 use std::{fmt, path::PathBuf};
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
core/tauri/scripts/bundle.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
examples/api/public/build/bundle.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
examples/api/public/build/bundle.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 221 - 192
examples/api/src-tauri/Cargo.lock


+ 8 - 1
examples/api/yarn.lock

@@ -63,7 +63,9 @@
     picomatch "^2.2.2"
 
 "@tauri-apps/api@../../tooling/api/dist":
-  version "1.0.0-beta.7"
+  version "1.0.0-beta.8"
+  dependencies:
+    type-fest "2.5.2"
 
 "@types/estree@*":
   version "0.0.46"
@@ -628,6 +630,11 @@ totalist@^1.0.0:
   resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df"
   integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g==
 
+type-fest@2.5.2:
+  version "2.5.2"
+  resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.5.2.tgz#d6a5247b8019716b300d9023fa7b1b02016dd864"
+  integrity sha512-WMbytmAs5PUTqwGJRE+WoRrD2S0bYFtHX8k4Y/1l18CG5kqA3keJud9pPQ/r30FE9n8XRFCXF9BbccHIZzRYJw==
+
 wrappy@1:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 204 - 177
examples/updater/src-tauri/Cargo.lock


+ 2 - 1
tooling/cli.js/test/jest/jest.setup.js

@@ -1,6 +1,7 @@
 import { jest } from '@jest/globals'
 
-jest.setTimeout(1200000)
+// 30 minute timeout: 20 minutes wasn't always enough for compilation in GitHub Actions.
+jest.setTimeout(1800000)
 
 setTimeout(() => {
   // do nothing

+ 0 - 1
tooling/cli.rs/Cargo.lock

@@ -1987,7 +1987,6 @@ dependencies = [
  "unicode-width",
  "ureq",
  "valico",
- "winapi 0.3.9",
  "zeroize",
 ]
 

+ 0 - 1
tooling/cli.rs/Cargo.toml

@@ -52,7 +52,6 @@ heck = "0.3"
 dialoguer = "0.9"
 
 [target."cfg(windows)".dependencies]
-winapi = { version = "0.3", features = [ "winbase", "winuser", "consoleapi", "processenv", "wincon" ] }
 encode_unicode = "0.3"
 
 [target."cfg(target_os = \"linux\")".build-dependencies]

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.