tauri-remote-ui 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -3
- package/package.json +1 -1
- package/socket.cjs +1 -1
- package/socket.js +1 -1
package/README.md
CHANGED
|
@@ -11,6 +11,20 @@
|
|
|
11
11
|
- **Zero App Changes:** No additional changes required to your app after plugin setup.
|
|
12
12
|
- **Future Compatibility:** When [CEF-RS](https://github.com/cef-rs/cef) becomes available, the same E2E tests (e.g., written with Playwright or similar tools that use the Chromium debug port) will work seamlessly in debug mode, ensuring long-term support for modern testing workflows.
|
|
13
13
|
|
|
14
|
+
## Completed Features
|
|
15
|
+
|
|
16
|
+
### Javascript
|
|
17
|
+
- **api/core** - `invoke`
|
|
18
|
+
- **api/event** - `listen`
|
|
19
|
+
- **api/app**
|
|
20
|
+
- `defaultWindowIcon`,`fetchDataStoreIdentifiers`,`getBundleType`,
|
|
21
|
+
- `getIdentifier`,`getName`,`getTauriVersion`,
|
|
22
|
+
- `getVersion`,`hide`,`removeDataStore`,
|
|
23
|
+
- `setDockVisibility`,`setTheme`,`show`
|
|
24
|
+
|
|
25
|
+
### Rust
|
|
26
|
+
- `emit` - Emit method is updated to handle in this plugin.
|
|
27
|
+
|
|
14
28
|
## Operation Flow
|
|
15
29
|
|
|
16
30
|
- **WebView:** Uses IPC for communication between frontend and backend.
|
|
@@ -20,14 +34,67 @@
|
|
|
20
34
|
|
|
21
35
|
## Usage
|
|
22
36
|
|
|
23
|
-
1. **Install the Rust plugin** in your Tauri project
|
|
24
|
-
2. **
|
|
37
|
+
1. **Install the Rust plugin** in your Tauri project `cargo add tauri-remote-ui`.
|
|
38
|
+
2. **Initialize the Rust plugin**
|
|
39
|
+
```rust
|
|
40
|
+
pub fn run() {
|
|
41
|
+
tauri::Builder::default()
|
|
42
|
+
.plugin(tauri_remote_ui::init())
|
|
43
|
+
.invoke_handler(tauri::generate_handler![
|
|
44
|
+
increment,
|
|
45
|
+
decrement,
|
|
46
|
+
enable_server,
|
|
47
|
+
disable_server,
|
|
48
|
+
exit_app,
|
|
49
|
+
])
|
|
50
|
+
.setup(|app| {
|
|
51
|
+
app.manage(Arc::new(RwLock::new(Counter { now: 0 })));
|
|
52
|
+
Ok(())
|
|
53
|
+
})
|
|
54
|
+
.run(tauri::generate_context!())
|
|
55
|
+
.expect("error while running tauri application");
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
3. **Replace Emitter trait**
|
|
59
|
+
```rust
|
|
60
|
+
use tauri::Emitter
|
|
61
|
+
```
|
|
62
|
+
To
|
|
63
|
+
```rust
|
|
64
|
+
use tauri_remote_ui::EmitterExt;
|
|
65
|
+
```
|
|
66
|
+
4. **Start/Stop Server**
|
|
67
|
+
```rust
|
|
68
|
+
fn enable_server(app: AppHandle) -> String {
|
|
69
|
+
match app.start_remote_ui(RemoteUiConfig::default().set_port(Some(9090))) {
|
|
70
|
+
Ok(()) => format!("Server Started."),
|
|
71
|
+
Err(err) => format!("Server Error {:?}", err),
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
fn disable_server(app: AppHandle) -> String {
|
|
75
|
+
match app.stop_remote_ui() {
|
|
76
|
+
Ok(()) => format!("Server Stoped"),
|
|
77
|
+
Err(err) => format!("Server Error {:?}", err),
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
5. **Install the NPM plugin** in your frontend `npm i tauri-remote-ui`.
|
|
82
|
+
6. **Replace the NPM package**
|
|
83
|
+
```typescript
|
|
84
|
+
import { invoke } from "@tauri-apps/api/core";
|
|
85
|
+
import { listen } from "@tauri-apps/api/event";
|
|
86
|
+
```
|
|
87
|
+
To
|
|
88
|
+
```typescript
|
|
89
|
+
import { invoke } from "tauri-remote-ui/api/core";
|
|
90
|
+
import { listen } from "tauri-remote-ui/api/event";
|
|
91
|
+
```
|
|
25
92
|
3. **Access the UI remotely** via the provided web interface when activated.
|
|
26
93
|
|
|
27
94
|
## Development
|
|
28
95
|
|
|
29
96
|
- Build Rust: `cargo build`
|
|
30
|
-
- Build JS: `pnpm build`
|
|
97
|
+
- Build JS: `pnpm build`
|
|
31
98
|
- Example app: See `examples/tauri-app/`
|
|
32
99
|
|
|
33
100
|
## License
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tauri-remote-ui",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.26.0",
|
|
5
5
|
"author": "DraviaVemal",
|
|
6
6
|
"description": "A Tauri plugin that exposes the application's UI to a web browser, allowing full interaction while the native app continues running. This enables end-to-end UI testing using existing web-based testing tools without requiring modifications to the app itself.",
|
|
7
7
|
"type": "module",
|
package/socket.cjs
CHANGED
package/socket.js
CHANGED