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

refactor(core): add support to multiple webviews on a Tauri window #8280

Merged
merged 60 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
787e4d5
feat: update to latest wry
lucasfernog Nov 12, 2023
947d3ed
wry dev branch [skip ci]
lucasfernog Nov 13, 2023
6e2d849
fix linux [skip ci]
lucasfernog Nov 13, 2023
f0484ea
refactor(runtime): split webview and window types
lucasfernog Nov 13, 2023
488a6c5
split dispatch
lucasfernog Nov 13, 2023
f3e74fb
implement create_webview
lucasfernog Nov 13, 2023
11c9038
move webview message
lucasfernog Nov 13, 2023
9660e7c
wip webview mod
lucasfernog Nov 14, 2023
7b1270c
create webview manager, finish webview struct and builder
lucasfernog Nov 14, 2023
544a2c0
fix tests and docs
lucasfernog Nov 14, 2023
8c3ad5b
rename WindowUrl to WebviewUrl
lucasfernog Nov 14, 2023
0fee396
update examples
lucasfernog Nov 14, 2023
700a029
event refactor
lucasfernog Nov 15, 2023
8802d5e
update JS API
lucasfernog Nov 16, 2023
4e80ea4
fix events
lucasfernog Nov 16, 2023
688eb4a
update example
lucasfernog Nov 16, 2023
1b3d2f2
add WebviewWindow class on JS
lucasfernog Nov 16, 2023
2f0cca9
fix macos build
lucasfernog Nov 16, 2023
b950e4e
allow creating window+webview on the same runtime call
lucasfernog Nov 19, 2023
8dd2837
rename tauri://window-created to tauri://webview-created
lucasfernog Nov 19, 2023
aedca97
Window::add_child
lucasfernog Nov 19, 2023
b9f1668
use inner_size from webview on macOS
lucasfernog Nov 20, 2023
2296c63
add multiwebview example
lucasfernog Nov 21, 2023
5cf0a80
automatically resize webviews on window resize
lucasfernog Nov 21, 2023
38d064f
Merge remote-tracking branch 'origin/dev' into feat/multiwebview
lucasfernog Nov 21, 2023
33c7310
fix tests
lucasfernog Nov 21, 2023
03687de
set_position, set_size
lucasfernog Nov 21, 2023
c638f2d
position, size getters
lucasfernog Nov 21, 2023
e434ab0
set_focus
lucasfernog Nov 21, 2023
173123e
add close fn
lucasfernog Nov 21, 2023
41c2246
update mock runtime
lucasfernog Nov 21, 2023
c148648
lint [skip ci]
lucasfernog Nov 21, 2023
ed7594f
fix inner_size getter [skip ci]
lucasfernog Nov 21, 2023
712178d
import hwnd [skip ci]
lucasfernog Nov 21, 2023
b16bcfb
Merge remote-tracking branch 'origin/dev' into feat/multiwebview
lucasfernog Dec 20, 2023
e81accd
Merge remote-tracking branch 'origin/dev' into feat/multiwebview
lucasfernog Dec 27, 2023
1a2a039
update webview bound ratios on set_size/set_position
lucasfernog Dec 27, 2023
072c4f0
add auto_resize option
lucasfernog Dec 27, 2023
ab4c3b7
fix android
lucasfernog Dec 27, 2023
38f8117
fix build on windows
lucasfernog Dec 27, 2023
c2c98f7
typo
lucasfernog Dec 27, 2023
544f668
with_webview isnt desktop only
lucasfernog Dec 27, 2023
6fb97cd
add WebviewWindow rust struct (and builder)
lucasfernog Jan 8, 2024
cecbbbf
fix build on android
lucasfernog Jan 8, 2024
a2886ce
merge from dev
lucasfernog Jan 8, 2024
bad126c
license header
lucasfernog Jan 8, 2024
6b2676a
fix macos/windows
lucasfernog Jan 8, 2024
75e825f
fix macos build
lucasfernog Jan 9, 2024
67c1b45
merge from dev
lucasfernog Jan 23, 2024
d8f6e65
resolve todo
lucasfernog Jan 23, 2024
b454286
handle window not found
lucasfernog Jan 23, 2024
523da83
hide unstable features
lucasfernog Jan 23, 2024
75746e3
document unstable feature [skip ci]
lucasfernog Jan 23, 2024
394f256
webview plugin permissions
lucasfernog Jan 23, 2024
4317bf0
hide more stuff
lucasfernog Jan 23, 2024
c1329a0
fix doctests
lucasfernog Jan 24, 2024
3d95abe
typos
lucasfernog Jan 24, 2024
82edbcd
add change files
lucasfernog Jan 24, 2024
9d3812e
fix examples
lucasfernog Jan 24, 2024
f692b5f
rename hook
lucasfernog Jan 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/tauri-build/src/codegen/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::{
path::PathBuf,
};
use tauri_codegen::{context_codegen, ContextData};
use tauri_utils::config::{AppUrl, WindowUrl};
use tauri_utils::config::{AppUrl, WebviewUrl};

// TODO docs
/// A builder for generating a Tauri application context during compile time.
Expand Down Expand Up @@ -101,7 +101,7 @@ impl CodegenContext {
&config.build.dist_dir
};
match app_url {
AppUrl::Url(WindowUrl::App(p)) => {
AppUrl::Url(WebviewUrl::App(p)) => {
println!("cargo:rerun-if-changed={}", config_parent.join(p).display());
}
AppUrl::Files(files) => {
Expand Down
6 changes: 3 additions & 3 deletions core/tauri-codegen/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use quote::quote;
use sha2::{Digest, Sha256};

use tauri_utils::assets::AssetKey;
use tauri_utils::config::{AppUrl, Config, PatternKind, WindowUrl};
use tauri_utils::config::{AppUrl, Config, PatternKind, WebviewUrl};
use tauri_utils::html::{
inject_nonce_token, parse as parse_html, serialize_node as serialize_html_node,
};
Expand Down Expand Up @@ -158,8 +158,8 @@ pub fn context_codegen(data: ContextData) -> Result<TokenStream, EmbeddedAssetsE

let assets = match app_url {
AppUrl::Url(url) => match url {
WindowUrl::External(_) => Default::default(),
WindowUrl::App(path) => {
WebviewUrl::External(_) => Default::default(),
WebviewUrl::App(path) => {
if path.components().count() == 0 {
panic!(
"The `{}` configuration cannot be empty",
Expand Down
6 changes: 3 additions & 3 deletions core/tauri-config-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
"default": "index.html",
"allOf": [
{
"$ref": "#/definitions/WindowUrl"
"$ref": "#/definitions/WebviewUrl"
}
]
},
Expand Down Expand Up @@ -573,7 +573,7 @@
},
"additionalProperties": false
},
"WindowUrl": {
"WebviewUrl": {
"description": "An URL to open on a Tauri webview window.",
"anyOf": [
{
Expand Down Expand Up @@ -2529,7 +2529,7 @@
"description": "The app's external URL, or the path to the directory containing the app assets.",
"allOf": [
{
"$ref": "#/definitions/WindowUrl"
"$ref": "#/definitions/WebviewUrl"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion core/tauri-runtime-wry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ edition = { workspace = true }
rust-version = { workspace = true }

[dependencies]
wry = { version = "0.35", default-features = false, features = [ "file-drop", "protocol", "os-webview" ] }
wry = { version = "0.35.1", default-features = false, features = [ "file-drop", "protocol", "os-webview" ] }
tao = { version = "0.24", default-features = false, features = [ "rwh_05" ] }
tauri-runtime = { version = "1.0.0-alpha.7", path = "../tauri-runtime" }
tauri-utils = { version = "2.0.0-alpha.12", path = "../tauri-utils" }
Expand Down
Loading
Loading