-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
refactor(macos): migrate to objc2
#1316
Merged
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
0da1952
migrate drag & drop
pewsheen 73f0541
refactor: migrate to `dpi` crate (#1202)
amrbashir 93f608f
fix(windows): avoid double-free the controller (#1206)
amrbashir 990759f
fix(linux): Disable deprecated applicationCache web api. (#1207)
FabianLars 7c2cbcd
fix(wkwebview): menu shortcuts (#1208)
thewh1teagle 97ad528
Apply Version Updates From Current Changes (#1203)
github-actions[bot] 4f445fa
migrate to `objc2`
pewsheen 1bcbde0
fix(macos): response body being double freed
pewsheen ec9f3c3
fix(macos): eval callback NSStrgin convertion error
pewsheen 8dbd6cf
chore: remove objc dependency
pewsheen cf2ac97
refactor(macos): migrate WebViewDelegate
pewsheen 2e5d9fe
refactor(macos): migrate proxy to objc2
pewsheen f4309e7
refactor(macos): migrate document title change observer to objc2
pewsheen b4e51ed
refactor(macos): move drag&drop handler to delegate
pewsheen be6d74e
refactor(macos): move ipc_handler into WryWebViewDelegate
pewsheen e62e116
refactor(macos): migrate download handler
pewsheen 986cecd
Merge branch 'dev' into refactor/migrate-to-objc2
pewsheen 2fb6be9
fix(macos): prevent unsafe async custom protocol panic
pewsheen 4eec6fb
chore: target os import
pewsheen 78c5bf2
Merge branch 'dev' into refactor/migrate-to-objc2
pewsheen a6f7ce4
refactor(ios): migrate to objc2
pewsheen ce7b9d0
refactor(macos): migrate WebViewUIDelegate to objc2
pewsheen 1abff79
refactor(macos): migrate WryWebViewParent to objc2
pewsheen e8d2c6e
refactor(macos): move custom class to individual files
pewsheen ab9804b
chore: fix clippy
pewsheen 5f55c39
Merge branch 'dev' into refactor/migrate-to-objc2
pewsheen f889b7c
Merge branch 'dev' into refactor/migrate-to-objc2
pewsheen 92a0242
Merge branch 'dev' into refactor/migrate-to-objc2
pewsheen a769067
Merge branch 'dev' into refactor/migrate-to-objc2
pewsheen a741fef
refector: use reference for task. use objc2::exception::catch.
pewsheen 47140fa
fix(dnd): use msg_send super and impl NSDraggingDestination
pewsheen 880e798
chore: call msg_send super
pewsheen 23444cb
fix: wrap Box<dyn FnMut(..)> with RefCell
pewsheen 7674bf3
chore(deps): update rust crate tao to 0.29 (#1343)
renovate[bot] 796b6ec
refactor: use bitflags way to handle mask bit manipulation
pewsheen a7919ca
Merge branch 'dev' into refactor/migrate-to-objc2
pewsheen 56a5616
WIP: refactor(ios): add wkwebview for ios
pewsheen 7f19a2f
Merge branch 'dev' into refactor/migrate-to-objc2
pewsheen d0f6990
Update Cargo.toml
pewsheen 50c681f
Merge branch 'dev' into refactor/migrate-to-objc2
pewsheen 98372ef
fix: remove `.copy()` from RcBlock
pewsheen abe4085
Merge branch 'dev' into refactor/migrate-to-objc2
lucasfernog 34a3972
add change file
lucasfernog d09873c
lint
lucasfernog faef2eb
fmt
lucasfernog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"wry": minor | ||
--- | ||
|
||
Migrate to obj2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
workspace = { } | ||
workspace = {} | ||
|
||
[package] | ||
name = "wry" | ||
|
@@ -10,53 +10,55 @@ description = "Cross-platform WebView rendering library" | |
readme = "README.md" | ||
repository = "https://github.com/tauri-apps/wry" | ||
documentation = "https://docs.rs/wry" | ||
categories = [ "gui" ] | ||
exclude = [ "/.changes", "/.github", "/audits", "/wry-logo.svg" ] | ||
categories = ["gui"] | ||
exclude = ["/.changes", "/.github", "/audits", "/wry-logo.svg"] | ||
|
||
[package.metadata.docs.rs] | ||
no-default-features = true | ||
features = [ "drag-drop", "protocol", "os-webview" ] | ||
features = ["drag-drop", "protocol", "os-webview"] | ||
targets = [ | ||
"x86_64-unknown-linux-gnu", | ||
"x86_64-pc-windows-msvc", | ||
"x86_64-apple-darwin" | ||
"x86_64-apple-darwin", | ||
] | ||
rustc-args = [ "--cfg", "docsrs" ] | ||
rustdoc-args = [ "--cfg", "docsrs" ] | ||
rustc-args = ["--cfg", "docsrs"] | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
|
||
[features] | ||
default = [ "drag-drop", "objc-exception", "protocol", "os-webview" ] | ||
serde = [ "dpi/serde" ] | ||
objc-exception = [ "objc/exception" ] | ||
drag-drop = [ ] | ||
protocol = [ ] | ||
devtools = [ ] | ||
transparent = [ ] | ||
fullscreen = [ ] | ||
linux-body = [ "webkit2gtk/v2_40", "os-webview" ] | ||
mac-proxy = [ ] | ||
default = ["drag-drop", "objc-exception", "protocol", "os-webview"] | ||
serde = ["dpi/serde"] | ||
objc-exception = ["objc2/catch-all"] | ||
drag-drop = [] | ||
protocol = [] | ||
devtools = [] | ||
transparent = [] | ||
fullscreen = [] | ||
linux-body = ["webkit2gtk/v2_40", "os-webview"] | ||
mac-proxy = [] | ||
os-webview = [ | ||
"javascriptcore-rs", | ||
"webkit2gtk", | ||
"webkit2gtk-sys", | ||
"dep:gtk", | ||
"soup3", | ||
"x11-dl", | ||
"gdkx11" | ||
"gdkx11", | ||
] | ||
tracing = [ "dep:tracing" ] | ||
tracing = ["dep:tracing"] | ||
|
||
[dependencies] | ||
tracing = { version = "0.1", optional = true } | ||
once_cell = "1" | ||
thiserror = "1.0" | ||
http = "1.1" | ||
raw-window-handle = { version = "0.6", features = [ "std" ] } | ||
raw-window-handle = { version = "0.6", features = ["std"] } | ||
dpi = "0.1" | ||
|
||
[target."cfg(any(target_os = \"linux\", target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"openbsd\", target_os = \"netbsd\"))".dependencies] | ||
javascriptcore-rs = { version = "=1.1.2", features = [ "v2_28" ], optional = true } | ||
webkit2gtk = { version = "=2.0.1", features = [ "v2_38" ], optional = true } | ||
javascriptcore-rs = { version = "=1.1.2", features = [ | ||
"v2_28", | ||
], optional = true } | ||
webkit2gtk = { version = "=2.0.1", features = ["v2_38"], optional = true } | ||
webkit2gtk-sys = { version = "=2.0.1", optional = true } | ||
gtk = { version = "0.18", optional = true } | ||
soup3 = { version = "0.5", optional = true } | ||
|
@@ -87,15 +89,79 @@ features = [ | |
"Win32_Globalization", | ||
"Win32_UI_HiDpi", | ||
"Win32_UI_Input", | ||
"Win32_UI_Input_KeyboardAndMouse" | ||
"Win32_UI_Input_KeyboardAndMouse", | ||
] | ||
|
||
[target."cfg(any(target_os = \"ios\", target_os = \"macos\"))".dependencies] | ||
block = "0.1" | ||
cocoa = "0.26" | ||
core-graphics = "0.24" | ||
objc = "0.2" | ||
objc_id = "0.1" | ||
block2 = "0.5" | ||
objc2 = "0.5" | ||
objc2-web-kit = { version = "0.2.0", features = [ | ||
"objc2-app-kit", | ||
"block2", | ||
"WKWebView", | ||
"WKWebViewConfiguration", | ||
"WKWebsiteDataStore", | ||
"WKDownload", | ||
"WKDownloadDelegate", | ||
"WKNavigation", | ||
"WKNavigationDelegate", | ||
"WKUserContentController", | ||
"WKURLSchemeHandler", | ||
"WKPreferences", | ||
"WKURLSchemeTask", | ||
"WKScriptMessageHandler", | ||
"WKUIDelegate", | ||
"WKOpenPanelParameters", | ||
"WKFrameInfo", | ||
"WKSecurityOrigin", | ||
"WKScriptMessage", | ||
"WKNavigationAction", | ||
"WKWebpagePreferences", | ||
"WKNavigationResponse", | ||
"WKUserScript", | ||
] } | ||
objc2-foundation = { version = "0.2.0", features = [ | ||
"NSURLRequest", | ||
"NSURL", | ||
"NSString", | ||
"NSKeyValueCoding", | ||
"NSStream", | ||
"NSDictionary", | ||
"NSObject", | ||
"NSData", | ||
"NSKeyValueObserving", | ||
"NSThread", | ||
"NSJSONSerialization", | ||
"NSDate", | ||
"NSBundle", | ||
"NSProcessInfo", | ||
"NSValue", | ||
"NSRange", | ||
] } | ||
|
||
[target."cfg(target_os = \"ios\")".dependencies] | ||
objc2-ui-kit = { version = "0.2.2", features = [ | ||
"UIResponder", | ||
"UIScrollView", | ||
"UIView", | ||
"UIWindow", | ||
"UIApplication", | ||
"UIEvent", | ||
] } | ||
|
||
[target."cfg(target_os = \"macos\")".dependencies] | ||
objc2-app-kit = { version = "0.2.0", features = [ | ||
"NSApplication", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should only be enabled under |
||
"NSEvent", | ||
"NSWindow", | ||
"NSView", | ||
"NSPasteboard", | ||
"NSPanel", | ||
"NSResponder", | ||
"NSOpenPanel", | ||
"NSSavePanel", | ||
"NSMenu", | ||
] } | ||
|
||
[target."cfg(target_os = \"android\")".dependencies] | ||
crossbeam-channel = "0.5" | ||
|
@@ -119,4 +185,4 @@ percent-encoding = "2.3" | |
|
||
[lints.rust.unexpected_cfgs] | ||
level = "warn" | ||
check-cfg = [ "cfg(linux)", "cfg(gtk)" ] | ||
check-cfg = ["cfg(linux)", "cfg(gtk)"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think the easiest approach for now might be for you to copy
objc2-web-kit
's definition from the source into a file in this repo, remove the#[cfg(feature = "objc2-app-kit")]
, changeNSWindow
toUIWindow
, and import it from that file on iOS instead of fromobjc2-web-kit
.