WIP: Dioxus-webview
This commit is contained in:
1 parent
28ac37a8b2
commit
9c01736895
9 files changed
+113
-20
No files matched your search
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "dioxus-webview"
|
||||
version = "0.0.0"
|
||||
authors = ["Jonathan Kelley <jkelleyrtp@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
webview = "0.1.1"
|
||||
@@ -0,0 +1,39 @@
|
||||
# Dioxus-webview
|
||||
|
||||
Dioxus-webview bridges virtual and Webview DOMs together to make simple, portable, desktop applications.
|
||||
|
||||
Dioxus-webview is an attempt at making a simpler "Tauri" where creating desktop applications is as simple as:
|
||||
|
||||
```rust
|
||||
// main.rs
|
||||
fn main() {
|
||||
dioxus_webview::new(|ctx| {
|
||||
let (count, set_count) = use_state(ctx, || 0);
|
||||
html! {
|
||||
<div>
|
||||
<h1> "Dioxus Desktop Demo" </h1>
|
||||
<p> "Count is {count}"</p>
|
||||
<button onclick=|_| set_count(count + 1) >
|
||||
"Click to increment"
|
||||
</button>
|
||||
</div>
|
||||
}
|
||||
})
|
||||
.configure_webview(|view| {
|
||||
// custom webview config options
|
||||
})
|
||||
.launch();
|
||||
}
|
||||
```
|
||||
|
||||
and then to create a native .app:
|
||||
|
||||
```
|
||||
dioxus bundle --platform macOS
|
||||
```
|
||||
|
||||
## Goals
|
||||
|
||||
Because the host VirtualDOM is running in its own native process, native applications can unlock their full potential. Dioxus-webview is designed to be a 100% rust alternative to ElectronJS without the memory overhead or bloat of ElectronJS apps.
|
||||
|
||||
By bridging the native process, desktop apps can access full multithreading power, peripheral support, hardware access, and native filesystem controls without the hassle of web technologies. Our goal with Dioxus-webview is to make it easy to ship both a web and native application, and quickly see large performance boosts without having to re-write the whole stack. As the dioxus ecosystem grows, we hope to see 3rd parties providing wrappers for storage, offline mode, etc that supports both web and native technologies.
|
||||
@@ -0,0 +1,7 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
||||
fn it_works() {
|
||||
assert_eq!(2 + 2, 4);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user