tauri-remote-ui 0.24.0 → 0.25.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 CHANGED
@@ -11,6 +11,16 @@
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** - `defaultWindowIcon`,`fetchDataStoreIdentifiers`,`getBundleType`,`getIdentifier`,`getName`,`getTauriVersion`,`getVersion`,`hide`,`removeDataStore`,`setDockVisibility`,`setTheme`,`show`
20
+
21
+ ### Rust
22
+ - `emit` - Emit method is updated to handle in this plugin.
23
+
14
24
  ## Operation Flow
15
25
 
16
26
  - **WebView:** Uses IPC for communication between frontend and backend.
@@ -20,14 +30,67 @@
20
30
 
21
31
  ## Usage
22
32
 
23
- 1. **Install the Rust plugin** in your Tauri project.
24
- 2. **Install the NPM plugin** in your frontend.
33
+ 1. **Install the Rust plugin** in your Tauri project `cargo add tauri-remote-ui`.
34
+ 2. **Initialize the Rust plugin**
35
+ ```rust
36
+ pub fn run() {
37
+ tauri::Builder::default()
38
+ .plugin(tauri_remote_ui::init())
39
+ .invoke_handler(tauri::generate_handler![
40
+ increment,
41
+ decrement,
42
+ enable_server,
43
+ disable_server,
44
+ exit_app,
45
+ ])
46
+ .setup(|app| {
47
+ app.manage(Arc::new(RwLock::new(Counter { now: 0 })));
48
+ Ok(())
49
+ })
50
+ .run(tauri::generate_context!())
51
+ .expect("error while running tauri application");
52
+ }
53
+ ```
54
+ 3. **Replace Emitter trait**
55
+ ```rust
56
+ use tauri::Emitter
57
+ ```
58
+ To
59
+ ```rust
60
+ use tauri_remote_ui::EmitterExt;
61
+ ```
62
+ 4. **Start/Stop Server**
63
+ ```rust
64
+ fn enable_server(app: AppHandle) -> String {
65
+ match app.start_remote_ui(RemoteUiConfig::default().set_port(Some(9090))) {
66
+ Ok(()) => format!("Server Started."),
67
+ Err(err) => format!("Server Error {:?}", err),
68
+ }
69
+ }
70
+ fn disable_server(app: AppHandle) -> String {
71
+ match app.stop_remote_ui() {
72
+ Ok(()) => format!("Server Stoped"),
73
+ Err(err) => format!("Server Error {:?}", err),
74
+ }
75
+ }
76
+ ```
77
+ 5. **Install the NPM plugin** in your frontend `npm i tauri-remote-ui`.
78
+ 6. **Replace the NPM package**
79
+ ```typescript
80
+ import { invoke } from "@tauri-apps/api/core";
81
+ import { listen } from "@tauri-apps/api/event";
82
+ ```
83
+ To
84
+ ```typescript
85
+ import { invoke } from "tauri-remote-ui/api/core";
86
+ import { listen } from "tauri-remote-ui/api/event";
87
+ ```
25
88
  3. **Access the UI remotely** via the provided web interface when activated.
26
89
 
27
90
  ## Development
28
91
 
29
92
  - Build Rust: `cargo build`
30
- - Build JS: `pnpm build` (from the root)
93
+ - Build JS: `pnpm build`
31
94
  - Example app: See `examples/tauri-app/`
32
95
 
33
96
  ## License
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tauri-remote-ui",
3
3
  "license": "MIT",
4
- "version": "0.24.0",
4
+ "version": "0.25.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
@@ -21,7 +21,7 @@ function getWsUrl() {
21
21
  }
22
22
  function getUrl() {
23
23
  const loc = window.location;
24
- const wsUrl = `${loc.protocol}//${loc.host}/remote_ui`;
24
+ const wsUrl = `${loc.protocol}//${loc.host}/remote_ui_disconnect`;
25
25
  return wsUrl;
26
26
  }
27
27
  /**
package/socket.js CHANGED
@@ -19,7 +19,7 @@ function getWsUrl() {
19
19
  }
20
20
  function getUrl() {
21
21
  const loc = window.location;
22
- const wsUrl = `${loc.protocol}//${loc.host}/remote_ui`;
22
+ const wsUrl = `${loc.protocol}//${loc.host}/remote_ui_disconnect`;
23
23
  return wsUrl;
24
24
  }
25
25
  /**